0
と呼ばれました動作しません:のQt 5.7 QFileDialogアクションは、私がのFileDialogこのコードの私のメインウィンドウ内
QAction *actionWithShortcut = new QAction();
actionWithShortcut->setShortcut(Qt::CTRL + Qt::Key_9);
actionWithShortcut->setShortcutContext(Qt::ShortcutContext::WidgetWithChildrenShortcut);
// added this comment to check does it work at list outside filedialog
// addAction(actionWithShortcut);
QFileDialog *fd = new QFileDialog(this);
fd->addAction(actionWithShortcut);
connect(actionWithShortcut, &QAction::triggered, fd, &QFileDialog::reject);
fd->show();
しかし、私はQFileDialog
に任意のアクションを追加することはできませんか、彼らが何らかの形で省略されているように見えます。助言がありますか? 既にウィンドウのフラグ、オプションなどが試されました。解決策が見つかりません。