yycking
31st March 2009, 06:38
I have a problem about menu.
I can not see menu items when I use some words.
What happen ?
3080
#include <QApplication>
#include <QMainWindow>
#include <QMenuBar>
#include <QAction>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QMainWindow *mainWindow = new QMainWindow;
mainWindow->setWindowTitle("QMainWindow");
QMenu *fileMenu = new QMenu("File");
fileMenu->addAction("Quit", &app, SLOT(quit()), Qt::CTRL + Qt::Key_Q);
mainWindow->menuBar()->addMenu(fileMenu);
mainWindow->show();
return app.exec();
}
File menu is not showing when I use "Quit".
If change to "Close" , it will show File menu.
My SDK verson is qt-sdk-mac-opensource-2009.01
3081
#include <QApplication>
#include <QMainWindow>
#include <QMenuBar>
#include <QAction>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QMainWindow *mainWindow = new QMainWindow;
mainWindow->setWindowTitle("QMainWindow");
QMenu *fileMenu = new QMenu("File");
fileMenu->addAction("Close", &app, SLOT(quit()), Qt::CTRL + Qt::Key_Q);
mainWindow->menuBar()->addMenu(fileMenu);
mainWindow->show();
return app.exec();
}
I can not see menu items when I use some words.
What happen ?
3080
#include <QApplication>
#include <QMainWindow>
#include <QMenuBar>
#include <QAction>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QMainWindow *mainWindow = new QMainWindow;
mainWindow->setWindowTitle("QMainWindow");
QMenu *fileMenu = new QMenu("File");
fileMenu->addAction("Quit", &app, SLOT(quit()), Qt::CTRL + Qt::Key_Q);
mainWindow->menuBar()->addMenu(fileMenu);
mainWindow->show();
return app.exec();
}
File menu is not showing when I use "Quit".
If change to "Close" , it will show File menu.
My SDK verson is qt-sdk-mac-opensource-2009.01
3081
#include <QApplication>
#include <QMainWindow>
#include <QMenuBar>
#include <QAction>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QMainWindow *mainWindow = new QMainWindow;
mainWindow->setWindowTitle("QMainWindow");
QMenu *fileMenu = new QMenu("File");
fileMenu->addAction("Close", &app, SLOT(quit()), Qt::CTRL + Qt::Key_Q);
mainWindow->menuBar()->addMenu(fileMenu);
mainWindow->show();
return app.exec();
}