In general have a look at QPixmapCache.
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.
As in most situations the answer is "it depends on".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?
They will be accessible by paths you place them at in the resource file.all icons will be accessible in the same way as they were compiled in application?
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.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?
"it depends on".3. Anyway would you advise using files *.rcc or registering resources directly from files *.png?
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).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?
An event is scheduled for the layout to invalidate itself so when it is recalculated, both changes will be processed in one go.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?
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.
Bookmarks