Results 1 to 5 of 5

Thread: lib using Image Collection

  1. #1
    Join Date
    Jan 2006
    Posts
    70
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default lib using Image Collection

    I've created a custom widget with a Qt Designer plugin using Qt 3.3.2
    The custom widget has buttons that contain IconSet images. The images
    were added to the .pro file and called in the code using ::fromMimeSource()

    Compiling this project gives me a .lib file that I can include in other Qt projects to use my custom widget.

    When using this custom widget the images never show up on the buttons. It seems to me that something must be done to get the images to the compiler of the new project that links in the .lib custom widget file.

    Any suggestions?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: lib using Image Collection

    How do you create the image collection?

  3. #3
    Join Date
    Jan 2006
    Posts
    70
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: lib using Image Collection

    In the .pro file I've added the line:
    IMAGES = image1.png

    Then in the .cpp file:
    IconSet ico(QPixmap::fromMimeSource("image1.png"));

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: lib using Image Collection

    Maybe you should use IMAGES += xxx.png instead?

  5. #5
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: lib using Image Collection

    It's a static instantiation problem that can happen when you have an image collection in a library. You must use the qInitImages_xxx() function to make sure the images get created:

    http://lists.trolltech.com/qt-intere...ad00291-0.html
    Save yourself some pain. Learn C++ before learning Qt.

Similar Threads

  1. "sensitising" an image
    By TheKedge in forum Qt Programming
    Replies: 2
    Last Post: 28th June 2006, 08:21
  2. Fast image drawing/scaling in Qt 3.3
    By eriwik in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 11:45
  3. problem with the back ground image
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 17th April 2006, 22:34
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 17:36
  5. Question about updating an image on screen
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 20:01

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.