Results 1 to 19 of 19

Thread: Qt has no dependences?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #14
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Qt has no dependences?

    I made a qrc file.
    It looks like this(added prefix and then images):
    Qt Code:
    1. <RCC>
    2. <qresource prefix="/new/prefix1">
    3. <file>1.jpg</file>
    4. <file>ex.png</file>
    5. <file>o.png</file>
    6. <file>icon.png</file>
    7. </qresource>
    8. </RCC>
    To copy to clipboard, switch view to plain text mode 

    Then in .cpp file I call images like this:
    Qt Code:
    1. QPalette palette;
    2. palette.setBrush(this->backgroundRole(), QBrush(QImage("1.jpg")));
    3. this->setPalette(palette);
    To copy to clipboard, switch view to plain text mode 

    Then,I save,build and move the exe alone to a removable disk.
    And...It doesn't work.All the images don't show(like if the qrc doesn't exist..).I add the icons to the removable disk(near exe)and it works then...

    In my main.cpp I have this:
    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include "tictactoe.h"
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. TicTacToe w;
    8. w.show();
    9. Q_INIT_RESOURCE(icons); //My qrc file is: icons.qrc
    10. return a.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

    Please help.
    Last edited by "BumbleBee"; 3rd April 2011 at 18:24.

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
  •  
Qt is a trademark of The Qt Company.