Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Qt UIloader with multiple loading of same ui file

    QML and Qt Quick
    3
    5
    2370
    Loading More Posts
    • 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
      acmezger 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

      1 Reply Last reply Reply Quote 0
      • R
        rich 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.

        1 Reply Last reply Reply Quote 0
        • A
          acmezger 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.

          1 Reply Last reply Reply Quote 0
          • M
            mlong last edited by

            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 Reply Quote 0
            • A
              acmezger last edited by

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

              1 Reply Last reply Reply Quote 0
              • First post
                Last post