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

📄 diwidget.cpp.svn-base

📁 QT网络传输。用来演示QT的网络传输类。
💻 SVN-BASE
字号:
/*  * 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -