|
| QtxBackgroundDialog (QWidget *=0) |
| Constructor. More...
|
|
| QtxBackgroundDialog (const Qtx::BackgroundData &, QWidget *=0) |
| Constructor. More...
|
|
virtual | ~QtxBackgroundDialog () |
| Destructor. More...
|
|
void | setData (const Qtx::BackgroundData &) |
| Set background data. More...
|
|
Qtx::BackgroundData | data () const |
| Get background data. More...
|
|
void | setGradients (const QStringList &, const QIntList &=QIntList()) |
| Set allowed two-color gradients to the widget. More...
|
|
void | setModeAllowed (Qtx::BackgroundMode, bool=true) |
| Enable / disable specific background mode. More...
|
|
void | setTextureAllowed (bool=true) |
| Enable / disable texture controls. More...
|
|
void | setTextureModeAllowed (Qtx::TextureMode, bool=true) |
| Enable / disable specific texture mode. More...
|
|
void | setImageFormats (const QString &) |
| Set allowed image formats. More...
|
|
| QtxDialog (QWidget *=0, bool=false, bool=false, const int=Standard, Qt::WindowFlags=0) |
| Constructor. More...
|
|
virtual | ~QtxDialog () |
| Destructor. More...
|
|
void | setDialogFlags (const int) |
| Set specified dialog box flags. More...
|
|
void | clearDialogFlags (const int) |
| Clear specified the dialog flags. More...
|
|
bool | testDialogFlags (const int) const |
| Test specified dialog flags. More...
|
|
void | setButtonFlags (const int) |
| Add specified control button(s) to the dialog box. More...
|
|
void | clearButtonFlags (const int) |
| Remove specified control button(s) from the dialog box. More...
|
|
bool | testButtonFlags (const int) const |
| Test specified buttons. More...
|
|
int | buttonPosition (const int) const |
| Get specified control button position. More...
|
|
void | setButtonPosition (const int, const int=-1) |
| Set the specified control button(s) position. More...
|
|
void | setPlacePosition (const int, const int) |
| Set button position for all buttons in specified area. More...
|
|
int | placePolicy (const int) const |
| Get buttons layouting policy for the specified area. More...
|
|
void | setPlacePolicy (const int, const int) |
| set buttons layouting policy for the specified area. More...
|
|
void | setButtonPlace (const int, const int) |
| Move specified button(s) into specified area. More...
|
|
QString | buttonText (const int) |
| Get specified button's text. More...
|
|
void | setButtonText (const int, const QString &text) |
| Set specified button's text. More...
|
|
void | setButtonFocus (const int) |
| Sets the keyboard focus to the specified button. More...
|
|
bool | hasButtonFocus (const int) const |
| Check if specified button has keyboard focus. More...
|
|
bool | isButtonEnabled (const int) const |
| Get "enabled" status of the specified button(s). More...
|
|
void | setButtonEnabled (const bool, const int) |
| Enable/disable specified button(s). More...
|
|
bool | isBorderEnabled (const int) const |
| Check if border is enabled. More...
|
|
void | setBorderEnabled (const bool, const int) |
| Show/hide border for the specified button area. More...
|
|
void | removeButton (const int) |
| Remove user button. More...
|
|
int | insertButton (const QString &, const int=BottomArea) |
| Add user button to the dialog box. More...
|
|
QIntList | userButtonIds () const |
| Get all user button IDs. More...
|
|
QAbstractButton * | userButton (const int) const |
| Get user button by the specified id. More...
|
|
uint | setAlignment (uint align) |
| Sets alignment policy. More...
|
|
|
static Qtx::BackgroundData | getBackground (const Qtx::BackgroundData &=Qtx::BackgroundData(), QWidget *=0, bool=true, bool=true, bool=true, bool=true, const QStringList &=QStringList(), const QIntList &=QIntList(), const QString &=QString()) |
| This is a convenience static function that returns an background data selected by the user. If the user presses Cancel, it returns an invalid background data. More...
|
|
static Qtx::BackgroundData | getBackground (const Qtx::BackgroundData &, QWidget *, const QIntList &, bool=true, bool=true, bool=true, bool=true, const QStringList &=QStringList(), const QIntList &=QIntList(), const QString &=QString()) |
| This is a convenience static function that returns an background data selected by the user. If the user presses Cancel, it returns an invalid background data. More...
|
|
static void | setUnits (QLabel *, const QString &) |
| Set measure units to the specified label. More...
|
|
|
enum | PlacePolicy { Position,
Expand,
Uniform
} |
| Buttons alignment type. More...
|
|
enum | ButtonArea { TopArea,
BottomArea,
LeftArea,
RightArea
} |
| Buttons area. More...
|
|
enum | ButtonPosition {
Left,
Right,
Center,
Top = Left,
Bottom = Right
} |
| Button position. More...
|
|
enum | ButtonFlags {
None = 0x00000000,
OK = 0x00000001,
Apply = 0x00000002,
Cancel = 0x00000004,
Yes = 0x00000008,
No = 0x00000010,
Close = 0x00000020,
Help = 0x00000040,
OKCancel = OK | Cancel,
YesNo = Yes | No,
Standard = OK | Cancel | Help,
All = Standard | YesNo | Apply | Close
} |
| Button ID flags. More...
|
|
enum | DialogFlags { Accept = 0x000001,
Reject = 0x000002,
AlignOnce = 0x000004,
SetFocus = 0x000008
} |
| Dialog box flags. More...
|
|
void | update () |
| Update dialog box. More...
|
|
virtual void | setVisible (bool) |
| Show/hide dialog box, set keyboard focus to the dialog. More...
|
|
void | dlgButton (int) |
| Emitted when the user button is clicked. More...
|
|
void | dlgParamChanged () |
| This signal can be used in successor classes to signalize about some dialog parameter changing. More...
|
|
void | dlgHelp () |
| Emitted when the "Help" button is clicked. More...
|
|
void | dlgApply () |
| Emitted when the "Apply" button is clicked. More...
|
|
void | dlgOk () |
| Emitted when the "OK" button is clicked. More...
|
|
void | dlgNo () |
| Emitted when the "No" button is clicked. More...
|
|
void | dlgYes () |
| Emitted when the "Yes" button is clicked. More...
|
|
void | dlgClose () |
| Emitted when the "Close" button is clicked. More...
|
|
void | dlgCancel () |
| Emitted when the "Cancel" button is clicked. More...
|
|
typedef QMap< int,
QAbstractButton * > | ButtonMap |
| button map More...
|
|
virtual void | accept () |
| Accept the dialog box. More...
|
|
virtual void | reject () |
| Reject the dialog box. More...
|
|
QFrame * | mainFrame () const |
| Get dialog box main frame widget. More...
|
|
virtual bool | acceptData () const |
| Check if data entered by the user is valid. More...
|
|
virtual bool | rejectData () const |
| Check if dialog box can be cancelled. More...
|
|
virtual QAbstractButton * | createButton (QWidget *) |
| Create new user button. More...
|
|
QAbstractButton * | button (const int) const |
| Get button by the specified ID. More...
|
|
ButtonMap | buttons (const int=All) const |
| Get buttons by the specified IDs. More...
|
|
int | buttonId (const QAbstractButton *) const |
| Get specified button's identifier. More...
|
|
int | buttonPosition (QAbstractButton *) const |
| Get position of specified button. More...
|
|
virtual void | showEvent (QShowEvent *) |
| Align this dialog according to the parent widget and alignment policy before the dialog box is shown. More...
|
|
virtual void | hideEvent (QHideEvent *) |
| Process all existing events when dialog box is hidden. More...
|
|
virtual void | closeEvent (QCloseEvent *) |
| Called when user closes dialog box. More...
|
|
virtual void | childEvent (QChildEvent *) |
| Update dialog box layout when the size grip is added. More...
|
|
virtual void | keyPressEvent (QKeyEvent *) |
| Process key pressing event. More...
|
|
Usage example:
QStringList sl;
sl << "Horizontal" << "Vertical" << "First diagonal" << "Second diagonal";
dlg.setGradients(sl);
dlg.setModeAllowed(Qtx::ImageBackground, false);
dlg.setData(backgroundData);
if ( dlg.exec() ) {
}
Also it is possible to use static function:
By default:
- all background modes are enabled
- texture controls are shown
- all texture modes are disabled
- simple gradient types list is empty
- all image formats are supported
To customize the dialog box behavior, initialize it passing the corresponding options to the function.
- Parameters
-
bgData | initial background data |
parent | parent widget |
tmList | allowed texture modes |
enableSolidColor | "enable solid colored background mode" flag |
enableGradient | "enable simple gradient background mode" flag |
enableCustom | "enable custom gradient background mode" flag |
enableTexture | "show texture controls" flag |
gradList | list of simple gradients names |
idList | list of simple gradients identifiers |
formats | image formats |
- Returns
- resulting background data chosen by the user or invalid data if users cancels operation
References Qtx::CenterTexture, Qtx::ColorBackground, Qtx::CustomGradientBackground, data(), setData(), setGradients(), setImageFormats(), setModeAllowed(), setTextureAllowed(), setTextureModeAllowed(), Qtx::SimpleGradientBackground, and Qtx::StretchTexture.