Results 1 to 5 of 5

Thread: Build qml statically

  1. #1
    Join Date
    Nov 2010
    Posts
    2
    Qt products
    Qt4

    Default Build qml statically

    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.

    Qt Code:
    1. #include<QtCore/QCoreApplication>
    2. #include<QDeclarativeView>
    3. int main(int argc,char*argv[])
    4. {
    5. QCoreApplication a(argc,argv);
    6. QDeclarativeView view;
    7. view.setSource(QUrl::fromLocalFile("F:/Qt/qt/StaticQMLTest/myBox.qml"));
    8. view.show();
    9. return a.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

    content of the .pro file
    qmake Code:
    1. QT += core
    2. QT += declarative
    3.  
    4. QT -= gui
    5.  
    6.  
    7. CONFIG += staticlib
    8.  
    9.  
    10. TARGET = StaticQMLTest
    11.  
    12. CONFIG += console
    13.  
    14. CONFIG -= app_bundle
    15.  
    16.  
    17. TEMPLATE = app
    18.  
    19.  
    20.  
    21. SOURCES += main.cpp
    22.  
    23.  
    24. OTHER_FILES += \
    25.  
    26. myBox.qml
    To copy to clipboard, switch view to plain text mode 

    I am waiting for your replay ...
    Last edited by wysota; 29th November 2010 at 10:30.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Build qml statically

    QT -= gui
    What is that line for?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Nov 2010
    Posts
    2
    Qt products
    Qt4

    Default Re: Build qml statically

    I remove this line , but it was not working. Can you say what next !!

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Build qml statically

    What errors are you getting?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Build qml statically

    I have the same problem in Qt 5.3.

    The error is:
    Project ERROR: Unknown module(s) in QT: quick qml

    .pro is

    Qt Code:
    1. TEMPLATE = app
    2.  
    3. QT += qml quick widgets
    4.  
    5. SOURCES += main.cpp
    6.  
    7. RESOURCES += qml.qrc
    8.  
    9. # Additional import path used to resolve QML modules in Qt Creator's code model
    10. QML_IMPORT_PATH =
    11.  
    12. # Default rules for deployment.
    13. include(deployment.pri)
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 0
    Last Post: 18th June 2010, 22:20
  2. How can i build an app statically?
    By srohit24 in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2010, 10:38
  3. How caqn I provide my own fontconfig library to build qt statically?
    By yodasoda in forum Installation and Deployment
    Replies: 0
    Last Post: 22nd March 2010, 19:55
  4. statically link Qt libraries (not build static library)
    By mcarter in forum Qt Programming
    Replies: 3
    Last Post: 1st February 2010, 21:42
  5. How can I build <<hello world>> example statically
    By krivenok in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2006, 16:25

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.