form.cpp

来自「在linux环境下」· C++ 代码 · 共 45 行

CPP
45
字号
#include "form.h"
#include <qvariant.h>
#include <qpushbutton.h>
#include <qtextedit.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>

Form::Form( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "Form" );

    sendButton = new QPushButton( this, "sendButton" );
    sendButton->setGeometry( QRect( 260, 430, 81, 31 ) );

    closeButton = new QPushButton( this, "closeButton" );
    closeButton->setGeometry( QRect( 360, 430, 81, 31 ) );

    readEdit = new QTextEdit( this, "readEdit" );
    readEdit->setGeometry( QRect( 10, 10, 431, 281 ) );
    readEdit->setMouseTracking( FALSE );

    inputEdit = new QTextEdit( this, "inputEdit" );
    inputEdit->setGeometry( QRect( 10, 310, 431, 101 ) );

    nameEdit = new QTextEdit( this, "nameEdit" );
    nameEdit->setGeometry( QRect( 460, 10, 131, 401 ) );
    languageChange();
    resize( QSize(600, 480).expandedTo(minimumSizeHint()) );
}

Form::~Form()
{
}
void Form::languageChange()
{
    setCaption( trUtf8( "聊天室" ) );
    sendButton->setText( trUtf8( "发送" ) );
    closeButton->setText( trUtf8( "关闭" ) );
}

⌨️ 快捷键说明

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