Results 1 to 4 of 4

Thread: Displaying pics

  1. #1
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Displaying pics

    hey there i was in the middle of creating my menus and added a cut, copy and paste actions to the edit menu. they are supposed to show the .png files of the cut copy and paste pics but after comiplation they dont show up and i cant figure out why? heres my code below:

    Qt Code:
    1. pasteAct = new QAction(QIcon(":/images/paste.png"), tr("Pa&ste"), this);
    2. pasteAct->setShortcut(tr("Ctrl+V"));
    3. editMenu->addAction(pasteAct);
    4. connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));
    To copy to clipboard, switch view to plain text mode 

    i have a folder named images inside my application folder with the pictures but it still doesnt show, any ideas??

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying pics

    Could you show us your .qrc file?

  3. #3
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Displaying pics

    i dont actually have a .qrc file in my application folder, do i need it to display the pictures? how do i set one up?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying pics

    You need one to make the resources work (i.e. the ":/..." paths). You can create it using Qt Designer, then add "RESOURCES += filename.qrc" to your .pro file.

  5. The following user says thank you to jacek for this useful post:

    therealjag (12th March 2006)

Similar Threads

  1. Replies: 1
    Last Post: 3rd February 2009, 06:11
  2. Problem with displaying jpeg and gif images, in QT4
    By node_ex in forum Installation and Deployment
    Replies: 1
    Last Post: 23rd September 2008, 15:29
  3. QWidget pixmap AFTER displaying html ("rich text")
    By gavrilo princep in forum Newbie
    Replies: 0
    Last Post: 17th July 2007, 01:59
  4. New to QT, problem displaying main window...
    By McCall in forum Qt Programming
    Replies: 4
    Last Post: 15th June 2007, 14:27
  5. QTAbBar not displaying
    By Dune in forum Qt Programming
    Replies: 17
    Last Post: 9th February 2006, 18:25

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.