thinks, although it really didn't solve my problem. I do what you said, it turn out to be the same result, still can't open .map document and can't add icon to the button.
thinks, although it really didn't solve my problem. I do what you said, it turn out to be the same result, still can't open .map document and can't add icon to the button.
it seems that your paths are really wrong. Just post the code of how you set the image to the toolbuttons on the left and on the top. (Including the part with the relevant path settings.)
Here I will show the image I have do with the icon.I have set the path, you can see it from the next part.
(1)1.jpg
(2)and the reflect in ui.h. the image are in project's file.
Current_Position_action = new QAction(MainWindow);
Current_Position_action->setObjectName(QString::fromUtf8("Current_Position _action"));
QIcon icon1;
icon1.addPixmap(QPixmap(QString::fromUtf8("image/Current_Position.png")), QIcon::Normal, QIcon::Off);
Current_Position_action->setIcon(icon1);
Distant_Measure_action = new QAction(MainWindow);
that's any wrong with it ? another problem , how can i do with the absolute path in windows system with QT Creator.
First you can use a resource file then you don't have such problems for the icons. See http://doc.trolltech.com/4.5/resources.html.
Second how looks the directories in windows?
If so the image should normally be found.Qt Code:
/path/to/your/app/application.exe /path/to/your/app/image/Current_Position.pngTo copy to clipboard, switch view to plain text mode
Bookmarks