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

📄 c.cpp

📁 QT编写的简单计算器
💻 CPP
字号:
/****************************************************************************** Form implementation generated from reading ui file 'c.ui'**** Created: 日  2月 22 01:47:51 2009**      by: The User Interface Compiler ($Id: qt/main.cpp   3.1.1   edited Nov 21 17:40 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "c.h"#include <qvariant.h>#include <qlabel.h>#include <qlineedit.h>#include <qpushbutton.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include <qimage.h>#include <qpixmap.h>#include "c.ui.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. */Form1::Form1( QWidget* parent, const char* name, bool modal, WFlags fl )    : QDialog( parent, name, modal, fl ){    if ( !name )	setName( "Form1" );    lEResult = new QLineEdit( this, "lEResult" );    lEResult->setGeometry( QRect( 110, 60, 181, 22 ) );    lENum = new QLineEdit( this, "lENum" );    lENum->setGeometry( QRect( 110, 20, 181, 22 ) );    textLabel2 = new QLabel( this, "textLabel2" );    textLabel2->setGeometry( QRect( 20, 70, 71, 21 ) );    textLabel1 = new QLabel( this, "textLabel1" );    textLabel1->setGeometry( QRect( 20, 20, 83, 21 ) );    pBOctal = new QPushButton( this, "pBOctal" );    pBOctal->setGeometry( QRect( 130, 110, 71, 31 ) );    pBBin = new QPushButton( this, "pBBin" );    pBBin->setGeometry( QRect( 30, 110, 71, 31 ) );    pBHex = new QPushButton( this, "pBHex" );    pBHex->setGeometry( QRect( 240, 110, 80, 31 ) );    languageChange();    resize( QSize(368, 166).expandedTo(minimumSizeHint()) );    // signals and slots connections    connect( lENum, SIGNAL( textChanged(const QString&) ), lEResult, SLOT( clear() ) );    connect( pBBin, SIGNAL( clicked() ), this, SLOT( toBinary() ) );    connect( pBHex, SIGNAL( clicked() ), this, SLOT( toHex() ) );    connect( pBOctal, SIGNAL( clicked() ), this, SLOT( toOctal() ) );}/* *  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" ) );    textLabel2->setText( tr( "Result:" ) );    textLabel1->setText( tr( "Input Number:" ) );    pBOctal->setText( tr( "Octal" ) );    pBBin->setText( tr( "Binary" ) );    pBHex->setText( tr( "Hex" ) );}

⌨️ 快捷键说明

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