×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    QT libraries in windows needed?

    Hi

    QT comes standard in Linux. In MacOs we have xcode, the same thing, right? but what about Windows? It won´t ask for QT libraries when executing the program????

    Many thanks!

  2. #2
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: QT libraries in windows needed?

    Quote Originally Posted by nidcker View Post
    Hi

    QT comes standard in Linux. In MacOs we have xcode, the same thing, right? but what about Windows? It won´t ask for QT libraries when executing the program????

    Many thanks!
    Your question is not clear to understand. If you are asking any runtime are required in windows then the answer is yes.

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    Re: QT libraries in windows needed?

    Well I´ve build the app and execute the exe file in a Windows pc from a USB drive (the app has to be exectuted from the USB) where QT is not installed, and an error about the mingw10.dll appears and the program execution fails. So I wonder If I need to add any library to the files?

  4. #4
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: QT libraries in windows needed?

    Quote Originally Posted by nidcker View Post
    Well I´ve build the app and execute the exe file in a Windows pc from a USB drive (the app has to be exectuted from the USB) where QT is not installed, and an error about the mingw10.dll appears and the program execution fails. So I wonder If I need to add any library to the files?
    Yes, you will have to provide Qt runtime and any other dependencies with your application in this case.

  5. #5
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    Re: QT libraries in windows needed?

    It ask first for the mingwm10.dll file. I´ve copied it to my usb folder where the exe file. Then asks for the libgcc_s_dw2-1.dll file. Copied. And finally asks for the Qt4Core.dll file, and this file doesn´t exist in the computer where I have QT installed. ¿?

  6. #6
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT libraries in windows needed?

    I think you'll find QtCore4.dll in the bin directory of your Qt install. You're not likely to find Qt4Core.dll anywhere.

  7. #7
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    Re: QT libraries in windows needed?

    Hi,

    I´ve copied QtCore4.dll and QtGui4.dll and the program executes ok now. They were in the bin folder, thanks .

    But the images (defined as a QGraphicsView) don´t appear.

    Why is this?

    Thanks

  8. #8
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: QT libraries in windows needed?

    Quote Originally Posted by nidcker View Post
    Hi,

    I´ve copied QtCore4.dll and QtGui4.dll and the program executes ok now. They were in the bin folder, thanks .

    But the images (defined as a QGraphicsView) don´t appear.

    Why is this?

    Thanks
    Has the path of the resource changed.

  9. #9
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    Re: QT libraries in windows needed?

    The path of the resource is ok.

    For instance I have the file1.ui and the image has a brackground using this code.

    <property name="styleSheet">
    <string notr="true">QFrame { background-image: url(:/images/driver.jpg) }</string>
    </property>
    It works in the PC where the QT is installed but not in another one from the USB drive.

  10. #10
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT libraries in windows needed?

    The images don't appear because you haven't got the path defined correctly. Are the images in a resource file or individual files? How are you referring to them (give an example path string)?

  11. #11
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    Re: QT libraries in windows needed?

    The images are in a resource file "Resources".
    Inside it I have my file.qrc.
    It has the Prefix: /
    And contains the image "images/driver.jpg" with is inside the images folder of the project.

    The image is shown perfectly if I execute it in the PC where QT is installed. It doesn´t if is executed from the USB in another computer without QT.

    So how is possible the path could be wrong if I can see the image in the first scenario?

    thanks

  12. #12
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT libraries in windows needed?

    The image is shown perfectly if I execute it in the PC where QT is installed. It doesn´t if is executed from the USB in another computer without QT.
    This is likely because you're not referencing the files in the resource file, but rather off your PC disk.

    Maybe it would help if you answered my second question.

  13. #13
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    Re: QT libraries in windows needed?

    I hope you mean this: For example I refer to the icon like this from a .cpp file

    trayIcon->setIcon(QIcon(":/images/favicon.ico"));

    To a background image like this from a .h file.

    graphicsView->setStyleSheet(QString::fromUtf8("QFrame { background-image: url(:/images/driver.jpg) }"));

    Or like this from the .ui file

    <string notr="true">QFrame { background-image: url(:/images/driver.jpg) }</string>

    In the directory tree of my project I have

    -Other files
    --images
    ---favicon.ico
    ---driver.jpg
    -Resources
    --file.qrc (this file contains images/driver.jpg, images/favicon.ico)

    And in the .pro file I have:

    OTHER_FILES += \
    images/driver.jpg \
    images/favicon.ico

    RESOURCES += \
    file.qrc

    I hope it is clear now

    Thanks!
    Last edited by nidcker; 2011-04-28 at 09:09. Reason: adding information

  14. #14
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT libraries in windows needed?

    That should in theory work. There are many ways to screw up the resource file, but one would expect the problem to be obvious in the simulator.

    You might check carefully the hardware build log and be sure that there are no errors or strange messages -- it's possible, eg, that your build is picking up a downlevel resource file.

Similar Threads

  1. Replies: 35
    Last Post: 2010-09-13, 12:05
  2. Are all Qt-libraries in the *.sis-file?
    By KLTIDE in forum [Archived] Qt SDKs and Tools
    Replies: 2
    Last Post: 2010-05-03, 14:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×