|
SciDAVis
1.D4
|
QFileDialog plus generic extension support. More...
#include <ExtensibleFileDialog.h>
Public Member Functions | |
| ExtensibleFileDialog (QWidget *parent=0, bool extended=true, Qt::WFlags flags=0) | |
| Constructor. | |
| bool | isExtendable () |
| Tells weather the dialog has a valid extension widget. | |
| bool | isExtended () |
| void | setExtended (bool extended) |
| void | setExtensionWidget (QWidget *extension) |
| Set the extension widget to be displayed when the user presses the toggle button. | |
Protected Attributes | |
| QPushButton * | d_extension_toggle |
| Button for toggling display of extension on/off. | |
Private Slots | |
| void | resize (bool extension_on) |
| Resize to make/take space for the extension widget. | |
Private Attributes | |
| QWidget * | d_extension |
| The extension widget. | |
| int | d_extension_row |
| The layout row (of the assumed QGridLayout) used for extensions. | |
QFileDialog plus generic extension support.
This is a simple hack on top of QFileDialog that allows a custom extension widget to be added to the bottom of the dialog. A button is provided for toggling display of this widget on/off.
For the placement of button and extension widget, it is assumed that QFileDialog uses a QGridLayout as its top-level layout. Other layouts will probably lead to a strange outlook, although the functionality should stay intact.
| ExtensibleFileDialog::ExtensibleFileDialog | ( | QWidget * | parent = 0, |
| bool | extended = true, |
||
| Qt::WFlags | flags = 0 |
||
| ) |
Constructor.
| parent | parent widget (only affects placement of the dialog) |
| extended | flag: show/hide the advanced options on start-up |
| flags | window flags |
References d_extension, d_extension_row, d_extension_toggle, and resize().
|
inline |
Tells weather the dialog has a valid extension widget.
References d_extension.
Referenced by OpenProjectDialog::closeEvent().
|
inline |
References d_extension_toggle.
Referenced by OpenProjectDialog::closeEvent(), ImageExportDialog::closeEvent(), and ImportASCIIDialog::closeEvent().
|
privateslot |
Resize to make/take space for the extension widget.
References d_extension.
Referenced by ExtensibleFileDialog().
|
inline |
References d_extension_toggle.
| void ExtensibleFileDialog::setExtensionWidget | ( | QWidget * | extension | ) |
Set the extension widget to be displayed when the user presses the toggle button.
References d_extension, d_extension_row, and d_extension_toggle.
Referenced by ApplicationWindow::appendProject(), ImageExportDialog::ImageExportDialog(), ImportASCIIDialog::ImportASCIIDialog(), OpenProjectDialog::OpenProjectDialog(), and TeXTableExportDialog::TeXTableExportDialog().
|
private |
The extension widget.
Referenced by ExtensibleFileDialog(), isExtendable(), resize(), and setExtensionWidget().
|
private |
The layout row (of the assumed QGridLayout) used for extensions.
Referenced by ExtensibleFileDialog(), and setExtensionWidget().
|
protected |
Button for toggling display of extension on/off.
Referenced by ExtensibleFileDialog(), isExtended(), setExtended(), setExtensionWidget(), OpenProjectDialog::updateAdvancedOptions(), and ImageExportDialog::updateAdvancedOptions().
1.8.1