📄 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();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -