comparison multichoicedialog.cpp @ 68:b918e57c7bea

* Flesh out multi-choice dialog a big
author Chris Cannam
date Wed, 17 Nov 2010 22:13:34 +0000
parents be627aeceaed
children 6d5a5571caec
comparison
equal deleted inserted replaced
67:be627aeceaed 68:b918e57c7bea
15 COPYING included with this distribution for more information. 15 COPYING included with this distribution for more information.
16 */ 16 */
17 17
18 #include "multichoicedialog.h" 18 #include "multichoicedialog.h"
19 19
20 MultiChoiceDialog::MultiChoiceDialog(QWidget *parent) : 20 #include <QDialogButtonBox>
21
22 MultiChoiceDialog::MultiChoiceDialog(QString title, QString heading, QWidget *parent) :
21 QDialog(parent) 23 QDialog(parent)
22 { 24 {
25 setModal(true);
26 setWindowTitle(title);
27
28 QGridLayout *outer = new QGridLayout;
29 setLayout(outer);
30
31 outer->addWidget(new QLabel(heading), 0, 0, 1, 3);
32
33 QWidget *innerWidget = new QWidget;
34 outer->addWidget(innerWidget, 1, 0, 1, 2);
35 m_choiceLayout = new QGridLayout;
36 innerWidget->setLayout(m_choiceLayout);
37
38 m_descriptionLabel = new QLabel;
39 outer->addWidget(m_descriptionLabel, 2, 0, 1, 3);
40
41 m_argLabel = new QLabel();
42 outer->addWidget(m_argLabel, 3, 0);
43
44 m_argEdit = new QLineEdit();
45 outer->addWidget(m_argEdit, 3, 1);
46
47 m_browseButton = new QPushButton(tr("Browse..."));
48 outer->addWidget(m_browseButton, 3, 2);
49
50 QDialogButtonBox *bbox = new QDialogButtonBox(QDialogButtonBox::Ok |
51 QDialogButtonBox::Cancel);
52 connect(bbox, SIGNAL(accepted()), this, SLOT(accept()));
53 connect(bbox, SIGNAL(rejected()), this, SLOT(reject()));
54 outer->addWidget(bbox, 4, 0, 1, 3);
23 } 55 }
56