Hi all
I am a beginner of Qt. I want to build a qml ui statically . I read the artical how to build qt statically . Every thing is ok if i donot use qml in the sourse file .
When i build my source file statically using qml that does not work !! shows errors !! what should i do now !! This is my code bellow.
#include<QtCore/QCoreApplication>
#include<QDeclarativeView>
int main(int argc,char*argv[])
{
QDeclarativeView view;
view.
setSource(QUrl::fromLocalFile("F:/Qt/qt/StaticQMLTest/myBox.qml"));
view.show();
return a.exec();
}
#include<QtCore/QCoreApplication>
#include<QDeclarativeView>
int main(int argc,char*argv[])
{
QCoreApplication a(argc,argv);
QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("F:/Qt/qt/StaticQMLTest/myBox.qml"));
view.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
content of the .pro file
QT += core
QT += declarative
QT -= gui
CONFIG += staticlib
TARGET = StaticQMLTest
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
OTHER_FILES += \
myBox.qml
QT += core
QT += declarative
QT -= gui
CONFIG += staticlib
TARGET = StaticQMLTest
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
OTHER_FILES += \
myBox.qml
To copy to clipboard, switch view to plain text mode
I am waiting for your replay ...
Bookmarks