📄 form1.cpp
字号:
/****************************************************************************** Form implementation generated from reading ui file 'form1.ui'**** Created: 星期五 七月 25 19:28:39 2008** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.2 edited Nov 24 13:47 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "form1.h"#include <qvariant.h>#include <qlabel.h>#include <qpushbutton.h>#include <qlineedit.h>#include <qtextedit.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>#include "form1.ui.h"/* * Constructs a Form1 as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */Form1::Form1( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ){ (void)statusBar(); if ( !name ) setName( "Form1" ); setCentralWidget( new QWidget( this, "qt_central_widget" ) ); textLabel1 = new QLabel( centralWidget(), "textLabel1" ); textLabel1->setGeometry( QRect( 10, 335, 37, 20 ) ); textLabel2 = new QLabel( centralWidget(), "textLabel2" ); textLabel2->setGeometry( QRect( 180, 330, 30, 20 ) ); pushButton1 = new QPushButton( centralWidget(), "pushButton1" ); pushButton1->setGeometry( QRect( 50, 370, 80, 23 ) ); lineEdit2 = new QLineEdit( centralWidget(), "lineEdit2" ); lineEdit2->setGeometry( QRect( 210, 330, 106, 21 ) ); textEdit1 = new QTextEdit( centralWidget(), "textEdit1" ); textEdit1->setGeometry( QRect( 0, 10, 600, 300 ) ); lineEdit1 = new QLineEdit( centralWidget(), "lineEdit1" ); lineEdit1->setGeometry( QRect( 50, 330, 106, 21 ) ); // actions fileOpenAction = new QAction( this, "fileOpenAction" ); fileOpenAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "fileopen" ) ) ); Action = new QAction( this, "Action" ); // toolbars toolBar = new QToolBar( QString(""), this, DockTop ); fileOpenAction->addTo( toolBar ); // menubar MenuBar = new QMenuBar( this, "MenuBar" ); fileMenu = new QPopupMenu( this ); fileOpenAction->addTo( fileMenu ); fileMenu->insertSeparator(); fileMenu->insertSeparator(); MenuBar->insertItem( QString(""), fileMenu, 1 ); languageChange(); resize( QSize(601, 480).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( fileOpenAction, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); connect( pushButton1, SIGNAL( clicked() ), this, SLOT( editshow() ) );}/* * Destroys the object and frees any allocated resources */Form1::~Form1(){ // no need to delete child widgets, Qt does it all for us}/* * Sets the strings of the subwidgets using the current * language. */void Form1::languageChange(){ setCaption( tr( "Form1" ) ); textLabel1->setText( trUtf8( "\xe4\xbd\x8d\xe7\xbd\xae\xef\xbc\x9a" ) ); textLabel2->setText( trUtf8( "\xe5\x80\xbc\xef\xbc\x9a" ) ); pushButton1->setText( tr( "OK" ) ); fileOpenAction->setText( tr( "Open" ) ); fileOpenAction->setMenuText( tr( "&Open..." ) ); fileOpenAction->setAccel( tr( "Ctrl+O" ) ); Action->setText( tr( "Unnamed" ) ); toolBar->setLabel( tr( "Tools" ) ); if (MenuBar->findItem(1)) MenuBar->findItem(1)->setText( tr( "&File" ) );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -