[Qt-interest] How to layout off-line.
Malyushytsky, Alex
alex at wai.com
Wed Sep 9 03:48:21 CEST 2009
>> My application displays a complex scene of custom widgets.
I hardly doubt you can use QWidgets derived classes on the systems "which will not support GUI activity".
So your main problem may be not layout.
Even though I agree that GUI might not be required for layout to do it job,
it is not that simple as QSize.
For every widget it involves minimumSize, maximumSize, sizeHint, sizeIncrement and on top of that sizePolicy.
These all together, with every widget visibility (hiding widget effects the layout) defines the layout.
HeightForWidth, event handling, widget redrawing after layout changes, etc also has to be handled somewhere.
Layout class which just operates with static (assume minimum size) boxes will be much simpler, but will have no use for widgets.
So standard QT classes handles widgets too.
I don't want to discuss if it could be design better/faster/more efficient or more suitable for someone's needs.
I bet developers spent enough time designing it and since I have not done any research myself I don't have enough experience.
On top of this you can write your own layout manager which may use your QLayoutItem subclass which don't require widget to operate. Add items there, call activate.
QT provides all required abstractions.
Regards,
Alex
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of william.crocker at analog.com
Sent: Tuesday, September 08, 2009 5:45 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] How to layout off-line.
> Does Non-Gui mode means it runs on the system which does not support graphics?
> According to my understanding you can't use QLayout without QWidgets.
That is the problem.
> At the same time if your system supports GUI, it does not have to be visible.
> So running from command line might not prevent you to create an instance of the widgets (even hidden).
I need to run on compute-farms machines which will not support GUI activity.
> If this not an option you might need to create your own layout class which will work with bounding boxes.
That is the rub. Layout is a general need.
It is too bad that Qt has tied it so closely to GUI when there
is very little need for GUI. All the top level of a layout needs
is the size. It does not need to be the size of a QWidget.
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.
"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
"Please consider our environment before printing this email."
More information about the Qt-interest-old
mailing list