Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt UIloader with multiple loading of same ui file
QtWS25 Last Chance

Qt UIloader with multiple loading of same ui file

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 2.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    acmezger
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rich
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        acmezger
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mlong
          wrote on last edited by
          #4

          QWidgets are inherently non-copyable.

          Software Engineer
          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            acmezger
            wrote on last edited by
            #5

            Yes, I know that. Therefore there is probably no solution to my problem

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved