Results 1 to 9 of 9

Thread: how to express the absolute path and relative path in window system

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    china
    Posts
    6
    Qt products
    Platforms
    Windows
    Thanks
    4

    Default Re: how to express the absolute path and relative path in window system

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: how to express the absolute path and relative path in window system

    Quote Originally Posted by cage View Post
    still can't open .map document and can't add icon to the button.
    Is map a image format? What icon, what Button???

    I want to show a document like 1.map with qt creator
    You mean open a file inside the "editor" or your application which you program with the creator?

    Please be more descriptive and if possible show us some code.

  3. #3
    Join Date
    Sep 2009
    Location
    china
    Posts
    6
    Qt products
    Platforms
    Windows
    Thanks
    4

    Default Re: how to express the absolute path and relative path in window system

    it is difficult to describe , here I will show the result when qt run in difference system.
    that is the result in linux
    1.jpg
    and the result in windows
    2.jpg
    as the .cpp document is too long, i can't posted it here.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: how to express the absolute path and relative path in window system

    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.)

  5. #5
    Join Date
    Sep 2009
    Location
    china
    Posts
    6
    Qt products
    Platforms
    Windows
    Thanks
    4

    Default Re: how to express the absolute path and relative path in window system

    Quote Originally Posted by Lykurg View Post
    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.

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: how to express the absolute path and relative path in window system

    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?
    Qt Code:
    1. /path/to/your/app/application.exe
    2. /path/to/your/app/image/Current_Position.png
    To copy to clipboard, switch view to plain text mode 
    If so the image should normally be found.

Tags for this Thread

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.