PDA

View Full Version : Designer form creation very slow



MrGarbage
7th December 2007, 20:59
Hi,

I'm looking for suggestions to improve performance. This is a windows app.
This is for one dialog in particular, created by the Designer and
shown in the attachment.
It contains, among other things a 4 X 32 grid of dragabble LED objects whose
base class is QLabel.

When my app starts and a entry is clicked in the tree to the left this dialog
is created and added to the displayable workspace. Base on what is clicked I need
to hide or show some of the 4 X 32 dragabble LED objects.

It is very slow under the debugger and still unacceptably slow when built as a release version.

Under the debugger Some of the more costly functions:

****** Calling setupUi()
****** Back from setupUi() Time elapsed: ms 1372

****** Calling DPMConfigDevices() - Hide/Show the supported devices
****** Back from DPMConfigDevices() - Hide/Show the supported devices Time elapsed: ms 1432

****** Calling thisWidget->layout()->addWidget(m_DpmConfigTabSheet);
****** Back from addWidget(m_DpmConfigTabSheet) Time elapsed: ms 822

Any suggestions?

Thank you!

Mark Foley

marcel
7th December 2007, 21:19
Well, I think you went the wrong way there...
Qt is slow with complex layouts and a large number of widgets(let's hope that will improve with 4.4), so there's not much you can do about it.

I would have implemented that 4x32 grid with a QGraphicsView. 128 items means nothing for a graphics view. If it is not too late to change your approach, I suggest you go ahead and do it.

wysota
7th December 2007, 21:21
I'd turn those 128 separate LED widgets into a single custom widget that draws the LEDs to avoid relayouting everything every time you change something. QTableView with a custom delegate might be a simple replacement for your LED widgets.

MrGarbage
7th December 2007, 22:20
Thank you for both replies, which essentially tell me what I already feared was true. The
design is not practical. This was my first QT complex form and I now understand quite a bit
more.

Thankfully it is not too late to change the design, and that is what I will do.

Mark