0
Follow
0
View

qt# problem: Many qml files of QT4 do not have header files such as QQuickView, QQuickWidget, QQmlApplicationEngine to solve this problem

dm2213692 注册会员
2023-02-28 08:16
< div class = "md_content_show e397 data - v - 3967" = "" >

I try thank you

DDN911 注册会员
2023-02-28 08:16
dailiben 注册会员
2023-02-28 08:16

qt5 has

dulongsb 注册会员
2023-02-28 08:16

the reference answer GPT ᴼ ᴾ ᴱ ᴺ ᴬ ᴵ < br / > in Qt 4 Qt Quick and QML and not as a built-in module provides. Instead, you need to use the header file and classes provided by the QDeclarative module.

To use QML in Qt 4, you need to ensure that you have added the following lines to your project file(.pro file) :

QT += declarative


Then include the header file provided by the QDeclarative module in your source code. For example, you can include the QDeclarativeView header file with the following statement:



#include 

Note that the version of QML used in Qt 4 is 1.0, which is different from the version used in Qt 5(usually 2.x). In addition, Qt Quick and QML have replaced QDeclarative in Qt 5.

In Qt 4, you can use QDeclarativeItem and QDeclarativeEngine to expose custom C++ objects to QML. For more information on how to use these classes, see the QML Integration section in the Qt 4 documentation.

Aaronz85 注册会员
2023-02-28 08:16

Please accept
QT4 does not support QML, so there is no corresponding header file. If you want to use QML, it is recommended that you upgrade to QT5, which supports QML and provides the appropriate header files. Alternatively, you can build QML applications using Qt Creator, which automatically generates header files.

cth1117 注册会员
2023-02-28 08:16
< div class = "md_content_show e397 data - v - 3967" = "" >

have written in QT4.8.4

About the Author

Question Info

Publish Time
2023-02-28 08:16
Update Time
2023-02-28 08:16

Related Question

Qt c++同时http get

关于#qt#的问题,请各位专家解答!

为什么我的rv1126板子运行不了qt交叉编译链构建出的文件

JAVA:在subclass中使用getter时报错java.lang.NoSuchMethodError。但换一个class用相同的的代码却能正常运行

python写ui学习pyqt好还是pyside?

针对qt开发是否应该使用designer?

mac QT Mysql postgresql

不拖拽Qt设计器窗口

NoSuchElementException . python文本框

QT信号槽相对于const ref参数的行为