Results 1 to 8 of 8

Thread: Sames executable, different behaviours...

Hybrid View

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

    Default Re: Sames executable, different behaviours...

    Quote Originally Posted by high_flyer
    If you use my project with resouces the way you suggested above, does it work for you?
    Of course it works --- read carefully the beginning of the last sentence in my previous post (the one about removing leading slashes).

    But what about when I choose a pixmap from designer?
    It should work too, but I had to fix .qrc at least once.

    Here's example of my .qrc file:
    xml Code:
    1. <RCC>
    2. <qresource prefix="/" >
    3. <file>data/ciexyz</file>
    4. ...
    5. <file>icons/open.png</file>
    6. ...
    7. </qresource>
    8. </RCC>
    To copy to clipboard, switch view to plain text mode 
    I can access these resources using ":/data/ciexyz" or ":/icons/open.png" and they work also with Designer.

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

    high_flyer (10th March 2006)

  3. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Sames executable, different behaviours...

    Just wanted to say thank you to who responded.
    I must have had some typo before when I used the resources...
    Any way now it works as it should.
    Thanks!

    P.S
    One more question though...
    Why prefix "/" works for folders under my project root and not under the "real" root "/"?
    This means that the qrc file always looks from its own location (or project root) and lower.:
    so "/home/name" will be infact "project_location/home/name"...
    But what if I have a general resource folder that is above my project root, what then?

    I know in fact this is not the case, its not logical.
    I know that prefix="/home/name" will indeed go to the right folder, not under my project, but why then "/" works?
    Last edited by high_flyer; 10th March 2006 at 19:12.

  4. #3
    Join Date
    Feb 2006
    Location
    Boulder, Colorado, USA
    Posts
    63
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 8 Times in 5 Posts

    Default Re: Sames executable, different behaviours...

    Quote Originally Posted by high_flyer
    Just wanted to say thank you to who responded.
    I must have had some typo before when I used the resources...
    Any way now it works as it should.
    Thanks!
    You're welcome.
    Quote Originally Posted by high_flyer
    P.S
    One more question though...
    Why prefix "/" works for folders under my project root and not under the "real" root "/"?
    This means that the qrc file always looks from its own location (or project root) and lower.:
    so "/home/name" will be infact "project_location/home/name"...
    But what if I have a general resource folder that is above my project root, what then?

    I know in fact this is not the case, its not logical.
    I know that prefix="/home/name" will indeed go to the right folder, not under my project, but why then "/" works?
    The prefix has nothing to do with the filesystem. It is more like a namespace. You can define the prefix to be whatever, so that you avoid name collisions or for convenience. So prefix="/someRandomName", allows you to access :/someRandomName/myfile.png. This might be useful if you have multiple resource files each accessing their contents from paths that look the same with respect to their locations.

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

    high_flyer (13th March 2006)

  6. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Sames executable, different behaviours...

    I need to revive this thread since i have again some problems with the resources...
    I have some custom widget plugins that have pixmap properties.
    In design time and preview all works as it should.
    But at run time some pixmaps didn't show up while other pixmap properties did.
    After exemining the ui and the uic generated code I found out that the pixmaps I choose in designer (from a resource file) are simply not being saved when I save the form.
    So far I could not find an explanation for this, and was wondering if any of you might know what I might be doin to couse this?
    As I said, the strange thing about this, is that its not for all pixmap properties, just for some...
    This is the ui xml code where you can see a correct saved property:
    Qt Code:
    1. <property name="maskPixmap" stdset="0" >
    2. <pixmap resource="../sharpeye.qrc" >:/res/bt_zoom_plus1.png</pixmap>
    3. </property>
    To copy to clipboard, switch view to plain text mode 
    And here a broken saved property:
    Qt Code:
    1. <property name="firstStatePixmap" stdset="0" >
    2. <pixmap/>
    3. </property>
    To copy to clipboard, switch view to plain text mode 
    So no wonder the C++ generated code sets an empty QPixmap...

    Any idea what I might be doing wrong to couse this, or can it be a bug?

    Thanks.

Similar Threads

  1. Qt3 qprocess, executable exited?
    By triperzonak in forum Newbie
    Replies: 2
    Last Post: 22nd September 2008, 11:21

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.