QDialog не найден во время компиляции - PullRequest
0 голосов
/ 17 декабря 2018

Я прошу ваших знаний о QT.

Знаете ли вы, почему во время компиляции не удается найти файл moc из QT?

В настоящее время у меня есть эта проблема в Qt Project, ошибка

"moc_SettingsDialog.cpp: 9: в файле, включенном из moc_SettingsDialog.cpp: 9: SettingsDialog.h: 12: ошибка: файл 'QDialog' не найден".

Это мой профессиональный файл:

#-------------------------------------------------
#
# Project created by QtCreator 2018-12-04T14:58:35
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = cashRegister
TEMPLATE = app

message($${INCLUDEPATH})


# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

CONFIG += c++11


SOURCES += \
        main.cpp \
        cashRegister.cpp \
    sources/settings.cpp \
    sources/settingsBuilder.cpp \
    sources/parseConfFile.cpp \
    sources/SupplyList.cpp \
    sources/Item.cpp \
    sources/SettingsDialog.cpp \
    sources/TpeNetwork.cpp \
    sources/ManagerNetwork.cpp \
    sources/BillNetwork.cpp \
    sources/PaymentServerNetwork.cpp \
    sources/NetworkFactory.cpp \
    sources/Customer.cpp \
    sources/Cart.cpp

HEADERS += \
        cashRegister.h \
    includes/settings.h \
    includes/settingsBuilder.h \
    includes/parseConfFile.h \
    includes/SupplyList.h \
    includes/Item.h \
    includes/Mybutton.h \
    includes/SettingsDialog.h \
    includes/TpeNetwork.h \
    includes/ManagerNetwork.h \
    includes/BillNetwork.h \
    includes/PaymentServerNetwork.h \
    includes/NetworkFactory.h \
    includes/NetworkCode.h \
    includes/networkabstract.h \
    includes/networkinterface.hpp \
    includes/Customer.h \
    includes/Cart.h

FORMS += \
        cashRegister.ui \
    SettingsDialog.ui

macx {
    _BOOST_PATH = /usr/local/Cellar/boost/1.68.0
    INCLUDEPATH += "$${_BOOST_PATH}/include/"
    LIBS += -L$${_BOOST_PATH}/lib -lboost_regex
}

unix:!macx {
    LIBS += -L"/usr/lib/x86_64-linux-gnu" -lboost_regex

    INCLUDEPATH += /usr/include/boost
    DEPENDPATH += /usr/include/boost
    DEFINES += QT_NO_VERSION_TAGGING

}

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
    config.qrc

Версия Qt: 5.12.0 ОС: MacOS 10.14 и Ubuntu

...