Figa
|
2010-03-10
, 21:03
|
Posts: 270 |
Thanked: 239 times |
Joined on Dec 2009
@ Czech Republic
|
#11
|
|
2010-03-11
, 08:18
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#12
|
|
2010-03-11
, 12:48
|
Posts: 270 |
Thanked: 239 times |
Joined on Dec 2009
@ Czech Republic
|
#13
|
|
2010-03-11
, 13:10
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#14
|
|
2010-03-11
, 14:46
|
Posts: 270 |
Thanked: 239 times |
Joined on Dec 2009
@ Czech Republic
|
#15
|
class Window : public QMainWindow { Q_OBJECT public: Window(); }; Window::Window() : QMainWindow() { QAction *action1 = new QAction(tr("&ACTION1"), this); QAction *action2 = new QAction(tr("&ACTION2"), this); QMenu *appMenu; appMenu = menuBar()->addMenu(tr("MENU TITLE")); appMenu->addAction(action1); appMenu->addAction(action2); connect(action1, SIGNAL(triggered()), this , SLOT(doAction1())); connect(action2, SIGNAL(triggered()), this , SLOT(doAction2())); QWidget *blank = new QWidget(); QHBoxLayout *layout = new QHBoxLayout(); blank->setLayout(layout); blank->show(); } Window window;
|
2010-03-11
, 15:09
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#16
|
class Window : public QMainWindow { Q_OBJECT public: Window(); }; Window::Window() : QMainWindow() { QAction *action1 = new QAction(tr("&ACTION1"), this); QAction *action2 = new QAction(tr("&ACTION2"), this); QMenu *appMenu; appMenu = menuBar()->addMenu(tr("MENU TITLE")); appMenu->addAction(action1); appMenu->addAction(action2); connect(action1, SIGNAL(triggered()), this , SLOT(doAction1())); connect(action2, SIGNAL(triggered()), this , SLOT(doAction2())); // add widgets to your main window once you have them, you dont need the below dummy blank widget. // later you can do setCentralWidget(blank); // QWidget *blank = new QWidget(); // QHBoxLayout *layout = new QHBoxLayout(); // blank->setLayout(layout); // blank->show(); } int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; window.show(); return app.exec(); }
|
2010-03-11
, 15:29
|
Posts: 270 |
Thanked: 239 times |
Joined on Dec 2009
@ Czech Republic
|
#17
|
|
2010-03-24
, 18:35
|
|
Posts: 1,296 |
Thanked: 1,773 times |
Joined on Aug 2009
@ Budapest, Hungary
|
#18
|
|
2010-03-24
, 18:44
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#19
|
The Following User Says Thank You to krk969 For This Useful Post: | ||
|
2010-03-24
, 18:50
|
|
Posts: 1,296 |
Thanked: 1,773 times |
Joined on Aug 2009
@ Budapest, Hungary
|
#20
|
The Following User Says Thank You to Venemo For This Useful Post: | ||