Mercurial > hg > svgui
changeset 231:512ead25e842
* Grey out exporting entire pane as image if it will be too wide for QImage
author | Chris Cannam |
---|---|
date | Thu, 15 Mar 2007 11:34:39 +0000 |
parents | e52ed907cc42 |
children | 5de07bba4676 |
files | widgets/ListInputDialog.cpp widgets/ListInputDialog.h |
diffstat | 2 files changed, 27 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/widgets/ListInputDialog.cpp Thu Mar 15 11:34:20 2007 +0000 +++ b/widgets/ListInputDialog.cpp Thu Mar 15 11:34:39 2007 +0000 @@ -46,6 +46,10 @@ vbox->addStretch(1); + m_footnote = new QLabel; + vbox->addWidget(m_footnote); + m_footnote->hide(); + QHBoxLayout *hbox = new QHBoxLayout; vbox->addLayout(hbox, Qt::AlignRight); @@ -81,6 +85,19 @@ return ""; } +void +ListInputDialog::setItemAvailability(int item, bool available) +{ + m_radioButtons[item]->setEnabled(available); +} + +void +ListInputDialog::setFootnote(QString footnote) +{ + m_footnote->setText(footnote); + m_footnote->show(); +} + QString ListInputDialog::getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &list,
--- a/widgets/ListInputDialog.h Thu Mar 15 11:34:20 2007 +0000 +++ b/widgets/ListInputDialog.h Thu Mar 15 11:34:39 2007 +0000 @@ -23,6 +23,7 @@ #include <vector> class QRadioButton; +class QLabel; /** * Like QInputDialog::getItem(), except that it offers the items as a @@ -34,21 +35,24 @@ Q_OBJECT public: + ListInputDialog(QWidget *parent, const QString &title, + const QString &label, const QStringList &list, + int current = 0, Qt::WFlags f = 0); virtual ~ListInputDialog(); + void setItemAvailability(int item, bool available); + void setFootnote(QString footnote); + + QString getCurrentString() const; + static QString getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &list, int current = 0, bool *ok = 0, Qt::WFlags f = 0); protected: - ListInputDialog(QWidget *parent, const QString &title, - const QString &label, const QStringList &list, - int current = 0, Qt::WFlags f = 0); - - QString getCurrentString() const; - QStringList m_strings; std::vector<QRadioButton *> m_radioButtons; + QLabel *m_footnote; }; #endif