examples/network/qftp/ftpwindow.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    83     buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
    83     buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
    84     buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
    84     buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
    85 
    85 
    86     progressDialog = new QProgressDialog(this);
    86     progressDialog = new QProgressDialog(this);
    87 
    87 
    88     connect(fileList, SIGNAL(itemActivated(QTreeWidgetItem *, int)),
    88     connect(fileList, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
    89             this, SLOT(processItem(QTreeWidgetItem *, int)));
    89             this, SLOT(processItem(QTreeWidgetItem*,int)));
    90     connect(fileList, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
    90     connect(fileList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
    91             this, SLOT(enableDownloadButton()));
    91             this, SLOT(enableDownloadButton()));
    92     connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload()));
    92     connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload()));
    93     connect(connectButton, SIGNAL(clicked()), this, SLOT(connectOrDisconnect()));
    93     connect(connectButton, SIGNAL(clicked()), this, SLOT(connectOrDisconnect()));
    94     connect(cdToParentButton, SIGNAL(clicked()), this, SLOT(cdToParent()));
    94     connect(cdToParentButton, SIGNAL(clicked()), this, SLOT(cdToParent()));
    95     connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile()));
    95     connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile()));
   161     setCursor(Qt::WaitCursor);
   161     setCursor(Qt::WaitCursor);
   162 #endif
   162 #endif
   163 
   163 
   164 //![1]
   164 //![1]
   165     ftp = new QFtp(this);
   165     ftp = new QFtp(this);
   166     connect(ftp, SIGNAL(commandFinished(int, bool)),
   166     connect(ftp, SIGNAL(commandFinished(int,bool)),
   167             this, SLOT(ftpCommandFinished(int, bool)));
   167             this, SLOT(ftpCommandFinished(int,bool)));
   168     connect(ftp, SIGNAL(listInfo(const QUrlInfo &)),
   168     connect(ftp, SIGNAL(listInfo(QUrlInfo)),
   169             this, SLOT(addToList(const QUrlInfo &)));
   169             this, SLOT(addToList(QUrlInfo)));
   170     connect(ftp, SIGNAL(dataTransferProgress(qint64, qint64)),
   170     connect(ftp, SIGNAL(dataTransferProgress(qint64,qint64)),
   171             this, SLOT(updateDataTransferProgress(qint64, qint64)));
   171             this, SLOT(updateDataTransferProgress(qint64,qint64)));
   172 
   172 
   173     fileList->clear();
   173     fileList->clear();
   174     currentPath.clear();
   174     currentPath.clear();
   175     isDirectory.clear();
   175     isDirectory.clear();
   176 //![1]
   176 //![1]