3 #include "menudialog.hpp"
6 // --------------------------------------------------
8 // --------------------------------------------------
9 MenuDialog::MenuDialog (const QString &title)
12 setWindowTitle (title);
13 _layout = new QVBoxLayout (this);
17 MenuDialog& MenuDialog::addEntry (const QString &text)
19 QPushButton* btn = new QPushButton (text, this);
21 connect (btn, SIGNAL (clicked ()), SLOT (buttonClicked ()));
22 _layout->addWidget (btn);
23 _buttons.append (btn);
29 void MenuDialog::buttonClicked ()
31 QPushButton *btn = static_cast<QPushButton*> (sender ());
36 index = _buttons.indexOf (btn);
42 int MenuDialog::run ()
46 if (exec () == QDialog::Accepted)