5 Dialog::Dialog(QWidget *parent) :
6 QDialog(parent, Qt::Dialog | Qt::WindowTitleHint |
7 Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint)
9 scroller = new QScrollArea(this);
12 scroller->setProperty("FingerScrollable", true);
13 scroller->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
15 scroller->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
17 scroller->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
18 scroller->setFrameStyle(QFrame::NoFrame);
20 content = new QWidget(scroller);
21 contentLayout = new QVBoxLayout(content);
22 contentLayout->setMargin(0);
23 content->setLayout(contentLayout);
25 buttonBox = new QDialogButtonBox(Qt::Vertical, this);
26 QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
27 horizontalLayout->addWidget(scroller);
28 horizontalLayout->addWidget(buttonBox);
29 setLayout(horizontalLayout);
31 scroller->setWidget(content);
33 scroller->setWidgetResizable(true);
36 void Dialog::addWidget(QWidget *widget)
38 contentLayout->addWidget(widget);
41 void Dialog::addStretch(int stretch)
43 contentLayout->addStretch(stretch);
46 void Dialog::addButton(QPushButton *button, QDialogButtonBox::ButtonRole role)
48 buttonBox->addButton(button, role);
51 QPushButton *Dialog::addButton(QDialogButtonBox::StandardButton button)
53 return buttonBox->addButton(button);