本文整理汇总了C++中Transfer::getMimeType方法的典型用法代码示例。如果您正苦于以下问题:C++ Transfer::getMimeType方法的具体用法?C++ Transfer::getMimeType怎么用?C++ Transfer::getMimeType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transfer
的用法示例。
在下文中一共展示了Transfer::getMimeType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showContextMenu
void TransfersContentsWidget::showContextMenu(const QPoint &point)
{
Transfer *transfer = getTransfer(m_ui->transfersViewWidget->indexAt(point));
QMenu menu(this);
if (transfer)
{
menu.addAction(tr("Open"), this, SLOT(openTransfer()));
const QList<ApplicationInformation> applications = Utils::getApplicationsForMimeType(transfer->getMimeType());
if (applications.count() > 1)
{
QMenu *applicationsMenu = menu.addMenu(tr("Open With"));
for (int i = 0; i < applications.count(); ++i)
{
applicationsMenu->addAction(applications.at(i).icon, ((applications.at(i).name.isEmpty()) ? tr("Unknown") : applications.at(i).name))->setData(applications.at(i).command);
if (i == 0)
{
applicationsMenu->addSeparator();
}
}
connect(applicationsMenu, SIGNAL(triggered(QAction*)), this, SLOT(openTransfer(QAction*)));
}
menu.addAction(tr("Open Folder"), this, SLOT(openTransferFolder()));
menu.addSeparator();
menu.addAction(((transfer->getState() == Transfer::ErrorState) ? tr("Resume") : tr("Stop")), this, SLOT(stopResumeTransfer()))->setEnabled(transfer->getState() == Transfer::RunningState || transfer->getState() == Transfer::ErrorState);
menu.addAction(tr("Redownload"), this, SLOT(redownloadTransfer()));
menu.addSeparator();
menu.addAction(tr("Copy Transfer Information"), this, SLOT(copyTransferInformation()));
menu.addSeparator();
menu.addAction(tr("Remove"), this, SLOT(removeTransfer()));
}