Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Alternate ways of loading in widgets
Qt 6.11 is out! See what's new in the release blog

Alternate ways of loading in widgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtdialog
3 Posts 3 Posters 515 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.
  • J Offline
    J Offline
    joem
    wrote on last edited by
    #1

    I have a dialog which creates a bunch of tabs full of widgets. These widgets are various number pickers, buttons and text fields and are all relatively custom.

    It takes nearly 1 second to initialize when trying to show the dialog.. which feels slow. From my understanding I can't create any widgets besides the main GUI thread, so I can't really work in parallel to speed it up.

    Preloading and just not showing the dialog from my main window would work (I'm willing to sacrifice the memory usage). But is there a way to call this that wouldn't slow down the mains initialization? Some sort of an after load task? If I just put it in the constructor it'll slow that down as well

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I never seen any widget which is that full that it takes 1second to load. If you don't create more than maybe 1000 widgets (which I doubt - otherwise the user would not be able to see and understand anything on your widget) you must be doing something wrong. Maybe you do some time consuming stuff in the ctors of your widgets.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      JonBJ 1 Reply Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher

        I never seen any widget which is that full that it takes 1second to load. If you don't create more than maybe 1000 widgets (which I doubt - otherwise the user would not be able to see and understand anything on your widget) you must be doing something wrong. Maybe you do some time consuming stuff in the ctors of your widgets.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @Christian-Ehrlicher said in Alternate ways of loading in widgets:

        If you don't create more than maybe 1000 widgets

        Agree totally with your post, presumably OP has time-consuming constructors. But for the record, you might recall just the other day on this forum we were answering another user question (https://forum.qt.io/topic/119450/crash-when-add-to-many-qwidgets-to-qvector/5) who had a 120x120 QGridLayout of > 10,000 QLabels... ! :)

        1 Reply Last reply
        1

        • Login

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