PDA

View Full Version : Menu Problem



rahulgogoi
26th May 2011, 14:40
hello friends

Actually i am not able to contruct a menu in my App..the code i have written is like that…



#include "menumainwindow.h"

menumainwindow::menumainwindow(QWidget *parent)
: QMainWindow(parent)
{


showAct = new QAction(("&Show"), this);
connect(showAct, SIGNAL(triggered()),label1, SLOT(show()));
hideAct = new QAction(("&Hide"), this);
connect(hideAct, SIGNAL(triggered()),label1, SLOT(hide()));
exitAct = new QAction(("&Exit"), this);
connect(exitAct, SIGNAL(triggered()),qApp, SLOT(quit()));
bar = menuBar()->addMenu("&File");
bar->addAction(showAct);
bar->addAction(hideAct);
bar->addSeparator();
bar->addAction(exitAct);
setCentralWidget(bar);

}

here it will display show,hide,exit menu but i want it to show when i click the “file”..so anything wrong in the code..please suggest
regards
Rahul

Santosh Reddy
26th May 2011, 15:00
setCentralWidget(bar);//?

rahulgogoi
26th May 2011, 15:01
otherwise it not visible in simulator..and in desktop app it works i know..but i want to know how it works for mobile devices