PDA

View Full Version : Displaying pics



therealjag
12th March 2006, 23:20
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:



pasteAct = new QAction(QIcon(":/images/paste.png"), tr("Pa&ste"), this);
pasteAct->setShortcut(tr("Ctrl+V"));
editMenu->addAction(pasteAct);
connect(pasteAct, SIGNAL(triggered()), this, SLOT(paste()));


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

jacek
12th March 2006, 23:23
Could you show us your .qrc file?

therealjag
13th March 2006, 00:06
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?

jacek
13th March 2006, 00:16
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.