if (supported_device)
drivers_.addItem(QString("%1 (%2)").arg(
driver->long_name().c_str(), name.c_str()),
- qVariantFromValue(driver));
+ QVariant::fromValue(driver));
}
}
text += QString(" with %1 channels").arg(device->device()->channels().size());
QListWidgetItem *const item = new QListWidgetItem(text, &device_list_);
- item->setData(Qt::UserRole, qVariantFromValue(device));
+ item->setData(Qt::UserRole, QVariant::fromValue(device));
device_list_.addItem(item);
}
selector_ = new QComboBox(parent);
for (unsigned int i = 0; i < values_.size(); i++) {
const pair<Glib::VariantBase, QString> &v = values_[i];
- selector_->addItem(v.second, qVariantFromValue(v.first));
+ selector_->addItem(v.second, QVariant::fromValue(v.first));
}
update_widget();
for (int i = 0; i < views::ViewTypeCount; i++) {
QAction *const action = menu_new_view->addAction(tr(views::ViewTypeNames[i]));
- action->setData(qVariantFromValue(i));
+ action->setData(QVariant::fromValue(i));
}
new_view_button_->setMenu(menu_new_view);
toolbar->addWidget(save_button_);
// Add format types
- format_selector_->addItem(tr("Hexdump"), qVariantFromValue(QString("text/hexdump")));
+ format_selector_->addItem(tr("Hexdump"), QVariant(QString("text/hexdump")));
// Add widget stack
root_layout->addWidget(stacked_widget_);
for (int i = 0; i < SaveTypeCount; i++) {
QAction *const action = save_menu->addAction(tr(SaveTypeNames[i]));
- action->setData(qVariantFromValue(i));
+ action->setData(QVariant::fromValue(i));
}
save_button_->setMenu(save_menu);
for (int i = 0; i < SaveTypeCount; i++) {
QAction *const action = save_menu->addAction(tr(SaveTypeNames[i]));
- action->setData(qVariantFromValue(i));
+ action->setData(QVariant::fromValue(i));
}
save_button_->setMenu(save_menu);
QComboBox *selector = new QComboBox(parent);
- selector->addItem("-", qVariantFromValue((void*)nullptr));
+ selector->addItem("-", QVariant::fromValue((void*)nullptr));
if (!ch->assigned_signal)
selector->setCurrentIndex(0);
assert(b);
if (b->logic_data() && b->enabled()) {
selector->addItem(b->name(),
- qVariantFromValue((void*)b.get()));
+ QVariant::fromValue((void*)b.get()));
if (ch->assigned_signal == b.get())
selector->setCurrentIndex(selector->count() - 1);
{
QComboBox *selector = new QComboBox(parent);
- selector->addItem("0", qVariantFromValue((int)SRD_INITIAL_PIN_LOW));
- selector->addItem("1", qVariantFromValue((int)SRD_INITIAL_PIN_HIGH));
- selector->addItem("X", qVariantFromValue((int)SRD_INITIAL_PIN_SAME_AS_SAMPLE0));
+ selector->addItem("0", QVariant::fromValue((int)SRD_INITIAL_PIN_LOW));
+ selector->addItem("1", QVariant::fromValue((int)SRD_INITIAL_PIN_HIGH));
+ selector->addItem("X", QVariant::fromValue((int)SRD_INITIAL_PIN_SAME_AS_SAMPLE0));
selector->setCurrentIndex(ch->initial_pin_state);
}
QAction *const action = addAction(QString::fromUtf8(d->name));
- action->setData(qVariantFromValue(l->data));
+ action->setData(QVariant::fromValue(l->data));
mapper_.setMapping(action, action);
connect(action, SIGNAL(triggered()), &mapper_, SLOT(map()));
}
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);
assert(f.second);
QAction *const action = addAction(tr("Export %1...")
.arg(QString::fromStdString(f.second->description())));
- action->setData(qVariantFromValue((void*)f.second.get()));
+ action->setData(QVariant::fromValue((void*)f.second.get()));
mapper_.setMapping(action, action);
connect(action, SIGNAL(triggered()), &mapper_, SLOT(map()));
}
assert(f.second);
QAction *const action = addAction(tr("Import %1...")
.arg(QString::fromStdString(f.second->description())));
- action->setData(qVariantFromValue((void*)f.second.get()));
+ action->setData(QVariant::fromValue((void*)f.second.get()));
mapper_.setMapping(action, action);
connect(action, SIGNAL(triggered()), &mapper_, SLOT(map()));
}
list_.clear();
for (size_t i = 0; i < count; i++) {
char *const s = sr_si_string_u64(vals[i], suffix_);
- list_.addItem(QString::fromUtf8(s), qVariantFromValue(vals[i]));
+ list_.addItem(QString::fromUtf8(s), QVariant::fromValue(vals[i]));
g_free(s);
}