comparison widgets/ListInputDialog.cpp @ 640:c6d705bf1672

Merge from branch "qt5". This revision actually builds with Qt4 (late releases) or Qt5, though it will warn on configure with Qt4.
author Chris Cannam
date Tue, 14 May 2013 12:36:43 +0100
parents d632a1e87018
children 4a578a360011
comparison
equal deleted inserted replaced
632:9d8f6552014d 640:c6d705bf1672
23 #include <QPushButton> 23 #include <QPushButton>
24 #include <QDialogButtonBox> 24 #include <QDialogButtonBox>
25 25
26 ListInputDialog::ListInputDialog(QWidget *parent, const QString &title, 26 ListInputDialog::ListInputDialog(QWidget *parent, const QString &title,
27 const QString &labelText, const QStringList &list, 27 const QString &labelText, const QStringList &list,
28 int current, Qt::WFlags f) : 28 int current) :
29 QDialog(parent, f), 29 QDialog(parent),
30 m_strings(list) 30 m_strings(list)
31 { 31 {
32 setWindowTitle(title); 32 setWindowTitle(title);
33 33
34 QVBoxLayout *vbox = new QVBoxLayout(this); 34 QVBoxLayout *vbox = new QVBoxLayout(this);
87 } 87 }
88 88
89 QString 89 QString
90 ListInputDialog::getItem(QWidget *parent, const QString &title, 90 ListInputDialog::getItem(QWidget *parent, const QString &title,
91 const QString &label, const QStringList &list, 91 const QString &label, const QStringList &list,
92 int current, bool *ok, Qt::WFlags f) 92 int current, bool *ok)
93 { 93 {
94 ListInputDialog dialog(parent, title, label, list, current, f); 94 ListInputDialog dialog(parent, title, label, list, current);
95 95
96 bool accepted = (dialog.exec() == QDialog::Accepted); 96 bool accepted = (dialog.exec() == QDialog::Accepted);
97 if (ok) *ok = accepted; 97 if (ok) *ok = accepted;
98 98
99 return dialog.getCurrentString(); 99 return dialog.getCurrentString();