This base class provides basic functionality needed by nearly all dialogs. More...
true
(default).
true
(default).
true
(default).
true
(default).
true
(default).
true
(default).
true.
true.
For internal use only.
It offers three standard buttons, OK
, Apply
and Cancel,
a complete
geometry management that relies on the minimum size you set for the
contents, and the possibility to set background tiles for parts of the
window. See the KDE addressbook for some examples how this dialogs look.
YourDialog.resize(YourDialog.minimumSize());
resizeEvent
function of this class
in your resizeEvent
if you derived it.
Also the buttons are placed this way. The inner frame is
set inside the base frame above of the buttons.
Both the base and the inner frame get background tiles as a static image
provided by the class. This way you can achieve that all your dialogs look
the same way all over your application. All dialog derived from this class
used in one program get the background that is set centrally.
The Qt standard constructor.
[virtual]
The destructor.
The background mode - either showing the selected tile or the standard background color - can be switched independently for the outer and the inner frame.
This method sets this property for the inner frame.
If state is true,
the background tile is displayed. If not, the
standard background color is used.
Enable the OK button if state is true
(default).
Enable the Apply button if state is true
(default).
Enable the Cancel button if state is true
(default).
Show the OK button if state is true
(default).
Show the Apply button if state is true
(default).
Show the Cancel button if state is true
(default).
This method returns the contents rectangle of the inner frame.
Place your widgets inside this rectangle, and use it to set up their geometry. Be carefull: The rectangle is only valid after resizing the dialog, as it is a result of the resizing process. If you need the "overhead" the dialog needs for its element, use getBorderWidth.
This method returns the border widths in all directions that the dialog needs for itselfes.
Respect this, or get bad looking results. The references are upper left x, upper left y, lower left x and lower left y. The results are differences in pixels from the dialogs corners.
With this method it is more easier to calculate a size hint for a dialog derived from DialogBase if you now the width and height of the elements you add to the widget.
The rectangle returned is calculated so that all elements exactly fit into it. Thus, you may set it as a minimum size for the resulting dialog.
This method is meant to make the management of simple layouts easier.
You
may assign (and remove) a main widget to the dialog. This main widget will
be placed exactly fitting into the frame rectangle of the inner frame.
This is usefull if the widget you insert is managed by a Qt layout manager,
for example (or by your own resizeEvent
handler). Make sure to set the
minimum size of the dialog using one of the methods above (Note: if the
main widget provided by you has a minimum size the dialogs minimum size is
automatically adapted to this size, no need to bother).
If you set a main widget and there is already one, this previous main
widget will NOT be deleted. This way you may switch between different
widgets for example by hiding the old one and setting the new one as main.
The dialog does not manipulate the visibility state of your widget, only
its geometry.
If you replace a previous main widget, the old one is still visible. Hide
it, or place it somewhere else.
Returns the main widget or zero if there is none.
[slot]
Called when the background changed.
[slot]
Initialize dialog geometry.
[slot]
Set the dialogs description.
[signal]
The apply button was pressed.
[signal]
The background tile has changed.
[static]
This returns whether the background tile is set or not.
[static]
This returns a const pointer to the background tile if there is one.
[static]
This method sets the background tile.
If it is Null (0), the background image is deleted.
[protected]
Emits the signal backgroundChanged().
[protected]
The resize event.
[protected]
Called when apply button is pressed.
[protected]
The main widget.
[protected]
Show the outer frame background tile if true.
[protected]
Show the base frame background tile if true.
[static, protected]
The background tile.
[static, protected]
The default grid spacing.
[static, protected]
For internal use only.
Mirko Sucker, 1999 |