View Single Post
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#16
making corrections ...
Code:
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();
}
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”

Last edited by krk969; 2010-03-24 at 22:32.
 

The Following 3 Users Say Thank You to krk969 For This Useful Post: