📄 sheshi.cpp
字号:
#include "sheshi.h"#include "mainmenu.h"#include <qvariant.h>#include <qlistbox.h>#include <qpushbutton.h>#include <qwidget.h>#include <qwidgetstack.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include <qscrollview.h>/* * Constructs a Form1 as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */sheshi::sheshi( QWidget* parent, const char* name, WFlags fl ) : QDialog( parent, name, TRUE ){ if ( !name ) setName( "sheshi" ); setMaximumSize( QSize( 200, 176 ) ); //pushButton1 = new QPushButton( this, "pushButton1" ); //pushButton1->setGeometry( QRect( 4, -44, 85, 22 ) ); fanghuibutton = new QPushButton( this, "fanghuibutton" ); fanghuibutton->setGeometry( QRect( 4, 4, 85, 22 ) ); listBox1 = new QListBox( this, "listBox1" ); listBox1->setGeometry( QRect( 4, 28, 85, 140 ) ); widgetStack1 = new QWidgetStack( this, "widgetStack1" ); widgetStack1->setGeometry( QRect( 90, 0, 100, 250 ) ); page = new QWidget( widgetStack1, "page" ); matoubutton = new QPushButton( page, "matoubutton" ); matoubutton->setGeometry( QRect( 3, 59, 84, 22 ) ); matoubutton->setMinimumSize( QSize( 0, 0 ) ); matoubutton->setMaximumSize( QSize( 85, 22 ) ); changtukechezhanbutton = new QPushButton( page, "changtukechezhanbutton" ); changtukechezhanbutton->setGeometry( QRect( 3, 87, 84, 22 ) ); changtukechezhanbutton->setMinimumSize( QSize( 0, 0 ) ); changtukechezhanbutton->setMaximumSize( QSize( 85, 22 ) ); jiayouzhanbutton = new QPushButton( page, "jiayouzhanbutton" ); jiayouzhanbutton->setGeometry( QRect( 3, 115, 84, 22 ) ); jiayouzhanbutton->setMinimumSize( QSize( 0, 0 ) ); jiayouzhanbutton->setMaximumSize( QSize( 85, 22 ) ); tingchechangbutton = new QPushButton( page, "tingchechangbutton" ); tingchechangbutton->setGeometry( QRect( 3, 143, 84, 22 ) ); tingchechangbutton->setMinimumSize( QSize( 0, 0 ) ); tingchechangbutton->setMaximumSize( QSize( 85, 22 ) ); jiaotongguanliduibutton = new QPushButton( page, "jiaotongguanliduibutton" ); jiaotongguanliduibutton->setGeometry( QRect( 3, 171, 84, 22 ) ); jiaotongguanliduibutton->setMinimumSize( QSize( 0, 0 ) ); jiaotongguanliduibutton->setMaximumSize( QSize( 85, 22 ) ); shoufeizhanbutton = new QPushButton( page, "shoufeizhanbutton" ); shoufeizhanbutton->setGeometry( QRect( 3, 199, 84, 22 ) ); shoufeizhanbutton->setMinimumSize( QSize( 0, 0 ) ); shoufeizhanbutton->setMaximumSize( QSize( 85, 22 ) ); qichefuwubutton = new QPushButton( page, "qichefuwubutton" ); qichefuwubutton->setGeometry( QRect( 3, 227, 85, 22 ) ); feijichangbutton = new QPushButton( page, "feijichangbutton" ); feijichangbutton->setGeometry( QRect( 3, 31, 84, 22 ) ); feijichangbutton->setMinimumSize( QSize( 0, 0 ) ); feijichangbutton->setMaximumSize( QSize( 85, 22 ) ); huochezhanbutton = new QPushButton( page, "huochezhanbutton" ); huochezhanbutton->setGeometry( QRect( 3, 3, 84, 22 ) ); huochezhanbutton->setMinimumSize( QSize( 0, 0 ) ); huochezhanbutton->setMaximumSize( QSize( 85, 22 ) ); widgetStack1->addWidget( page, 0 ); page_2 = new QWidget( widgetStack1, "page_2" ); dangzhanjiguanbutton = new QPushButton( page_2, "dangzhanjiguanbutton" ); dangzhanjiguanbutton->setGeometry( QRect( 3, 3, 84, 22 ) ); dangzhanjiguanbutton->setMaximumSize( QSize( 85, 22 ) ); shehuituantibutton = new QPushButton( page_2, "shehuituantibutton" ); shehuituantibutton->setGeometry( QRect( 3, 31, 84, 22 ) ); shehuituantibutton->setMaximumSize( QSize( 85, 22 ) ); yiliaoweishengbutton = new QPushButton( page_2, "yiliaoweishengbutton" ); yiliaoweishengbutton->setGeometry( QRect( 3, 59, 84, 22 ) ); yiliaoweishengbutton->setMaximumSize( QSize( 85, 22 ) ); changguanghuisuobutton = new QPushButton( page_2, "changguanghuisuobutton" ); changguanghuisuobutton->setGeometry( QRect( 3, 87, 84, 22 ) ); changguanghuisuobutton->setMaximumSize( QSize( 85, 22 ) ); chuangbochubanbutton = new QPushButton( page_2, "chuangbochubanbutton" ); chuangbochubanbutton->setGeometry( QRect( 3, 115, 84, 22 ) ); chuangbochubanbutton->setMaximumSize( QSize( 85, 22 ) ); youjudianxinbutton = new QPushButton( page_2, "youjudianxinbutton" ); youjudianxinbutton->setGeometry( QRect( 3, 143, 84, 22 ) ); youjudianxinbutton->setMaximumSize( QSize( 85, 22 ) ); gonggongfuwubutton = new QPushButton( page_2, "gonggongfuwubutton" ); gonggongfuwubutton->setGeometry( QRect( 3, 171, 84, 22 ) ); gonggongfuwubutton->setMaximumSize( QSize( 85, 22 ) ); waijiaojigoubutton = new QPushButton( page_2, "waijiaojigoubutton" ); waijiaojigoubutton->setGeometry( QRect( 3, 199, 84, 22 ) ); waijiaojigoubutton->setMaximumSize( QSize( 85, 22 ) ); widgetStack1->addWidget( page_2, 1 ); page_3 = new QWidget( widgetStack1, "page_3" ); shudianbutton = new QPushButton( page_3, "shudianbutton" ); shudianbutton->setGeometry( QRect( 3, 59, 85, 22 ) ); shudianbutton->setMaximumSize( QSize( 85, 22 ) ); dashaxieziloubutton = new QPushButton( page_3, "dashaxieziloubutton" ); dashaxieziloubutton->setGeometry( QRect( 3, 87, 85, 22 ) ); dashaxieziloubutton->setMaximumSize( QSize( 85, 22 ) ); gongsiqiyebutton = new QPushButton( page_3, "gongsiqiyebutton" ); gongsiqiyebutton->setGeometry( QRect( 3, 115, 85, 22 ) ); gongsiqiyebutton->setMaximumSize( QSize( 85, 22 ) ); jingrongjigoubutton = new QPushButton( page_3, "jingrongjigoubutton" ); jingrongjigoubutton->setGeometry( QRect( 3, 143, 85, 22 ) ); jingrongjigoubutton->setMaximumSize( QSize( 85, 22 ) ); zhuanyefuwubutton = new QPushButton( page_3, "zhuanyefuwubutton" ); zhuanyefuwubutton->setGeometry( QRect( 3, 171, 85, 22 ) ); zhuanyefuwubutton->setMaximumSize( QSize( 85, 22 ) ); richanggouwubutton = new QPushButton( page_3, "richanggouwubutton" ); richanggouwubutton->setGeometry( QRect( 3, 3, 85, 22 ) ); richanggouwubutton->setMaximumSize( QSize( 85, 22 ) ); yaodianbutton = new QPushButton( page_3, "yaodianbutton" ); yaodianbutton->setGeometry( QRect( 3, 31, 85, 22 ) ); yaodianbutton->setMaximumSize( QSize( 85, 22 ) ); widgetStack1->addWidget( page_3, 2 ); page_4 = new QWidget( widgetStack1, "page_4" ); cantingfangzhuangbutton = new QPushButton( page_4, "cantingfangzhuangbutton" ); cantingfangzhuangbutton->setGeometry( QRect( 3, 3, 85, 22 ) ); cantingfangzhuangbutton->setMaximumSize( QSize( 85, 22 ) ); binguangzhaodaibutton = new QPushButton( page_4, "binguangzhaodaibutton" ); binguangzhaodaibutton->setGeometry( QRect( 3, 31, 85, 22 ) ); binguangzhaodaibutton->setMaximumSize( QSize( 85, 22 ) ); widgetStack1->addWidget( page_4, 3 ); page_5 = new QWidget( widgetStack1, "page_5" ); wenhuachangsuobutton = new QPushButton( page_5, "wenhuachangsuobutton" ); wenhuachangsuobutton->setGeometry( QRect( 3, 3, 85, 22 ) ); wenhuachangsuobutton->setMaximumSize( QSize( 85, 22 ) ); gongyuanyouleyuanbutton = new QPushButton( page_5, "gongyuanyouleyuanbutton" ); gongyuanyouleyuanbutton->setGeometry( QRect( 3, 31, 85, 22 ) ); gongyuanyouleyuanbutton->setMaximumSize( QSize( 85, 22 ) ); yulechangsuobutton = new QPushButton( page_5, "yulechangsuobutton" ); yulechangsuobutton->setGeometry( QRect( 3, 59, 85, 22 ) ); yulechangsuobutton->setMaximumSize( QSize( 85, 22 ) ); xiuxianchangsuobutton = new QPushButton( page_5, "xiuxianchangsuobutton" ); xiuxianchangsuobutton->setGeometry( QRect( 3, 87, 85, 22 ) ); xiuxianchangsuobutton->setMaximumSize( QSize( 85, 22 ) ); yundongchangguangbutton = new QPushButton( page_5, "yundongchangguangbutton" ); yundongchangguangbutton->setGeometry( QRect( 3, 115, 85, 22 ) ); yundongchangguangbutton->setMaximumSize( QSize( 85, 22 ) ); widgetStack1->addWidget( page_5, 4 ); page_6 = new QWidget( widgetStack1, "page_6" ); renwenjinguang = new QPushButton( page_6, "renwenjinguang" ); renwenjinguang->setGeometry( QRect( 3, 3, 85, 22 ) ); renwenjinguang->setMaximumSize( QSize( 85, 22 ) ); ziranjinguang = new QPushButton( page_6, "ziranjinguang" ); ziranjinguang->setGeometry( QRect( 3, 31, 85, 22 ) ); ziranjinguang->setMaximumSize( QSize( 85, 22 ) ); widgetStack1->addWidget( page_6, 5 ); page_7 = new QWidget( widgetStack1, "page_7" ); xuexiaobutton = new QPushButton( page_7, "xuexiaobutton" ); xuexiaobutton->setGeometry( QRect( 3, 3, 85, 22 ) ); xuexiaobutton->setMaximumSize( QSize( 85, 22 ) ); peishunjigoubutton = new QPushButton( page_7, "peishunjigoubutton" ); peishunjigoubutton->setGeometry( QRect( 3, 31, 85, 22 ) ); peishunjigoubutton->setMaximumSize( QSize( 85, 22 ) ); keyanjigoubutton = new QPushButton( page_7, "keyanjigoubutton" ); keyanjigoubutton->setGeometry( QRect( 3, 59, 85, 22 ) ); keyanjigoubutton->setMaximumSize( QSize( 85, 22 ) ); widgetStack1->addWidget( page_7, 6 ); page_8 = new QWidget( widgetStack1, "page_8" ); pushButton48 = new QPushButton( page_8, "pushButton48" ); pushButton48->setGeometry( QRect( 3, 3, 85, 22 ) ); pushButton48->setMaximumSize( QSize( 85, 22 ) ); pushButton48_2 = new QPushButton( page_8, "pushButton48_2" ); pushButton48_2->setGeometry( QRect( 3, 31, 85, 22 ) ); pushButton48_2->setMaximumSize( QSize( 85, 22 ) ); widgetStack1->addWidget( page_8, 7 ); languageChange(); resize( QSize(200, 176).expandedTo(minimumSizeHint()) ); QScrollView *s =new QScrollView(this); s->setGeometry (90,0,105,176); s->addChild(widgetStack1); widgetStack1->setMinimumSize(90,250); //s->setHScrollBarMode(QScrollView::AlwaysOn); // signals and slots connections connect( listBox1, SIGNAL( highlighted(int) ), widgetStack1, SLOT( raiseWidget(int) ) ); connect( fanghuibutton, SIGNAL( clicked() ), this, SLOT( close() ) ); connect( fanghuibutton, SIGNAL (clicked()), this, SLOT(fhdialog())); }/* * Destroys the object and frees any allocated resources */sheshi::~sheshi(){ // no need to delete child widgets, Qt does it all for us}/* * Sets the strings of the subwidgets using the current * language. */void sheshi::languageChange(){ setCaption( tr( "sheshi" ) ); // pushButton1->setText( tr( "pushButton1" ) ); fanghuibutton->setText( tr( "fanghui" ) ); listBox1->clear(); listBox1->insertItem( tr( "jiaotongsheshi" ) ); listBox1->insertItem( tr( "gonggongshiye" ) ); listBox1->insertItem( tr( "shangyejigou" ) ); listBox1->insertItem( tr( "canyinzhusu" ) ); listBox1->insertItem( tr( "xiuxianyule" ) ); listBox1->insertItem( tr( "lvyoujingdian" ) ); listBox1->insertItem( tr( "wenjiaokeyan" ) ); listBox1->insertItem( tr( "qitadian" ) ); matoubutton->setText( tr( "matou" ) ); changtukechezhanbutton->setText( tr( "changtukechezhan" ) ); jiayouzhanbutton->setText( tr( "jiayouzhan" ) ); tingchechangbutton->setText( tr( "tingchechang" ) ); jiaotongguanliduibutton->setText( tr( "jiaotongguanlidui" ) ); shoufeizhanbutton->setText( tr( "shoufeizhan" ) ); qichefuwubutton->setText( tr( "qichefuwu" ) ); feijichangbutton->setText( tr( "feijichang" ) ); huochezhanbutton->setText( tr( "huochezhan" ) ); dangzhanjiguanbutton->setText( tr( "dangzhenjiguan" ) ); shehuituantibutton->setText( tr( "shehuituanti" ) ); yiliaoweishengbutton->setText( tr( "yiliaoweisheng" ) ); changguanghuisuobutton->setText( tr( "changguanghuisuo" ) ); chuangbochubanbutton->setText( tr( "chuangbochuban" ) ); youjudianxinbutton->setText( tr( "youjudianxin" ) ); gonggongfuwubutton->setText( tr( "gonggongfuwu" ) ); waijiaojigoubutton->setText( tr( "waijiaojigou" ) ); shudianbutton->setText( tr( "shudian" ) ); dashaxieziloubutton->setText( tr( "dashaxiezilou" ) ); gongsiqiyebutton->setText( tr( "gongsiqiye" ) ); jingrongjigoubutton->setText( tr( "jingrongjigou" ) ); zhuanyefuwubutton->setText( tr( "zhuanyefuwu" ) ); richanggouwubutton->setText( tr( "richanggouwu" ) ); yaodianbutton->setText( tr( "yaodian" ) ); cantingfangzhuangbutton->setText( tr( "cantingfanzhuang" ) ); binguangzhaodaibutton->setText( tr( "binguanzhaodai" ) ); wenhuachangsuobutton->setText( tr( "wenhuachangsuo" ) ); gongyuanyouleyuanbutton->setText( tr( "gongyuanyouleyuan" ) ); yulechangsuobutton->setText( tr( "yulechangsuo" ) ); xiuxianchangsuobutton->setText( tr( "xiuxianchangsuo" ) ); yundongchangguangbutton->setText( tr( "yundongchangguan" ) ); renwenjinguang->setText( tr( "renwenjinguang" ) ); ziranjinguang->setText( tr( "ziranjinguang" ) ); xuexiaobutton->setText( tr( "xuexiao" ) ); peishunjigoubutton->setText( tr( "peishunjigou" ) ); keyanjigoubutton->setText( tr( "keyanjigou" ) ); pushButton48->setText( tr( "qita" ) ); pushButton48_2->setText( tr( "gongce" ) );}void sheshi::fhdialog(){mainmenubase *q= new mainmenubase(0,"mainmenu");q->exec();delete q;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -