qmetatype

How can I pin-point the location of the call in my code that triggered QObject::connect: Cannot queue arguments of type in Qt5?

本秂侑毒 提交于 2019-12-25 01:00:09
问题 In my Qt5 application, I am receiving a log message at run time from Qt itself that looks like this: QObject::connect: Cannot queue arguments of type 'QHostAddress' I know how to fix the cause of this message using Q_DECLARE_METATYPE(QHostAddress) macro or qRegisterMetaType<QHostAddress>("QHostAddress") class, that is not what this question is about. What I want to know is, how can I pin-point the exact location of the call in my code that triggered this message ? Since the message does not

How to register a class for use it in a QWebChannel signal in Qt

谁都会走 提交于 2019-12-10 10:02:53
问题 Im using QT 5 with a WebChannel to communicate with a HTML Page. I successfully able to communicate texts and strings. however i woud like to communicate some points data. the official documentation says "No manual message passing and serialization of data is required," http://doc.qt.io/qt-5/qwebchannel.html When i try to send a object or an array, instead of a string, the application throw this message: Don't know how to handle 'data', use qRegisterMetaType to register it. How can I emit a

What is the difference between Q_ENUM and Q_ENUMS

三世轮回 提交于 2019-12-01 00:02:53
问题 I just found multiple examples showing the usage of Q_ENUM and Q_ENUMS and looking into the definition of Q_ENUM showed me that it includes Q_ENUMS and other definitions. I am not sure which one to write when using the enum in Q_PROPERTY , Qml/QtQuick, in signals/slots, QVariants and qDebug() output. It seems like the Q_ENUM is the better one as it is defined using Q_ENUMS , but I'm just guessing here. What exactly are the differences, why are there two at all and which one should be prefered