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

Generatin finger print template

I need to generate finger print template on Windows CE 5.0 device. It has izzix finger print reader. I have to MOC (Match on card). My smart card has template derived from my finger print. I can read finger print using reader. But how can i generate…
suyuti
  • 286
  • 1
  • 3
  • 8
0
votes
1 answer

Qt undefined reference vtable

I made simple game to shot rectangle(class Bullet) from other rectangle(class MyRect). I have error undefined reference to 'vtable for bullet'. I have written that is connected with Q_OBJECT and moc.I can't resolve this problem. Bullet.h #ifndef…
Paweł
  • 1
  • 1
0
votes
1 answer

Generate moc file for header only class outside the project tree

I have some classes defined only using a headers file that inherits the QObject class and uses the Q_OBJECT macro. They are placed in a certain folder on my PC. I want to include these classes in my qt project. I have written a .pri file (located in…
0
votes
1 answer

Error when building Qt app in a recent Docker

I am building a Qt c++ app in a Docker on Travis. I am trying to update the base Docker image from Cosmic to Disco. I did these updates: Travis dist: Trusty => Xenial Docker image: Cosmic => Disco Now I get this error when building: clang: error: no…
Denis Rouzaud
  • 2,412
  • 2
  • 26
  • 45
0
votes
1 answer

Force the Qt MOC to expand some custom macros?

Is it possible to force the Qt MOC to expand some of my custom preprocessor defines to achieve some kind of 2-pass preprocessing? E.g.: // MOC macro @MOC #define add(a, b) (a + b) // Should be expanded by MOC (1st run) // "Normal" macro #define…
FlKo
  • 805
  • 1
  • 10
  • 27
0
votes
3 answers

C++ Preprocessor and QT MOC

I am attempting something (perhaps stupid). Have used some macroes to create "amounts" of functions in C++ domain; #define THR_CONFIG_VALUE(path, value, type, name, defaultvalue) \ type name() { return m_##name; } \ void set##name(type data)…
Tore H
  • 39
  • 6
0
votes
0 answers

Qt moc chokes on DEFINE containing too many backslashes

We are still on Qt4.7 in our workplace, so bear in mind this could be a known bug fixed in later versions. I have googled for this problem and it is possible I am not using correct terms. Here goes. In my .pro file I have: win32 { DEFINES +=…
iwarv
  • 335
  • 4
  • 13
0
votes
1 answer

How can I call a method from QMainWindow?

I do need to invoke a method from my MainWindow class, that inherit from QMainWindow class from a class outside MainWindow, something like this: Q_ASSERT(QMetaObject::invokeMethod(mainWindow, "attachmentDownloadComplete")); mainWindow is of class…
Jack
  • 16,276
  • 55
  • 159
  • 284
0
votes
1 answer

Signal Slot is missing in moc file

I cannot use the button, which I have connected with the correct slot. Here the infoPage.cpp file: #include "infoPage.h" InfoPage::InfoPage(QWidget *parent) : QDialog(parent) { ui.setupUi(this); bool working = false; working =…
Makuna
  • 558
  • 1
  • 6
  • 19
0
votes
1 answer

Can we implement multiple QtRO interfaces in the same object?

It's all in the question. I am wondering if we can implement multiple QtRO (Qt remote objects) interfaces in the same object. And then in the client side acquire a replica of the part we need of the server object.
Houss_gc
  • 727
  • 5
  • 27
0
votes
2 answers

moc: Unknown option -isystem

I am trying to install score-p. It has standard build chain. I passed the configuration part successfully. Makefile was generated automatically after configuration. Then I did make and got an error. The problem is moc complains that -isystem is an…
Shibli
  • 5,879
  • 13
  • 62
  • 126
0
votes
1 answer

Qt moc.exe - difference between 32 and 64-Bit version?

I am trying to find out what the difference is between the moc.exe (Qt meta object compiler) in the respective 32-bit and the 64-bit subfolder of Qt5. Does it make any difference if I let my application with 64-Bit target architecture be built (and…
Navie
  • 164
  • 1
  • 8
0
votes
0 answers

Using CMAKE_AUTOMOC with a custom version of Qt

I am developing a plugin for Maya which comes with its own custom version of Qt library (including the moc). I downloaded the exact Qt version Maya uses and tried the following: set(CMAKE_AUTOMOC ON) find_package(Qt5Widgets) Now this works but only…
Samaursa
  • 16,527
  • 21
  • 89
  • 160
0
votes
1 answer

Qt: How are arrays or dictionaries passed from qscriptengine?

I've created a QScriptEngine and exposed an object's function I can call from js script. engine->globalObject().setProperty("obj", myObj); myObj is a QObject that has a function like... void MyObject::doSomething(int w, int h) { ... } and in…
voodoogiant
  • 2,118
  • 6
  • 29
  • 49
0
votes
1 answer

How to make a JSON-like QObject

In short, I want to make an JSON-like object, which is easily accessible to both QML / Qt C++ side. In QML, I can make a settings object like this: Item { id: settings property alias snapshot: snapshot QtObject { id: snapshot …
kuanyui
  • 782
  • 13
  • 23