?? main.cpp
字號:
#include "MainWindow.h"#include "app_mysql.h"#include "LogonDialog.h"#include <kapp.h>#include <qmessagebox.h>int main( int argc, char **argv ){ char username[100]; char password[100]; KApplication a( argc, argv, "cdapp" ); LogonDialog *dialog = new LogonDialog(); while (1) { if (dialog->exec() == QDialog::Accepted) { strcpy(username, dialog->getUsername()); strcpy(password, dialog->getPassword()); if (database_start(username, password)) break; QMessageBox::information(0, "Title", "Could not Logon: Check username and/or password", QMessageBox::Ok); continue; } else { if (QMessageBox::information(0, "Title", "Are you sure you want to quit?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { return 0; } } } delete dialog; MainWindow *window = new MainWindow( "Cd App" ); window->resize( 600, 400 ); a.setMainWidget( window ); window->show(); return a.exec();}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -