📄 delform.ui.h
字号:
/****************************************************************************** ui.h extension file, included from the uic-generated form implementation.**** If you want to add, delete, or rename functions or slots, use** Qt Designer to update this file, preserving your code.**** You should not define a constructor or destructor in this file.** Instead, write your code in functions called init() and destroy().** These will automatically be called by the form's constructor and** destructor.*****************************************************************************/#ifndef _GLOBALS_H_extern dbs *database;extern table* tab ;#endifvoid delForm::init(){ comboBox2->clear(); for(int i=0;i<database->databases.size();i++) { comboBox2->insertItem(database->databases[i]->dbName); } comboBox3->clear(); for(int i=0;i<database->databases.size();i++) { comboBox3->insertItem(database->databases[i]->dbName); } for(int i = 0 ;i<database->databases[0]->tables.size();i++) { comboBox4->insertItem(database->databases[0]->tables[i]); } }void delForm::delDB(){ switch( QMessageBox::warning( this, "Delete a database", "Do you really want to delete\n" "this database?\n\n", "YES", "NO", 0, 0, 1 ) ) { case 0: // 用户点击“再试”或者按下回车键 // 再次尝试 database->del(comboBox2->currentText()); this->close(); return; case 1: // 用户点击“退出”或者按下Esc键 // 退出 return;} //database->del(comboBox2->currentText());}void delForm::delTB(){ switch( QMessageBox::warning( this, "Delete a Table", "Do you really want to delete\n" "this table?\n\n", "YES", "NO", 0, 0, 1 ) ) { case 0: // 用户点击“再试”或者按下回车键 // 再次尝试 int i; //database->del(comboBox3->currentText()); for(i=0;i<database->databases.size();i++) { if(database->databases[i]->dbName==comboBox3->currentText()) { database->databases[i]->del(comboBox4->currentText()); break; } } this->close(); return; case 1: // 用户点击“退出”或者按下Esc键 // 退出 return;}}void delForm::refresh( const QString & name ){ int i; int j; for(i=0;i<database->databases.size();i++) { if(name==database->databases[i]->dbName) break; std::cout<<i<<endl; } comboBox4->clear(); for(j=0;j<database->databases[i]->tables.size();j++) { comboBox4->insertItem(database->databases[i]->tables[j]); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -