was ist die beste Möglichkeit, einen Slot einen Parameter mitzugeben:
Code: Alles auswählen
void BackupMonitor::contextMenuRequested(QPoint pos) {
QVariant customerId = ui->backupView->currentIndex().data(Qt::UserRole + 1);
QModelIndex i = ui->backupView->currentIndex();
if (i.isValid()) {
QList<QAction*> listActions;
QAction *actionState10DaysAgo = new QAction("Jobs der letzten 10 Tage", this);
listActions << actionState10DaysAgo;
connect(actionState10DaysAgo, SIGNAL(triggered()), this, SLOT(showState10DaysAgo()) );
// ...
// ...
QMenu::exec(listActions, ui->backupView->mapToGlobal(pos) + QPoint(0, 25) );
}
}