ExtensibleFileDialog.h
Go to the documentation of this file.
/***************************************************************************
File : ExtensibleFileDialog.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2007 by Knut Franke, Ion Vasilief
Email (use @ for *) : knut.franke*gmx.de, ion_vasilief*yahoo.fr
Description : QFileDialog plus generic extension support
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef EXTENSIBLE_FILE_DIALOG_H
#define EXTENSIBLE_FILE_DIALOG_H
#include <QFileDialog>
#include <QPushButton>
class ExtensibleFileDialog : public QFileDialog
{
Q_OBJECT
public:
ExtensibleFileDialog(QWidget *parent=0, bool extended = true, Qt::WFlags flags=0);
void setExtensionWidget(QWidget *extension);
bool isExtendable(){return d_extension != NULL;};
bool isExtended(){return d_extension_toggle->isChecked();};
void setExtended(bool extended);
void setExtentionToggleButtonText(const QString& text){d_extension_toggle->setText(text);};
void setEditableFilter(bool on = true);
private slots:
void updateToggleButtonText(bool);
protected:
QPushButton *d_extension_toggle;
private:
QWidget *d_extension;
int d_extension_row;
};
#endif // ifndef EXTENSIBLE_FILE_DIALOG_H
ExtensibleFileDialog::d_extension
QWidget * d_extension
The extension widget.
Definition: ExtensibleFileDialog.h:78
ExtensibleFileDialog::setEditableFilter
void setEditableFilter(bool on=true)
Enables/Disables editing of the file type filter.
Definition: ExtensibleFileDialog.cpp:89
ExtensibleFileDialog::isExtendable
bool isExtendable()
Tells weather the dialog has a valid extension widget.
Definition: ExtensibleFileDialog.h:60
ExtensibleFileDialog::setExtensionWidget
void setExtensionWidget(QWidget *extension)
Set the extension widget to be displayed when the user presses the toggle button. ...
Definition: ExtensibleFileDialog.cpp:63
ExtensibleFileDialog::setExtended
void setExtended(bool extended)
Toggle extension widget on/off.
Definition: ExtensibleFileDialog.cpp:119
ExtensibleFileDialog::setExtentionToggleButtonText
void setExtentionToggleButtonText(const QString &text)
Sets the text to be displayed in the toggle button.
Definition: ExtensibleFileDialog.h:65
ExtensibleFileDialog::updateToggleButtonText
void updateToggleButtonText(bool)
Definition: ExtensibleFileDialog.cpp:109
ExtensibleFileDialog::isExtended
bool isExtended()
Definition: ExtensibleFileDialog.h:61
ExtensibleFileDialog::d_extension_toggle
QPushButton * d_extension_toggle
Button for toggling display of extension on/off.
Definition: ExtensibleFileDialog.h:74
ExtensibleFileDialog
QFileDialog plus generic extension support.
Definition: ExtensibleFileDialog.h:44
ExtensibleFileDialog::d_extension_row
int d_extension_row
The layout row (of the assumed QGridLayout) used for extensions.
Definition: ExtensibleFileDialog.h:80
ExtensibleFileDialog::ExtensibleFileDialog
ExtensibleFileDialog(QWidget *parent=0, bool extended=true, Qt::WFlags flags=0)
Constructor.
Definition: ExtensibleFileDialog.cpp:37