Qt UIloader with multiple loading of same ui file
-
wrote on 23 Mar 2012, 08:58 last edited by
In an Qt Application the same ui file has to be loaded multiple times. This is done using the Uiloader, i.e opening the file and getting a pointer to the loaded widget with loader.load. This works fine. However when one has to load the same file 30 to 40 times (and one has to change colors and other things afterwards at run time, so that the pointer has to be kept), the loading gets long (3-5 seconds on a dual core machine). Is there a better way to realize multiple loading of the same ui file ?
acmezger
-
wrote on 24 Mar 2012, 09:21 last edited by
You could load the ui file into a QBuffer and load it from that. This would avoid the need to reload the ui file from the disk. That said, I suspect the slow part is really loading/searching for plugins etc.
-
wrote on 26 Mar 2012, 08:10 last edited by
I could actually do that, but I guess that the heavy work is done when constructing a QWidget from the ui file. It should be possible to have the Qwidget constructed and that it could be cloned afterwards.
-
wrote on 26 Mar 2012, 14:26 last edited by
QWidgets are inherently non-copyable.
-
wrote on 26 Mar 2012, 15:02 last edited by
Yes, I know that. Therefore there is probably no solution to my problem
5/5