void QtFileTransferWidget::addReceiveItem(ReceiveFileSession * fileSession) { QtFileTransferDownloadItem * fileTransferItem = new QtFileTransferDownloadItem(this, fileSession, _downloadFolder); SAFE_CONNECT(fileTransferItem, SIGNAL(removeClicked()), SLOT(itemRemoveClicked())); QListWidgetItem * item = new QListWidgetItem(/*_ui->downloadTransferListWidget*/); item->setSizeHint(fileTransferItem->minimumSizeHint()); _ui->downloadTransferListWidget->insertItem(0, item); _ui->downloadTransferListWidget->setItemWidget(item, fileTransferItem); showDownloadTab(); showAndRaise(); }
void QtFileTransferWidget::addSendItem(SendFileSession * fileSession, const std::string & filename, const std::string & contact) { QtFileTransferUploadItem * fileTransferItem = new QtFileTransferUploadItem(this, fileSession, QString::fromStdString(filename), contact); SAFE_CONNECT(fileTransferItem, SIGNAL(removeClicked()), SLOT(itemRemoveClicked())); QListWidgetItem * item = new QListWidgetItem(/*_ui->uploadTransferListWidget*/); item->setSizeHint(fileTransferItem->minimumSizeHint()); _ui->uploadTransferListWidget->insertItem(0, item); _ui->uploadTransferListWidget->setItemWidget(item, fileTransferItem); showUploadTab(); showAndRaise(); }
void OSItem::onRemoveClicked() { // Note: an OSDropZone2 owns this OSItem; // there should be a parent... //OS_ASSERT(this->parent()); // ... and it should be a OSDropZone2... //auto dropZone = qobject_cast<OSDropZone2 *>(this->parent()); //OS_ASSERT(dropZone); // ... and it needs to listen to, and act on, // this signal to cause a model object reset emit itemRemoveClicked(this); }
void OSItem::onRemoveClicked() { emit itemRemoveClicked(this); }