X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Ftoolbars%2Fmainbar.cpp;h=18790f54e4bd750be12f02fad722f23cb323672f;hp=b35e14661373d88325eb4a28c1d73a580d587e4f;hb=HEAD;hpb=b0773a8aa01735d7220284ab7a3e8b5d02b48e9e diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index b35e1466..cd46c063 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -130,7 +130,11 @@ MainBar::MainBar(Session &session, QWidget *parent, pv::views::trace::View *view action_open_->setText(tr("&Open...")); action_open_->setIcon(QIcon::fromTheme("document-open", QIcon(":/icons/document-open.png"))); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + action_open_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_O)); +#else action_open_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O)); +#endif connect(action_open_, SIGNAL(triggered(bool)), this, SLOT(on_actionOpen_triggered())); @@ -141,7 +145,11 @@ MainBar::MainBar(Session &session, QWidget *parent, pv::views::trace::View *view action_save_->setText(tr("&Save...")); action_save_->setIcon(QIcon::fromTheme("document-save-as", QIcon(":/icons/document-save-as.png"))); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + action_save_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_S)); +#else action_save_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S)); +#endif connect(action_save_, SIGNAL(triggered(bool)), this, SLOT(on_actionSave_triggered())); @@ -154,7 +162,11 @@ MainBar::MainBar(Session &session, QWidget *parent, pv::views::trace::View *view action_save_selection_as_->setText(tr("Save Selected &Range As...")); action_save_selection_as_->setIcon(QIcon::fromTheme("document-save-as", QIcon(":/icons/document-save-as.png"))); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + action_save_selection_as_->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_R)); +#else action_save_selection_as_->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R)); +#endif connect(action_save_selection_as_, SIGNAL(triggered(bool)), this, SLOT(on_actionSaveSelectionAs_triggered())); @@ -548,7 +560,7 @@ void MainBar::update_device_config_widgets() sample_count_supported_ = true; // Add notification of reconfigure events - disconnect(this, SLOT(on_config_changed())); + // Note: No need to disconnect the previous signal as that QObject instance is destroyed connect(&opts->binding(), SIGNAL(config_changed()), this, SLOT(on_config_changed()));