Results 1 to 5 of 5

Thread: QTabWidget performance issue if there are hundreds of tabs

  1. #1
    Join Date
    Jul 2014
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTabWidget performance issue if there are hundreds of tabs

    Hi,

    I suffered a performance issue that when QTabWidget already had 2 hundreds of tabs, add 2 hundreds of tabs again will take times (probably 30+ seconds)
    I already use "blcokSignals(true)" before insert hundreds of tabs, and set back to false after insertion, seems it can't help speed-up.
    Do you have idea about this performance issue, any way to improve the time, thanks.

    Here is the call-stack I captured during the hang.
    #0 ... in XCheckTypedWindowEvent ()
    #1 ... in QETWidget::translateConfigEvent(_XEvent const*) ()
    #2 ... in QApplication::x11ProcessEvent(_XEvent*) ()
    #3 ... in qmotif_event_dispatcher(_XEvent*) ()
    #4 ... in XtDispatchEvent ()
    #5 ... in XtAppProcessEvent ()
    #6 ... in QtMotif:rocessEvents(QFlags<QEventLoop::ProcessEventsFlag> ) ()

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTabWidget performance issue if there are hundreds of tabs

    Hi, maybe setUpdatesEnabled(false); on the tab widget might help.

    But I personally don't think that I would want to use a widget with 400 tabs inside. Depending on the content of your tabs maybe you can use the content of just one tab, and update it depending on a selection in a combobox or something like that.

    Ginsengelf

  3. #3
    Join Date
    Jul 2014
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTabWidget performance issue if there are hundreds of tabs

    Quote Originally Posted by Ginsengelf View Post
    Hi, maybe setUpdatesEnabled(false); on the tab widget might help.

    But I personally don't think that I would want to use a widget with 400 tabs inside. Depending on the content of your tabs maybe you can use the content of just one tab, and update it depending on a selection in a combobox or something like that.

    Ginsengelf


    Hi, thanks for the suggestion.
    I tried this way and still suffered performance issue, seems the spent time is not reduced.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTabWidget performance issue if there are hundreds of tabs

    Really? A GUI with 400 tabs? How can anyone even begin to navigate such a thing much less find one tab hidden in a forest of 399 others?

    I think you should take Ginsengelf's advice and look for another way to accomplish the same idea with less visual overload for your users.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Jul 2014
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTabWidget performance issue if there are hundreds of tabs

    Quote Originally Posted by d_stranz View Post
    Really? A GUI with 400 tabs? How can anyone even begin to navigate such a thing much less find one tab hidden in a forest of 399 others?

    I think you should take Ginsengelf's advice and look for another way to accomplish the same idea with less visual overload for your users.


    Hi, thanks for the comment.
    I think I found the root-cause, it is because tab's "closable" feature, it will cause slowness if add many tabs.

Similar Threads

  1. Replies: 1
    Last Post: 12th June 2014, 08:27
  2. QTabWidget vertical tabs ???
    By jesse_mark in forum Newbie
    Replies: 3
    Last Post: 12th July 2013, 22:20
  3. QTabWidget with same tabs
    By Djony in forum Qt Programming
    Replies: 20
    Last Post: 24th December 2011, 13:20
  4. Qtabwidget - how to add a button to all tabs?
    By creep33 in forum Qt Programming
    Replies: 2
    Last Post: 22nd July 2010, 20:05
  5. Switching off all tabs in QTabWidget
    By Gopala Krishna in forum Qt Programming
    Replies: 7
    Last Post: 30th August 2006, 18:10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.