⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainform.cpp

📁 一个Linux下的五子棋对战游戏
💻 CPP
字号:
/****************************************************************************** Form implementation generated from reading ui file 'mainform.ui'**** Created: 二  5月 30 19:57:53 2006**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.5   edited Aug 31 12:13 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "mainform.h"#include <qvariant.h>#include <qlineedit.h>#include <qlabel.h>#include <qpushbutton.h>#include <qframe.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include <qaction.h>#include <qmenubar.h>#include <qpopupmenu.h>#include <qtoolbar.h>#include <qimage.h>#include <qpixmap.h>/* *  Constructs a mainform as a child of 'parent', with the *  name 'name' and widget flags set to 'f'. * */mainform::mainform( QWidget* parent, const char* name, WFlags fl )    : QMainWindow( parent, name, fl ){    (void)statusBar();    if ( !name )	setName( "mainform" );    setCentralWidget( new QWidget( this, "qt_central_widget" ) );    lineEdit1 = new QLineEdit( centralWidget(), "lineEdit1" );    lineEdit1->setGeometry( QRect( 30, 430, 171, 21 ) );    lineEdit2 = new QLineEdit( centralWidget(), "lineEdit2" );    lineEdit2->setGeometry( QRect( 240, 430, 61, 21 ) );    textLabel2 = new QLabel( centralWidget(), "textLabel2" );    textLabel2->setGeometry( QRect( 240, 410, 64, 20 ) );    textLabel3 = new QLabel( centralWidget(), "textLabel3" );    textLabel3->setGeometry( QRect( 360, 409, 90, 20 ) );    lineEdit3 = new QLineEdit( centralWidget(), "lineEdit3" );    lineEdit3->setGeometry( QRect( 360, 429, 121, 21 ) );    pushButton1 = new QPushButton( centralWidget(), "pushButton1" );    pushButton1->setGeometry( QRect( 500, 420, 85, 30 ) );    textLabel1 = new QLabel( centralWidget(), "textLabel1" );    textLabel1->setGeometry( QRect( 30, 409, 140, 20 ) );    textLabel4 = new QLabel( centralWidget(), "textLabel4" );    textLabel4->setGeometry( QRect( 440, 29, 65, 20 ) );    textLabel5 = new QLabel( centralWidget(), "textLabel5" );    textLabel5->setGeometry( QRect( 440, 90, 64, 20 ) );    textLabel6 = new QLabel( centralWidget(), "textLabel6" );    textLabel6->setGeometry( QRect( 470, 59, 64, 20 ) );    textLabel7 = new QLabel( centralWidget(), "textLabel7" );    textLabel7->setGeometry( QRect( 470, 129, 64, 20 ) );    line3 = new QFrame( centralWidget(), "line3" );    line3->setGeometry( QRect( 400, 179, 170, 20 ) );    line3->setFrameShape( QFrame::HLine );    line3->setFrameShadow( QFrame::Sunken );    line3->setFrameShape( QFrame::HLine );    textLabel8 = new QLabel( centralWidget(), "textLabel8" );    textLabel8->setGeometry( QRect( 420, 240, 120, 20 ) );    line4 = new QFrame( centralWidget(), "line4" );    line4->setGeometry( QRect( 400, 279, 171, 20 ) );    line4->setFrameShape( QFrame::HLine );    line4->setFrameShadow( QFrame::Sunken );    line4->setFrameShape( QFrame::HLine );    pushButton3 = new QPushButton( centralWidget(), "pushButton3" );    pushButton3->setGeometry( QRect( 440, 359, 61, 21 ) );    pushButton2 = new QPushButton( centralWidget(), "pushButton2" );    pushButton2->setGeometry( QRect( 440, 319, 61, 21 ) );    line2 = new QFrame( centralWidget(), "line2" );    line2->setGeometry( QRect( 10, 389, 550, 20 ) );    line2->setFrameShape( QFrame::HLine );    line2->setFrameShadow( QFrame::Sunken );    line2->setFrameShape( QFrame::HLine );    boardframe = new QFrame( centralWidget(), "boardframe" );    boardframe->setGeometry( QRect( 0, 0, 380, 380 ) );    boardframe->setPaletteBackgroundPixmap( QPixmap::fromMimeSource( "board.png" ) );    boardframe->setFrameShape( QFrame::StyledPanel );    boardframe->setFrameShadow( QFrame::Raised );    // toolbars    languageChange();    resize( QSize(600, 505).expandedTo(minimumSizeHint()) );    clearWState( WState_Polished );}/* *  Destroys the object and frees any allocated resources */mainform::~mainform(){    // no need to delete child widgets, Qt does it all for us}/* *  Sets the strings of the subwidgets using the current *  language. */void mainform::languageChange(){    setCaption( tr( "Gobang" ) );    textLabel2->setText( tr( "<b>Port</b>" ) );    textLabel3->setText( tr( "<b>User name</b>" ) );    pushButton1->setText( tr( "&Go !" ) );    pushButton1->setAccel( QKeySequence( tr( "Alt+G" ) ) );    textLabel1->setText( tr( "<b>Server address</b>" ) );    textLabel4->setText( tr( "<b>Player 1</b>" ) );    textLabel5->setText( tr( "<b>Player 2</b>" ) );    textLabel6->setText( tr( "textLabel6" ) );    textLabel7->setText( tr( "textLabel7" ) );    textLabel8->setText( tr( "textLabel8" ) );    pushButton3->setText( tr( "&About" ) );    pushButton3->setAccel( QKeySequence( tr( "Alt+A" ) ) );    pushButton2->setText( tr( "E&xit" ) );    pushButton2->setAccel( QKeySequence( tr( "Alt+X" ) ) );}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -