void DownloadQueue::addTopLevelItem(DownloadItem * item) {
  QTreeWidget::addTopLevelItem(item);

  YouTubeTitleRetriever * titleRetriever = new YouTubeTitleRetriever(item->getProperties());
  connect(titleRetriever, SIGNAL(error(QString)), titleRetriever, SLOT(deleteLater()));
  connect(titleRetriever, SIGNAL(success(QString, QString)), this, SLOT(setItemTitle(QString, QString)));
  connect(titleRetriever, SIGNAL(success(QString, QString)), titleRetriever, SLOT(deleteLater()));
  titleRetriever->getTitle();
}
示例#2
0
//------------------------------------------------------------------------------
// Connect all signals/slots
//------------------------------------------------------------------------------
void CaptureForm::setConnections(const QtSerializerWrapper& writer) {
    connect(m_titleEdit, SIGNAL(textEdited(QString)),
            this, SLOT(setItemTitle(QString)));

    connect(m_tagsEdit, SIGNAL(editingFinished()),
            this, SLOT(setTags()));

    connect(m_tagsBox, SIGNAL(activated(QString)),
            this, SLOT(addTag(QString)));

    connect(m_contentEdit, SIGNAL(textChanged()),
            this, SLOT(updateContentNotes()));

    connect(this, SIGNAL(requestWrite(QtItemWrapper)),
            &writer, SLOT(write(QtItemWrapper)));

    connect(m_okButton, SIGNAL(clicked(bool)),
            this, SLOT(acceptForm(bool)));

    connect(m_cancelButton, SIGNAL(clicked(bool)),
            this, SLOT(rejectForm(bool)));
}