'G_WIN32_DLLMAIN_FOR_DLL_NAME',
'g_win32_get_package_installation_directory',
'g_win32_get_package_installation_subdirectory',
+ 'qVariantFromValue'
] },
# APIs that make the program exit. Dissectors shouldn't call these
item->setText(column_number_handle, handle);
item->setText(column_number_uuid, uuid);
item->setText(column_number_uuid_name, uuid_name);
- item->setData(0, Qt::UserRole, qVariantFromValue(pinfo->num));
+ item->setData(0, Qt::UserRole, QVariant::fromValue(pinfo->num));
for (int i = 0; i < dialog->ui->tableTreeWidget->columnCount(); i++) {
dialog->ui->tableTreeWidget->resizeColumnToContents(i);
}
int idx = QTabWidget::addTab(byte_view_text, name);
- byte_view_text->setProperty("tab_index", qVariantFromValue(idx));
+ byte_view_text->setProperty("tab_index", QVariant::fromValue(idx));
QTabWidget::setTabToolTip(idx, name);
}
InterfaceTreeWidgetItem *ti = new InterfaceTreeWidgetItem(ui->interfaceTree);
ti->setFlags(ti->flags() | Qt::ItemIsEditable);
ti->setData(col_interface_, Qt::UserRole, QString(device->name));
- ti->setData(col_traffic_, Qt::UserRole, qVariantFromValue(ti->points));
+ ti->setData(col_traffic_, Qt::UserRole, QVariant::fromValue(ti->points));
ti->setText(col_interface_, device->display_name);
if (device->no_addresses > 0) {
}
QList<int> points = ti->data(col_traffic_, Qt::UserRole).value<QList<int> >();
points.append(device->packet_diff);
- ti->setData(col_traffic_, Qt::UserRole, qVariantFromValue(points));
+ ti->setData(col_traffic_, Qt::UserRole, QVariant::fromValue(points));
}
}
connect(ui->interfaceTree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(interfaceItemChanged(QTreeWidgetItem*,int)));
{
// See setData for the special col_traffic_ treatment.
if (column == col_traffic_ && role == Qt::UserRole) {
- return qVariantFromValue(points);
+ return QVariant::fromValue(points);
}
return QTreeWidgetItem::data(column, role);
if (column == CONV_COLUMN_DURATION) {
span_px.start -= start_px;
}
- return qVariantFromValue(span_px);
+ return QVariant::fromValue(span_px);
break;
}
.arg(proto_get_protocol_short_name(protocol))
.arg(proto_get_protocol_long_name(protocol));
proto_ti->setText(0, label);
- proto_ti->setData(0, Qt::UserRole, qVariantFromValue(proto_id));
+ proto_ti->setData(0, Qt::UserRole, QVariant::fromValue(proto_id));
proto_list << proto_ti;
}
if ( typesDisplayed.contains(ifType) )
{
QAction *endp_action = new QAction(it.value(), this);
- endp_action->setData(qVariantFromValue(ifType));
+ endp_action->setData(QVariant::fromValue(ifType));
endp_action->setCheckable(true);
endp_action->setChecked(proxyModel.isInterfaceTypeShown(ifType));
connect(endp_action, SIGNAL(triggered()), this, SLOT(triggeredIfTypeButton()));
toolbar->setMovable(false);
toolbar->setVisible(visible);
- action->setData(qVariantFromValue(toolbar));
+ action->setData(QVariant::fromValue(toolbar));
addToolBar(Qt::TopToolBarArea, toolbar);
insertToolBarBreak(toolbar);
shmw_actions[main_ui_->actionViewPacketBytes] = byte_view_tab_;
foreach (QAction *shmwa, shmw_actions.keys()) {
- shmwa->setData(qVariantFromValue(shmw_actions[shmwa]));
+ shmwa->setData(QVariant::fromValue(shmw_actions[shmwa]));
show_hide_actions_->addAction(shmwa);
showHideMainWidgets(shmwa);
}
td_actions[main_ui_->actionViewTimeDisplayFormatUTCTimeOfDay] = TS_UTC;
foreach (QAction* tda, td_actions.keys()) {
- tda->setData(qVariantFromValue(td_actions[tda]));
+ tda->setData(QVariant::fromValue(td_actions[tda]));
time_display_actions_->addAction(tda);
}
tp_actions[main_ui_->actionViewTimeDisplayFormatPrecisionNanoseconds] = TS_PREC_FIXED_NSEC;
foreach (QAction* tpa, tp_actions.keys()) {
- tpa->setData(qVariantFromValue(tp_actions[tpa]));
+ tpa->setData(QVariant::fromValue(tp_actions[tpa]));
time_precision_actions_->addAction(tpa);
}
QStringList columns = headerColumns();
if ( role == Qt::DisplayRole && section < columns.count() )
- return qVariantFromValue(columns[section]);
+ return QVariant::fromValue(columns[section]);
return QVariant();
}
QStringList data = modelData.at(index.row());
if ( index.column() < columnCount() )
- return qVariantFromValue(data.at(index.column()));
+ return QVariant::fromValue(data.at(index.column()));
}
return QVariant();
if ( col == IFTREE_COL_STATS )
{
if ( points.contains(device->name) )
- return qVariantFromValue(points[device->name]);
+ return QVariant::fromValue(points[device->name]);
}
else if ( col == IFTREE_COL_HIDDEN )
{
_max = qMax(min, max);
/* ensure, that the default value is within the new min<->max */
_default = qMin(_max, qMax(_min, _default));
- _defReturn = qVariantFromValue(_default);
+ _defReturn = QVariant::fromValue(_default);
}
void NumericValueChooserDelegate::setDefaultValue(int defValue, QVariant defaultReturn)
{
if ( index.isValid() ) {
QSpinBox * spinBox = qobject_cast<QSpinBox *>(editor);
- model->setData(index, _default == spinBox->value() ? _defReturn : qVariantFromValue(spinBox->value()));
+ model->setData(index, _default == spinBox->value() ? _defReturn : QVariant::fromValue(spinBox->value()));
} else {
QStyledItemDelegate::setModelData(editor, model, index);
}
action = window()->findChild<QAction *>("actionViewShowPacketInNewWindow");
ctx_menu_.addAction(action);
- decode_as_->setData(qVariantFromValue(true));
+ decode_as_->setData(QVariant::fromValue(true));
ctx_column_ = columnAt(event->x());
// Set menu sensitivity for the current column and set action data.
header_actions_[caRemoveColumn] = header_ctx_menu_.addAction(tr("Remove This Column"));
foreach (ColumnActions ca, header_actions_.keys()) {
- header_actions_[ca]->setData(qVariantFromValue(ca));
+ header_actions_[ca]->setData(QVariant::fromValue(ca));
connect(header_actions_[ca], SIGNAL(triggered()), this, SLOT(headerMenuTriggered()));
}
QAction *action = new QAction(get_column_title(i), &header_ctx_menu_);
action->setCheckable(true);
action->setChecked(get_column_visible(i));
- action->setData(qVariantFromValue(i));
+ action->setData(QVariant::fromValue(i));
connect(action, SIGNAL(triggered()), this, SLOT(columnVisibilityTriggered()));
header_ctx_menu_.insertAction(show_hide_separator_, action);
show_hide_actions_ << action;
proto_prefs_menu_.setModule(finfo.moduleName());
- decode_as_->setData(qVariantFromValue(true));
+ decode_as_->setData(QVariant::fromValue(true));
// Set menu sensitivity and action data.
emit fieldSelected(&finfo);
int proto_id = get_conversation_proto_id(ct);
QAction *endp_action = new QAction(title, data->dialog_);
- endp_action->setData(qVariantFromValue(proto_id));
+ endp_action->setData(QVariant::fromValue(proto_id));
endp_action->setCheckable(true);
endp_action->setChecked(data->enabled_protos_.contains(proto_id));
data->dialog_->connect(endp_action, SIGNAL(triggered()), data->dialog_, SLOT(toggleTable()));
static QVariant asQVariant(T* ptr)
{
- return qVariantFromValue((void *) ptr);
+ return QVariant::fromValue((void *) ptr);
}
};
QActionGroup * format_actions = new QActionGroup(this);
action = format_actions->addAction(tr("Show bytes as hexadecimal"));
- action->setData(qVariantFromValue(BYTES_HEX));
+ action->setData(QVariant::fromValue(BYTES_HEX));
action->setCheckable(true);
if (recent.gui_bytes_view == BYTES_HEX) {
action->setChecked(true);
}
action = format_actions->addAction(tr(UTF8_HORIZONTAL_ELLIPSIS "as bits"));
- action->setData(qVariantFromValue(BYTES_BITS));
+ action->setData(QVariant::fromValue(BYTES_BITS));
action->setCheckable(true);
if (recent.gui_bytes_view == BYTES_BITS) {
action->setChecked(true);
QActionGroup * encoding_actions = new QActionGroup(this);
action = encoding_actions->addAction(tr("Show text based on packet"));
- action->setData(qVariantFromValue(BYTES_ENC_FROM_PACKET));
+ action->setData(QVariant::fromValue(BYTES_ENC_FROM_PACKET));
action->setCheckable(true);
if (recent.gui_bytes_encoding == BYTES_ENC_FROM_PACKET) {
action->setChecked(true);
}
action = encoding_actions->addAction(tr(UTF8_HORIZONTAL_ELLIPSIS "as ASCII"));
- action->setData(qVariantFromValue(BYTES_ENC_ASCII));
+ action->setData(QVariant::fromValue(BYTES_ENC_ASCII));
action->setCheckable(true);
if (recent.gui_bytes_encoding == BYTES_ENC_ASCII) {
action->setChecked(true);
}
action = encoding_actions->addAction(tr(UTF8_HORIZONTAL_ELLIPSIS "as EBCDIC"));
- action->setData(qVariantFromValue(BYTES_ENC_EBCDIC));
+ action->setData(QVariant::fromValue(BYTES_ENC_EBCDIC));
action->setCheckable(true);
if (recent.gui_bytes_encoding == BYTES_ENC_EBCDIC) {
action->setChecked(true);
childCounter = 0;
((QWidget *)event->child())->installEventFilter(this);
- event->child()->setProperty(drag_drop_toolbar_action_, qVariantFromValue(childCounter));
+ event->child()->setProperty(drag_drop_toolbar_action_, QVariant::fromValue(childCounter));
childCounter++;
}
}