diwidget.cpp.svn-base

来自「QT网络传输。用来演示QT的网络传输类。」· SVN-BASE 代码 · 共 81 行

SVN-BASE
81
字号
/*  * Author:  $Author: vincent $ * Date:    $Date: 2006/04/24 02:28:56 $ * Module:  $RCSfile: diwidget.cpp,v $ * Revision:$Revision: 1.3 $ * Status:  $State: Exp $ */#include <QtGui>#include <QtNetwork>#include "diwidget.h"DIWidget::DIWidget(QWidget *parent)    :QGroupBox(parent){    /* Create buttons */    selectButton=new QPushButton(tr("Select"));    connect(selectButton,SIGNAL(clicked()),this,SLOT(_select()));        sendButton=new QPushButton(tr("Send"));    connect(sendButton,SIGNAL(clicked()),this,SLOT(_send()));        stopButton=new QPushButton(tr("Stop"));    connect(stopButton,SIGNAL(clicked()),this,SLOT(_stop()));        /* Create Progress */    progressBar=new QProgressBar;    /* Set Layout */    QHBoxLayout *buttonsLayout=new QHBoxLayout;    buttonsLayout->addWidget(selectButton);    buttonsLayout->addWidget(sendButton);    buttonsLayout->addWidget(stopButton);        QVBoxLayout *mainLayout=new QVBoxLayout;    mainLayout->addLayout(buttonsLayout);    mainLayout->addWidget(progressBar);    setLayout(mainLayout);    setTitle(tr("Transmit"));}void DIWidget::_select(){    emit wantToSelectFile();}void DIWidget::_send(){    emit wantToSendFile();}void DIWidget::_stop(){    emit wantToStopSend();}void DIWidget::enableButtons(bool bEnabled){    //selectButton->setEnabled(bEnabled);    sendButton->setEnabled(bEnabled);    stopButton->setEnabled(!bEnabled);}void DIWidget::setEnabled(bool bEnabled){    QGroupBox::setEnabled(bEnabled);}void DIWidget::setMaximum(int maximum){   progressBar->setMaximum(maximum); }void DIWidget::setValue(int value){    progressBar->setValue(value);}

⌨️ 快捷键说明

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