Version: 6.3.1
Data Structures | Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Private Types | Private Slots | Private Member Functions | Private Attributes

QtxPathDialog Class Reference

The QtxPathDialog class provides a simple convenience dialog to enter a path to the file or to the directory. More...

#include <QtxPathDialog.h>

Inheritance diagram for QtxPathDialog:
Inheritance graph

Data Structures

struct  FileEntry

Public Types

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...

Public Slots

virtual void setVisible (bool)
 Show/hide the path dialog box/.
void update ()
 Update dialog box.

Signals

void fileNameChanged (QString)
 Emitted when the file name is changed.
void dlgButton (int)
 Emitted when the user button is clicked.
void dlgParamChanged ()
 This signal can be used in successor classes to signalize about some dialog parameter changing.
void dlgHelp ()
 Emitted when the "Help" button is clicked.
void dlgApply ()
 Emitted when the "Apply" button is clicked.
void dlgOk ()
 Emitted when the "OK" button is clicked.
void dlgNo ()
 Emitted when the "No" button is clicked.
void dlgYes ()
 Emitted when the "Yes" button is clicked.
void dlgClose ()
 Emitted when the "Close" button is clicked.
void dlgCancel ()
 Emitted when the "Cancel" button is clicked.

Public Member Functions

 QtxPathDialog (const bool, QWidget *=0, const bool=true, const bool=false, const int=Standard, Qt::WindowFlags=0)
 Constructor.
virtual ~QtxPathDialog ()
 Destructor.
QString fileName () const
 Get selected file name.
void setFileName (const QString &, const bool=false)
 Set the file name.
QString filter () const
 Get current file filter.
void setFilter (const QString &)
 Change file filter.
void setDialogFlags (const int)
 Set specified dialog box flags.
void clearDialogFlags (const int)
 Clear specified the dialog flags.
bool testDialogFlags (const int) const
 Test specified dialog flags.
void setButtonFlags (const int)
 Add specified control button(s) to the dialog box.
void clearButtonFlags (const int)
 Remove specified control button(s) from the dialog box.
bool testButtonFlags (const int) const
 Test specified buttons.
int buttonPosition (const int) const
 Get specified control button position.
void setButtonPosition (const int, const int=-1)
 Set the specified control button(s) position.
void setPlacePosition (const int, const int)
 Set button position for all buttons in specified area.
int placePolicy (const int) const
 Get buttons layouting policy for the specified area.
void setPlacePolicy (const int, const int)
 set buttons layouting policy for the specified area.
void setButtonPlace (const int, const int)
 Move specified button(s) into specified area.
QString buttonText (const int)
 Get specified button's text.
void setButtonText (const int, const QString &text)
 Set specified button's text.
void setButtonFocus (const int)
 Sets the keyboard focus to the specified button.
bool hasButtonFocus (const int) const
 Check if specified button has keyboard focus.
bool isButtonEnabled (const int) const
 Get "enabled" status of the specified button(s).
void setButtonEnabled (const bool, const int)
 Enable/disable specified button(s).
bool isBorderEnabled (const int) const
 Check if border is enabled.
void setBorderEnabled (const bool, const int)
 Show/hide border for the specified button area.
void removeButton (const int)
 Remove user button.
int insertButton (const QString &, const int=BottomArea)
 Add user button to the dialog box.
QIntList userButtonIds () const
 Get all user button IDs.
QAbstractButtonuserButton (const int) const
 Get user button by the specified id.
uint setAlignment (uint align)
 Sets alignment policy.

Static Public Member Functions

static void setUnits (QLabel *, const QString &)
 Set measure units to the specified label.

Protected Types

enum  {
  OpenFile, SaveFile, OpenDir, SaveDir,
  NewDir
}
typedef QMap< int,
QAbstractButton * > 
ButtonMap
 button map

Protected Slots

void validate ()
 Check validity of the entered text and enable/disable standard OK, Yes buttons.
virtual void accept ()
 Accept the dialog box.
virtual void reject ()
 Reject the dialog box.

Protected Member Functions

 QtxPathDialog (QWidget *=0, const bool=true, const bool=false, const int=Standard, Qt::WindowFlags=0)
 Constructor.
virtual bool isValid ()
 Check if the entered file/directory name is valid.
virtual bool acceptData () const
 Check if the entered data is acceptable.
virtual void fileNameChanged (int, QString)
 Perform custom actions when the file name is changed.
QFrameoptionsFrame ()
 Get options grame widget.
QString fileName (const int) const
 Get file name from specified entry.
void setFileName (const int, const QString &, const bool=false)
 Change file name by specified file entry.
QString filter (const int) const
 Get file filter from the specified file entry.
void setFilter (const int, const QString &)
 Set file filter to the specified file entry.
QLineEditfileEntry (const int) const
 Get line edit widget for the specified file entry.
QLineEditfileEntry (const int, int &) const
 Get line edit widget and file mode for the specified file entry.
int createFileEntry (const QString &, const int, const QString &=QString(), const int=-1)
 Create new file entry.
int defaultEntry () const
 Get default file entry ID.
void setDefaultEntry (const int)
 Set default entry.
int buttonPosition (QAbstractButton *) const
 Get position of specified button.
QFramemainFrame () const
 Get dialog box main frame widget.
virtual bool rejectData () const
 Check if dialog box can be cancelled.
virtual QAbstractButtoncreateButton (QWidget *)
 Create new user button.
QAbstractButtonbutton (const int) const
 Get button by the specified ID.
ButtonMap buttons (const int=All) const
 Get buttons by the specified IDs.
int buttonId (const QAbstractButton *) const
 Get specified button's identifier.
virtual void showEvent (QShowEvent *)
 Align this dialog according to the parent widget and alignment policy before the dialog box is shown.
virtual void hideEvent (QHideEvent *)
 Process all existing events when dialog box is hidden.
virtual void closeEvent (QCloseEvent *)
 Called when user closes dialog box.
virtual void childEvent (QChildEvent *)
 Update dialog box layout when the size grip is added.
virtual void keyPressEvent (QKeyEvent *)
 Process key pressing event.

Private Types

typedef QMap< int, FileEntryFileEntryMap

Private Slots

void onBrowse ()
 Called when user clicks a "browse" button to open standard file dialog.
void onReturnPressed ()
 Called when user presses Return key being in the line edit.
void onTextChanged (const QString &)
 Called when the text in the line edit is changed by the user.

Private Member Functions

void initialize ()
 Initialize dialog layout.
void updateVisibility ()
 Upadte dialof box's child widgets visibility state.
QStringList prepareFilters (const QString &) const
 Prepare file filters.
bool hasVisibleChildren (QWidget *) const
 Check if there are visible child widgets.
QStringList filterWildCards (const QString &) const
 Get wildcards from the specified file filter.
QString autoExtension (const QString &, const QString &=QString()) const
 Get file file name with automatically assigned extension.

Private Attributes

FileEntryMap myEntries
int myDefault
QWidgetmyEntriesFrame
QFramemyOptionsFrame

Detailed Description

The QtxPathDialog class adds possibility to browse the file system with help of standard Open/Save dialog boxes or enter the file/directory path manually.

Default implementation provides only one "standard" file entry. Sometimes it is necessary to select several different files/directories from the same dialog box. In this case it is possible to derive from the QtxPathDialog class and use createFileEntry() method to add required number of file entries.


Member Typedef Documentation

typedef QMap<int, FileEntry> QtxPathDialog.FileEntryMap [private]
typedef QMap<int, QAbstractButton*> QtxDialog.ButtonMap [protected, inherited]

Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
OpenFile 
SaveFile 
OpenDir 
SaveDir 
NewDir 
enum QtxDialog::PlacePolicy [inherited]
Enumerator:
Position 

buttons are placed according their position

Expand 

buttons occupy all available space

Uniform 

buttons are uniformly placed in the area

enum QtxDialog::ButtonArea [inherited]
Enumerator:
TopArea 

horizontal area at the top side of the dialog box

BottomArea 

horizontal area at the bottom side of the dialog box

LeftArea 

vertical area at the left side of the dialog box

RightArea 

vertical area at the right side of the dialog box

enum QtxDialog::ButtonPosition [inherited]
Enumerator:
Left 

set button left-most

Right 

set button right-most

Center 

place button in the center

Top 

set button top-most

Bottom 

set button bottom-most

enum QtxDialog::ButtonFlags [inherited]
Enumerator:
None 

no button used

OK 

OK button.

Apply 

Apply button.

Cancel 

Cancel button.

Yes 

Yes button.

No 

No button.

Close 

Close button.

Help 

Help button.

OKCancel 

OK & Cancel button.

YesNo 

Yes & No buttons.

Standard 

OK, Cancel & Help buttons.

All 

all buttons

enum QtxDialog::DialogFlags [inherited]
Enumerator:
Accept 

allow dialog box accepting control

Reject 

allow dialog box rejecting control

AlignOnce 

align dialog box only when it is first time shown

SetFocus 

allow to set focus on dialog box when it is shown (user can use setFocusProxy() and specify own initial focus widget)


Constructor & Destructor Documentation

QtxPathDialog::QtxPathDialog ( QWidget parent = 0,
const bool  modal = true,
const bool  resize = false,
const int  buttons = Standard,
Qt::WindowFlags  f = 0 
) [protected]
Parameters:
parentparent widget
modalif true, the dialog box should be modal
resizeif true, the dialog box is resizable
buttonsrequired buttons (QtxDialog.ButtonFlags)
fwindow flags

References initialize(), and updateVisibility().

QtxPathDialog::QtxPathDialog ( const bool  import,
QWidget parent = 0,
const bool  modal = true,
const bool  resize = false,
const int  buttons = Standard,
Qt::WindowFlags  f = 0 
)
Parameters:
importif true, the dialog box is shown for "open" mode, otherwise, it is shown in the "save" mode
parentparent widget
modalif true, the dialog box should be modal
resizeif true, the dialog box is resizable
buttonsrequired buttons (QtxDialog.ButtonFlags)
fwindow flags

References createFileEntry(), defaultEntry(), fileEntry(), initialize(), OpenFile, SaveFile, setDefaultEntry(), updateVisibility(), and validate().

QtxPathDialog::~QtxPathDialog ( ) [virtual]

Member Function Documentation

QString QtxPathDialog::fileName ( ) const
Returns:
file name

References defaultEntry().

void QtxPathDialog::setFileName ( const QString &  txt,
const bool  autoExtension = false 
)
Parameters:
txtnew file name
autoExtensionif true an extension is determined automatically by file

References defaultEntry().

QString QtxPathDialog::filter ( ) const
Returns:
file filter

References defaultEntry().

void QtxPathDialog::setFilter ( const QString &  fltr)

Filter is a list of file masks, separated by ';;'. For example, "*.h;;*.cxx"

Parameters:
fltrnew file filter

References defaultEntry().

void QtxPathDialog::fileNameChanged ( QString  fileName) [signal]
Parameters:
fileNamefile name
void QtxPathDialog::setVisible ( bool  on) [virtual, slot]
Parameters:
onnew visibility state

Reimplemented from QtxDialog.

References updateVisibility().

void QtxPathDialog::validate ( ) [protected, slot]
void QtxPathDialog::onBrowse ( ) [private, slot]
void QtxPathDialog::onReturnPressed ( ) [private, slot]
void QtxPathDialog::onTextChanged ( const QString &  ) [private, slot]
Parameters:
txtcurrent text (not used)

References validate().

bool QtxPathDialog::isValid ( ) [protected, virtual]
Returns:
true if selected file name is valid

References myEntries.

bool QtxPathDialog::acceptData ( ) const [protected, virtual]
Returns:
true if entered data is acceptable

Reimplemented from QtxDialog.

References QtxPathDialog.FileEntry.edit, QtxPathDialog.FileEntry.mode, myEntries, NewDir, OpenDir, OpenFile, SaveDir, SaveFile, and QtxDialog.Yes.

void QtxPathDialog::fileNameChanged ( int  ,
QString   
) [protected, virtual]

This method can be redefined in the successor classes. Default implementation does nothing.

Parameters:
idfile entry
fileNamefile name
QFrame * QtxPathDialog::optionsFrame ( ) [protected]
Returns:
options frame widget

References myOptionsFrame.

QString QtxPathDialog::fileName ( const int  id) const [protected]
Parameters:
idfile entry ID
Returns:
file name or null string if id is invalid

References myEntries.

void QtxPathDialog::setFileName ( const int  id,
const QString &  txt,
const bool  autoExt = false 
) [protected]
Parameters:
idfile entry ID
txtnew file name
autoExtif true, assign extension automatically

References autoExtension(), fileEntry(), filter(), OpenFile, and SaveFile.

QString QtxPathDialog::filter ( const int  id) const [protected]
Parameters:
idfile entry ID
Returns:
file filter or null string if id is invalid

References filter(), and myEntries.

void QtxPathDialog::setFilter ( const int  id,
const QString &  filter 
) [protected]
Parameters:
idfile entry ID
filterfile filter or null string if id is invalid

References myEntries.

QLineEdit * QtxPathDialog::fileEntry ( const int  id) const [protected]
Parameters:
idfile entry ID
Returns:
line edit widget or 0 if id is invalid

References myEntries.

QLineEdit * QtxPathDialog::fileEntry ( const int  theId,
int &  theMode 
) const [protected]
Parameters:
idfile entry ID
theModeto return file entry mode
Returns:
line edit widget or 0 if id is invalid

References myEntries.

int QtxPathDialog::createFileEntry ( const QString &  lab,
const int  mode,
const QString &  filter = QString(),
const int  id = -1 
) [protected]

If required file entry is already in use or if specified id is < 0, new ID is generated and returned.

Parameters:
labfile entry title
modefile entry mode
idrequired file entry ID
Returns:
created file entry ID

References QtxPathDialog.FileEntry.btn, QtxPathDialog.FileEntry.dlg, QtxPathDialog.FileEntry.edit, filter(), QtxPathDialog.FileEntry.filter, QtxPathDialog.FileEntry.mode, myEntries, myEntriesFrame, NewDir, onBrowse(), onReturnPressed(), onTextChanged(), open_icon, OpenDir, OpenFile, Qtx.pathCompleter(), Qtx.PT_Directory, Qtx.PT_OpenFile, Qtx.PT_SaveFile, SaveDir, and SaveFile.

int QtxPathDialog::defaultEntry ( ) const [protected]
Returns:
default entry ID

References myDefault.

void QtxPathDialog::setDefaultEntry ( const int  id) [protected]
Parameters:
idnew default entry ID

References myDefault.

void QtxPathDialog::initialize ( ) [private]
void QtxPathDialog::updateVisibility ( ) [private]
QStringList QtxPathDialog::prepareFilters ( const QString &  filter) const [private]
Parameters:
listof file masks, separated by ';;', for example, "*.h;;*.cxx"
Returns:
list of processed file filters

References filterWildCards().

bool QtxPathDialog::hasVisibleChildren ( QWidget wid) const [private]
Parameters:
widparent widget being checked
Returns:
true if widget wid has visible children
QStringList QtxPathDialog::filterWildCards ( const QString &  theFilter) const [private]
Parameters:
theFilterfile filter being processed
Returns:
list of filters with filtered wild cards
QString QtxPathDialog::autoExtension ( const QString &  theFileName,
const QString &  theFilter = QString() 
) const [private]
Parameters:
theFileNamefile name being processed
theFilterlist of file filters
Returns:
file name with assigned extension

References filter(), filterWildCards(), and prepareFilters().

void QtxDialog::setDialogFlags ( const int  f) [inherited]
void QtxDialog::clearDialogFlags ( const int  f) [inherited]
Parameters:
fdialog box flags (QtxDialog.DialogFlags)
See also:
setDialogFlags(), testDialogFlags()

References QtxDialog.myDialogFlags.

bool QtxDialog::testDialogFlags ( const int  f) const [inherited]
Returns:
true if specified dialog box falgs are set
See also:
setDialogFlags(), clearDialogFlags()

References QtxDialog.myDialogFlags.

void QtxDialog::setButtonFlags ( const int  f) [inherited]
Parameters:
fORed buttons flags (Qtx.ButtonFlags)
See also:
clearButtonFlags(), testButtonFlags()

References QtxDialog.myButtonFlags, and QtxDialog.update().

void QtxDialog::clearButtonFlags ( const int  f) [inherited]
Parameters:
fORed buttons flags (Qtx.ButtonFlags)
See also:
setButtonFlags(), testButtonFlags()

References QtxDialog.myButtonFlags, and QtxDialog.update().

bool QtxDialog::testButtonFlags ( const int  f) const [inherited]
Returns:
true if specified control buttons are used in the dialog box
See also:
setButtonFlags(), clearButtonFlags()

References QtxDialog.myButtonFlags.

int QtxDialog::buttonPosition ( const int  id) const [inherited]
Parameters:
idcontrol button ID (QtxDialog.ButtonFlags)
Returns:
button's position (QtxDialog.ButtonPosition) or -1 if it is not set or invalid id is given
See also:
setButtonPosition()

References QtxDialog.myPosition.

int QtxDialog::buttonPosition ( QAbstractButton b) const [protected, inherited]
Parameters:
bbutton
Returns:
button position (QtxDialog.ButtonPosition)

References QtxDialog.buttonId(), and QtxDialog.buttonPosition().

void QtxDialog::setButtonPosition ( const int  pos,
const int  id = -1 
) [inherited]
Parameters:
idcontrol button(s) ID (QtxDialog.ButtonFlags)
posbutton(s) position (QtxDialog.ButtonPosition)

References QtxDialog.button(), QtxDialog.buttons(), QtxDialog.myArea, and QtxDialog.myPosition.

void QtxDialog::setPlacePosition ( const int  pos,
const int  area 
) [inherited]
int QtxDialog::placePolicy ( const int  area) const [inherited]
Parameters:
areabuttons area (QtxDialog.ButtonArea)
See also:
setPlacePolicy()

References QtxDialog.myArea.

void QtxDialog::setPlacePolicy ( const int  policy,
const int  area 
) [inherited]
Parameters:
policybuttons layouting policy (QtxDialog.PlacePolicy)
areabuttons area (QtxDialog.ButtonArea)
See also:
placePolicy()

References QtxDialog.myArea.

void QtxDialog::setButtonPlace ( const int  area,
const int  id 
) [inherited]
QString QtxDialog::buttonText ( const int  id) [inherited]
Parameters:
idcontrol button ID (QtxDialog.ButtonFlags)
Returns:
button's text
See also:
setButtonText()

References QtxDialog.button().

void QtxDialog::setButtonText ( const int  id,
const QString &  text 
) [inherited]
Parameters:
idcontrol button ID (QtxDialog.ButtonFlags)
textbutton's text
See also:
buttonText()

References QtxDialog.adjustButtons(), and QtxDialog.button().

void QtxDialog::setButtonFocus ( const int  id) [inherited]
Parameters:
idcontrol button ID (QtxDialog.ButtonFlags)
See also:
hasButtonFocus()

References QtxDialog.button().

bool QtxDialog::hasButtonFocus ( const int  id) const [inherited]
Parameters:
idcontrol button ID (QtxDialog.ButtonFlags)
Returns:
true if specified button has keyboard focus
See also:
setButtonFocus()

References QtxDialog.button().

bool QtxDialog::isButtonEnabled ( const int  id) const [inherited]
Parameters:
idcontrol button(s) ID (QtxDialog.ButtonFlags)
Returns:
true if all specified buttons are enabled.
See also:
setButtonEnabled()

References QtxDialog.buttons().

void QtxDialog::setButtonEnabled ( const bool  on,
const int  id 
) [inherited]
Parameters:
onenable button(s) flag
idcontrol button(s) ID (QtxDialog.ButtonFlags)
See also:
isButtonEnabled()

References QtxDialog.buttons().

bool QtxDialog::isBorderEnabled ( const int  area) const [inherited]
Parameters:
areabuttons area (QtxDialog.ButtonArea)
Returns:
true if border is enabled for specified button area.
See also:
setBorderEnabled()

References QtxDialog.myArea.

void QtxDialog::setBorderEnabled ( const bool  on,
const int  area 
) [inherited]

Border is a line which separate main frame and control buttons.

Parameters:
areabuttons area (QtxDialog.ButtonArea)
onenable border flag
See also:
isBorderEnabled()

References QtxDialog.isBorderEnabled(), and QtxDialog.myArea.

void QtxDialog::removeButton ( const int  id) [inherited]

If id is -1, all user buttons are removed.

Parameters:
iduser button ID
See also:
insertButton(), userButton(), userButtonIds()

References QtxDialog.myArea, QtxDialog.myButton, QtxDialog.myPosition, and QtxDialog.update().

int QtxDialog::insertButton ( const QString &  text,
const int  area = BottomArea 
) [inherited]

The button is inserted to the specified dialog box area. if the button is added successfully, the unique identificator of the added button is returned, otherwise -1 is returned.

Parameters:
texttext of the added button
areabuttons area (QtxDialog.ButtonArea)
Returns:
button ID
See also:
removeButton(), userButton(), userButtonIds()

References QtxDialog.createButton(), QtxDialog.Area.insertButton(), QtxDialog.Left, QtxDialog.myArea, QtxDialog.myButton, QtxDialog.myPosition, QtxDialog.onButton(), QtxDialog.onDestroyed(), and QtxDialog.update().

QIntList QtxDialog::userButtonIds ( ) const [inherited]
Returns:
list of user buttons identificators
See also:
insertButton(), removeButton(), userButton()

References QtxDialog.myButton.

QAbstractButton * QtxDialog::userButton ( const int  id) const [inherited]
Parameters:
iduser button ID
Returns:
user button or 0 if it is not found
See also:
insertButton(), removeButton(), userButtonIds()

References QtxDialog.myButton.

uint QtxDialog::setAlignment ( uint  align) [inherited]

Use the function before the the dialog is first time shown. If dialog flag AlignOnce is set then alignment is performed only once, otherwise the dialog is aligned each time when it is shown. Dialog box is aligned relatively to its parent. By default, dialog box is aligned to the center of the parent widget (usually desktop or another dialog box).

Parameters:
alignalignment flag(s) (Qtx.AlignmentFlags)
Returns:
previous alignment policy

References QtxDialog.myAlignment.

void QtxDialog::setUnits ( QLabel aLabel,
const QString &  aUnits 
) [static, inherited]

In the dialog box label the measure units are closed in braces. If measure units do not exist they will be added.

For example:

  // create label "Radius"
  QLabel* aLabel = new QLabel( "Radius", mainFrame() );
  // set measure units to "mm"
  setUnits( aLabel, "mm" )    // => aLabel contains 'Radius (mm)'
  // set measure units to "cm"
  setUnits( aLabel, "cm" )    // => aLabel contains 'Radius (cm)'

  // create label "Radius" with initially not set measure units
  QLabel* aLabel = new QLabel( "Radius ():", mainFrame() );
  // set measure units to "mm"
  setUnits( aLabel, "mm" )    // => aLabel contains 'Radius (mm):'
  // set measure units to "cm"
  setUnits( aLabel, "cm" )    // => aLabel contains 'Radius (cm):'
Parameters:
aLabellabel widget
aUnitsmeasure units
void QtxDialog::dlgButton ( int  id) [signal, inherited]
Parameters:
iduser button identificator
void QtxDialog::dlgParamChanged ( ) [signal, inherited]
void QtxDialog::dlgHelp ( ) [signal, inherited]
void QtxDialog::dlgApply ( ) [signal, inherited]
void QtxDialog::dlgOk ( ) [signal, inherited]
void QtxDialog::dlgNo ( ) [signal, inherited]
void QtxDialog::dlgYes ( ) [signal, inherited]
void QtxDialog::dlgClose ( ) [signal, inherited]
void QtxDialog::dlgCancel ( ) [signal, inherited]
void QtxDialog::update ( ) [slot, inherited]
void QtxDialog::accept ( ) [protected, virtual, slot, inherited]

This method is used when any accept button is pressed (usually "OK", "Yes", etc).

If dialog flag QtxDialog.Accept is set, this function invokes acceptData() method, which should in this case return true to allow further processing.

If acceptData() returns false, this function just returns.

If acceptData() returns true, the Accepted result is set and signal according to the pressed control button is emitted. Then the default implementation of accept() method is called (which hides the dialog box and, depending on the dialog box flags, can close and destroy it).

See also:
acceptData()

Reimplemented in LightApp_PreferencesDlg, and Style_PrefDlg.

References QtxDialog.Accept, QtxDialog.acceptData(), QtxDialog.button(), QtxDialog.Close, QtxDialog.emitSignal(), QtxDialog.mySender, QtxDialog.OK, QtxDialog.testButtonFlags(), QtxDialog.testDialogFlags(), and QtxDialog.Yes.

void QtxDialog::reject ( ) [protected, virtual, slot, inherited]

This method is used when any reject button is pressed (usually "Close", "Cancel", "No", etc).

If dialog flag QtxDialog.Reject is set, this function invokes rejectData() method, which should in this case return true to allow further processing.

If rejectData() returns false, this function just returns.

If rejectData() returns true, the Rejected result is set and signal according to the pressed control button is emitted. Then the default implementation of reject() method is called (which hides the dialog box and, depending on the dialog box flags, can close and destroy it).

See also:
rejectData()

Reimplemented in LightApp_PreferencesDlg.

References QtxDialog.button(), QtxDialog.Cancel, QtxDialog.Close, QtxDialog.emitSignal(), QtxDialog.mySender, QtxDialog.No, QtxDialog.Reject, QtxDialog.rejectData(), QtxDialog.testButtonFlags(), and QtxDialog.testDialogFlags().

QFrame * QtxDialog::mainFrame ( ) const [protected, inherited]

Main frame is an internal widget which should contains all elements of dialog box except control buttons.

Returns:
main frame widget

References QtxDialog.myMainFrame.

bool QtxDialog::rejectData ( ) const [protected, virtual, inherited]

This method can be re-implemented in the successor class if it requires to check possibility to cancel dialog box safely. Default implementation returns true.

This method is called if dialog flag QtxDialog.Reject is set. If this method returns true, then dialog will be rejected and closed.

Returns:
true if dialog box can be cancelled
See also:
reject()
QAbstractButton * QtxDialog::createButton ( QWidget parent) [protected, virtual, inherited]

This method is invoked from method insertButton().

Parameters:
parentparent widget
Returns:
new user button
QAbstractButton * QtxDialog::button ( const int  f) const [protected, inherited]
Parameters:
fcontrol button ID (QtxDialog.ButtonFlags)
Returns:
button or 0 if id is invalid

References QtxDialog.myButton.

QtxDialog::ButtonMap QtxDialog::buttons ( const int  f = All) const [protected, inherited]
Parameters:
fcontrol button(s) ID(s) (QtxDialog.ButtonFlags)
Returns:
button map

References QtxDialog.myButton.

int QtxDialog::buttonId ( const QAbstractButton b) const [protected, inherited]
Parameters:
bbutton
Returns:
button ID

References QtxDialog.myButton.

void QtxDialog::showEvent ( QShowEvent *  e) [protected, virtual, inherited]

Re-implemented from Qt.

Parameters:
eshow event

References QtxDialog.AlignOnce, Qtx.alignWidget(), QtxDialog.myAlignment, QtxDialog.myInited, and QtxDialog.testDialogFlags().

void QtxDialog::hideEvent ( QHideEvent *  e) [protected, virtual, inherited]

Re-implemented from Qt.

Parameters:
ehide event
void QtxDialog::closeEvent ( QCloseEvent *  ) [protected, virtual, inherited]

Call reject() method.

Parameters:
eclose event (not used)

References QtxDialog.reject().

void QtxDialog::childEvent ( QChildEvent *  e) [protected, virtual, inherited]

Re-implemented from Qt.

Parameters:
echild event

References QtxDialog.onSizeGripDestroyed().

void QtxDialog::keyPressEvent ( QKeyEvent *  e) [protected, virtual, inherited]

Re-implemented from Qt.

Call reject() if "Escape" key is pressed. Call accept() if "Ctrl+Enter" key-sequence is pressed. Process "F1" key and emit signal dlgHelp(). Transfer "Ctrl+(Shift+)Tab" key-sequence press event to the child Tab widget (if there is any).

Parameters:
ekey press event

Reimplemented in Style_PrefDlg, and VTKViewer_MarkerDlg.

References QtxDialog.accept(), QtxDialog.Apply, QtxDialog.dlgApply(), QtxDialog.dlgHelp(), QtxDialog.Help, QtxDialog.isButtonEnabled(), QtxDialog.OK, QtxDialog.reject(), QtxDialog.testButtonFlags(), and QtxDialog.Yes.


Field Documentation

int QtxPathDialog.myDefault [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS