本文整理汇总了C++中MainMenu::show方法的典型用法代码示例。如果您正苦于以下问题:C++ MainMenu::show方法的具体用法?C++ MainMenu::show怎么用?C++ MainMenu::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainMenu
的用法示例。
在下文中一共展示了MainMenu::show方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_btnLogin_clicked
void MainWindow::on_btnLogin_clicked()
{
QSqlQueryModel *model = new QSqlQueryModel;
model->setQuery("SELECT * FROM users");
model->setHeaderData(0, Qt::Horizontal, tr("Name"));
model->setHeaderData(0, Qt::Horizontal, tr("Password"));
model->setHeaderData(0, Qt::Horizontal, tr("Type"));
QString username = ui->txtUserName->text();
QString password = ui->txtPassWord->text();
bool success = loginManager->Login(username, password);
if (success)
{
MainMenu *menu = new MainMenu(0, loginManager);
menu->show();
this->destroy();
//QTableView *view = new QTableView;
//view->setWindowTitle("Users");
//view->resizeColumnsToContents();
//view->resizeRowsToContents();
//view->setModel(model);
//view->show();
//view->resize(640, 480);
}
}
示例2: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainMenu w;
w.show();
return a.exec();
}
示例3: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainMenu w;
QRect screenGeometry = QApplication::desktop()->screenGeometry();
int x = (screenGeometry.width()-w.width()) / 2;
int y = (screenGeometry.height()-w.height()) / 2;
w.move(x, y);
w.show();
return a.exec();
}
示例4: ShowMenu
void Game::ShowMenu()
{
MainMenu mainMenu;
MainMenu::MenuResult result = mainMenu.show(m_mainWindow);
switch(result)
{
case MainMenu::Exit:
m_gameState = Game::Exiting;
break;
case MainMenu::Play:
m_gameState = Game::Playing;
break;
}
}
示例5: on_loginButton_clicked
void LoginWindow::on_loginButton_clicked()
{
ui->statusBar->showMessage(loggingIn.c_str());
SystemUser user = {ui->usernameLineEdit->text().toStdString(),
ui->passwordLineEdit->text().toStdString()};
if (Login(user)) {
ui->statusBar->clearMessage();
this->setHidden(true);
MainMenu *mainMenu = new MainMenu(this, user);
connect(mainMenu, SIGNAL(UserLoggedOut()), this, SLOT(UserLoggedOut()));
mainMenu->show();
}
else if (ui->statusBar->currentMessage().toStdString() != connectionError)
ui->statusBar->showMessage(loginFailed.c_str());
}
示例6: main
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
MainMenu main;
main.setFixedSize(320, 240);
main.setWindowFlags(Qt::CustomizeWindowHint);
main.show();
return app.exec();
}
示例7: main
int main(int argc, char *argv[])
{
DataConnect data;
data.getDataFromDatabase();
data.getBorrDataFromDatabaseNew();
data.getCollDataFromDatabase();
QApplication a(argc, argv);
DataModel::init();
MainMenu *m = DataModel::getMainmenu();
m->show();
// MainWindow *m = DataModel::getMainwindow();
// m->show();
return a.exec();
}
示例8: main
int main(int argc, char** argv) {
TCPIP tcpip;
bool simMode = false;
bool isKheperaConnected = false;
int triesLeft = 0; // nie polaczy sie, jak widac
while (triesLeft > 0 && !(tcpip.init() && tcpip.connect_to_server(kheperaAddress, 3000))) { //!!!
tcpip = TCPIP();
triesLeft--;
}
if (triesLeft > 0){
isKheperaConnected = true;
}
if (!isKheperaConnected) {
printf("Connection could not be established.\n");
} else {
printf("Connection has been established.\n");
}
View* view;
bool finish = false;
MainMenu* mainMenu = new MainMenu();
mainMenu->show();
int userChoice = NONE;
while (userChoice == NONE){
userChoice = mainMenu->userChoice();
}
switch (userChoice){
case CAMERA:
view = new KheperaView(rtspAddress);
if (view->start() < 0) {
printf("Camera is null\n");
finish = true;
} else {
view->capture();
}
break;
case SIMULATION:
simMode = true;
view = new SimulationView();
if (view->start() < 0) {
printf("Simulation could not be started\n");
finish = true;
} else {
view->capture();
}
break;
case QUIT:
waitKey(0);
cvDestroyAllWindows();
return 0;
break;
}
WheelController wc(view->get_width(), CAMERA_ANGLE, WHEEL_DIST/2, DIST, REF_HEIGHT, 0); // ostatni param: predkosc poczatkowa
pair<int,int> control;
while (!finish) {
view->print_viewInfo();
if (view->is_target_set()){
view->print_targetInfo();
// simulation mode
if(simMode){
((SimulationView*)view)->sim.printCoords();
if(!OBSERVER) {
control = wc.getSpeeds(view->get_target_position().x, (int)((SimulationView*)view)->sim.getHeight()); // zmienic na wysokosc celu
if(control.first != 0)
((SimulationView*)view)->sim.moveRobot(wc.getR(), wc.getSpeed()*INTERVAL, (control.first >= control.second));
}
} else { // normal mode
control = wc.getSpeeds(view->get_target_position().x, REF_HEIGHT/2); // zmienic na wysokosc celu
}
//cout << control.first << ", " << control.second << endl;
if (isKheperaConnected){
tcpip.send_speed(control.first, control.second);
}
}
if(!simMode)
usleep(1000000 * INTERVAL); //
view->show_main_panel();
view->capture();
finish = view->is_stopped();
if (!finish){
view->track_target();
}
}
tcpip.send_speed(0,0);
cvDestroyAllWindows();
waitKey(0);
return 0;
}
示例9: run
void JadeEngine::run(const Common::UString &target) {
_baseDirectory = target;
init();
initCursors();
if (EventMan.quitRequested())
return;
status("Successfully initialized the engine");
CursorMan.hideCursor();
CursorMan.set();
playVideo("black");
playVideo("publisher");
playVideo("bwlogo");
playVideo("graymatr");
playVideo("attract");
if (EventMan.quitRequested())
return;
CursorMan.showCursor();
MainMenu *mainMenu = new MainMenu();
mainMenu->show();
mainMenu->run();
delete mainMenu;
if (EventMan.quitRequested())
return;
playSound("musicbank00046", Sound::kSoundTypeMusic, true);
bool showFPS = ConfigMan.getBool("showfps", false);
Graphics::Aurora::FPS *fps = 0;
if (showFPS) {
fps = new Graphics::Aurora::FPS(FontMan.get(Graphics::Aurora::kSystemFontMono, 13));
fps->show();
}
Graphics::Aurora::Cube *cube = 0;
try {
cube = new Graphics::Aurora::Cube("ui_ph_silk");
} catch (Common::Exception &e) {
Common::printException(e);
}
while (!EventMan.quitRequested()) {
EventMan.delay(10);
}
delete cube;
delete fps;
}