Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef QXTCONFIGDIALOG_H
00026 #define QXTCONFIGDIALOG_H
00027
00028 #include <QDialog>
00029 #include "qxtglobal.h"
00030 #include "qxtpimpl.h"
00031
00032 QT_FORWARD_DECLARE_CLASS(QTableWidget)
00033 QT_FORWARD_DECLARE_CLASS(QStackedWidget)
00034 QT_FORWARD_DECLARE_CLASS(QDialogButtonBox)
00035 class QxtConfigDialogPrivate;
00036
00037 class QXT_GUI_EXPORT QxtConfigDialog : public QDialog
00038 {
00039 Q_OBJECT
00040 QXT_DECLARE_PRIVATE(QxtConfigDialog);
00041 Q_PROPERTY(int count READ count)
00042 Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)
00043 Q_PROPERTY(bool hoverEffect READ hasHoverEffect WRITE setHoverEffect)
00044 Q_PROPERTY(QxtConfigDialog::IconPosition iconPosition READ iconPosition WRITE setIconPosition)
00045 Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
00046 Q_ENUMS(IconPosition)
00047
00048 public:
00049 enum IconPosition { North, West, East };
00050
00051 explicit QxtConfigDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0);
00052 explicit QxtConfigDialog(QxtConfigDialog::IconPosition position, QWidget* parent = 0, Qt::WindowFlags flags = 0);
00053 virtual ~QxtConfigDialog();
00054
00055 QDialogButtonBox* dialogButtonBox() const;
00056 void setDialogButtonBox(QDialogButtonBox* buttonBox);
00057
00058 bool hasHoverEffect() const;
00059 void setHoverEffect(bool enabled);
00060
00061 QxtConfigDialog::IconPosition iconPosition() const;
00062 void setIconPosition(QxtConfigDialog::IconPosition position);
00063
00064 QSize iconSize() const;
00065 void setIconSize(const QSize& size);
00066
00067 int addPage(QWidget* page, const QIcon& icon, const QString& title = QString());
00068 int insertPage(int index, QWidget* page, const QIcon& icon, const QString& title = QString());
00069 QWidget* takePage(int index);
00070
00071 int count() const;
00072 int currentIndex() const;
00073 QWidget* currentPage() const;
00074
00075 int indexOf(QWidget* page) const;
00076 QWidget* page(int index) const;
00077
00078 bool isPageEnabled(int index) const;
00079 void setPageEnabled(int index, bool enabled);
00080
00081 bool isPageHidden(int index) const;
00082 void setPageHidden(int index, bool hidden);
00083
00084 QIcon pageIcon(int index) const;
00085 void setPageIcon(int index, const QIcon& icon);
00086
00087 QString pageTitle(int index) const;
00088 void setPageTitle(int index, const QString& title);
00089
00090 QString pageToolTip(int index) const;
00091 void setPageToolTip(int index, const QString& tooltip);
00092
00093 QString pageWhatsThis(int index) const;
00094 void setPageWhatsThis(int index, const QString& whatsthis);
00095
00096 public Q_SLOTS:
00097 void setCurrentIndex(int index);
00098 void setCurrentPage(QWidget* page);
00099
00100 virtual void accept();
00101 virtual void reject();
00102
00103 Q_SIGNALS:
00104 void currentIndexChanged(int index);
00105
00106 protected:
00107 QTableWidget* tableWidget() const;
00108 QStackedWidget* stackedWidget() const;
00109
00110 virtual void cleanupPage(int index);
00111 virtual void initializePage(int index);
00112 };
00113
00114 #endif // QXTCONFIGDIALOG_H