]> sigrok.org Git - pulseview.git/blobdiff - pv/widgets/devicetoolbutton.cpp
Session: Fix issue #67 by improving error handling
[pulseview.git] / pv / widgets / devicetoolbutton.cpp
index 6a12aa25c446904651b60bfe6de58e13d27eaa12..2e76f689a61f448b068e149e2c1886a5f67992b8 100644 (file)
@@ -55,8 +55,13 @@ DeviceToolButton::DeviceToolButton(QWidget *parent,
        setDefaultAction(connect_action_);
        setMinimumWidth(QFontMetrics(font()).averageCharWidth() * 24);
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+       connect(&mapper_, SIGNAL(mappedObject(QObject*)),
+               this, SLOT(on_action(QObject*)));
+#else
        connect(&mapper_, SIGNAL(mapped(QObject*)),
                this, SLOT(on_action(QObject*)));
+#endif
 
        connect(&menu_, SIGNAL(hovered(QAction*)),
                this, SLOT(on_menu_hovered(QAction*)));
@@ -100,7 +105,7 @@ void DeviceToolButton::update_device_list()
                        dev->display_name(device_manager_)), this);
                a->setCheckable(true);
                a->setChecked(selected_device_ == dev);
-               a->setData(qVariantFromValue((void*)dev.get()));
+               a->setData(QVariant::fromValue((void*)dev.get()));
                a->setToolTip(QString::fromStdString(dev->full_name()));
                mapper_.setMapping(a, a);