Results 1 to 11 of 11

Thread: QPixmap and QLabel performance

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QPixmap and QLabel performance

    In general have a look at QPixmapCache.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Dec 2010
    Posts
    14
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QPixmap and QLabel performance

    QPixmapCache is an interesting solution, but could anyone answer to my questions? I answered to first question on my own by implementing and checking - it works as I thought. But rest of the questions are not so easy.

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

    Default Re: QPixmap and QLabel performance

    2. Are moving, hiding and displaying QLabels with QPixmaps slow operations? Should I check the position and visibility of QLabel to avoid situation, when I want to move QLabel to the current position or set visible already visible QLabel, to increase performance?
    As in most situations the answer is "it depends on".

    all icons will be accessible in the same way as they were compiled in application?
    They will be accessible by paths you place them at in the resource file.

    2. If I'm right about the above, I would like to automate the process of generating myresource.rcc. I guess that when I add myresource.qrc file to my project and build application, all resources are compiled in. I don't want them to be compiled in, but I want them to be accessible from my project in QT Creator. Is this possible?
    Then they won't be resources anymore. What you want is access to files using a relative path. You don't need the resource system for that, just have a point of reference (like QCoreApplication::applicationDirPath()) and construct all paths based on that reference point.

    3. Anyway would you advise using files *.rcc or registering resources directly from files *.png?
    "it depends on".

    4. If I load 3 pixmaps to 3 different labels in a row, when screen is refreshed (function Paint() or however it is named, is called)? Is it refreshed after each pixmap setting or optimised and refreshed just once?
    It is refreshed when the control returns to the event loop and appropriate events scheduled by setting the pixmaps are processed (so if you assign 3 pixmaps one after the other, the widgets will be refreshed after all three pixmaps have already been set).

    5. If I have 3 labels in some QLayout and I hide two of them, when will mechanism processing layouts start its work? After each single act of hiding or just once?
    An event is scheduled for the layout to invalidate itself so when it is recalculated, both changes will be processed in one go.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Dec 2010
    Posts
    14
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QPixmap and QLabel performance

    Quote Originally Posted by wysota View Post
    Then they won't be resources anymore. What you want is access to files using a relative path. You don't need the resource system for that, just have a point of reference (like QCoreApplication::applicationDirPath()) and construct all paths based on that reference point.
    I want to use resources, but load them from resources.rcc to my application when it starts, I don't want them to be build in application.

    The problem is just the way I generate resources.rcc file. I want this file to be generated from resources.qrc during compilation of application. If it is possible I want resources.qrc file to be visible in QT Creator project.

Similar Threads

  1. Replies: 11
    Last Post: 5th April 2010, 08:38
  2. QLabel, QPixmap and ScaledContents
    By mhbeyle in forum Qt Programming
    Replies: 3
    Last Post: 28th November 2009, 09:11
  3. Rotate QPixmap set on QLabel
    By Qt Coder in forum Qt Programming
    Replies: 1
    Last Post: 18th March 2009, 12:08
  4. Replies: 2
    Last Post: 20th January 2009, 07:13
  5. performance issue(QGV + QPixmap::grabWidget)
    By momesana in forum Qt Programming
    Replies: 4
    Last Post: 27th September 2007, 11:31

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.