Questions tagged [moc]

MOC is Qt's Meta Object Compiler. It transforms certain Qt-specific macros into the C++ code and meta information necessary for Qt's signal and slots, RTTI, and the dynamic property system.

The meta-object system is based on three things:

  1. The QObject class provides a base class for objects that can take advantage of the meta-object system.
  2. The Q_OBJECT macro inside the private section of the class declaration is used to enable meta-object features, such as dynamic properties, signals, and slots.
  3. The Meta-Object Compiler (moc) supplies each QObject subclass with the necessary code to implement meta-object features.
216 questions
0
votes
1 answer

core data freezes the app on multiple save

I have problem in saving the data in core data. I have to save multiple book information in the data base on click of button. When I click on the button I call the method and save the book information in data base. For the first three clicks it is…
Gyanendra
  • 361
  • 2
  • 15
0
votes
2 answers

Qt MOC generated code documentation

I am designing a user interface in Qt, and for longevity reasons I'd like to not require the Qt Meta-Object Compiler be used in future builds. I know the MOC parses certain macros in standard C++ code and generates C++ code based on these. What I'd…
reign_man
  • 569
  • 2
  • 8
  • 21
0
votes
1 answer

waf : passing compiler flags to qt's moc

I my trying to run a project using waf which uses boost library . To overcome a problem I need to pass and -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED argument to MOC. I tried doing so in the wscript as bld(features ='cxx', source …
Vihaan Verma
  • 12,815
  • 19
  • 97
  • 126
-1
votes
2 answers

Qt 4.8: undefined reference to vtable using slots and signals

I'm getting a weird error with my slots and signals code in Qt v4.8.5. Whenever I include my QObject with slots: class dnEventHandler : public QObject { Q_OBJECT public slots: void LaunchProjectCreator(); }; I get some odd…
beakr
  • 5,709
  • 11
  • 42
  • 66
-2
votes
2 answers

Qt class MyButton when use Q_PRIVATE_SLOT, the .h file compile error: undefined MyButtonPrivate

https://www.dvratil.cz/2019/11/q-private-slot-with-new-connect-syntax/ #include #include class MyButtonPrivate; class MyButton : public QPushButton { Q_OBJECT public: explicit MyButton(QWidget* parent); ~MyButton()…
-2
votes
1 answer

Why does this Qt header file fail to get parsed by moc?

I created a new 'C++ library' project in Qt, which has the following header file: #include "Test_global.h" #include #include class TESTSHARED_EXPORT Test : QTcpServer { Q_OJECT public: Test(); …
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
1 2 3
14
15