forked from qt-creator/qt-creator
Fix QMetaType::type() related deprecation warnings
Not in sdktool, which still builds with Qt 5.15 Change-Id: I6e6f4331127b821e471e2840e7959cd65e6419e9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -118,25 +118,25 @@ bool BuidOptionsModel::hasChanges() const
|
||||
|
||||
QWidget *BuildOptionDelegate::makeWidget(QWidget *parent, const QVariant &data)
|
||||
{
|
||||
auto type = data.userType();
|
||||
const int type = data.typeId();
|
||||
switch (type) {
|
||||
case QVariant::Int: {
|
||||
case QMetaType::Int: {
|
||||
auto w = new QSpinBox{parent};
|
||||
w->setValue(data.toInt());
|
||||
return w;
|
||||
}
|
||||
case QVariant::Bool: {
|
||||
case QMetaType::Bool: {
|
||||
auto w = new QComboBox{parent};
|
||||
w->addItems({"false", "true"});
|
||||
w->setCurrentIndex(data.toBool());
|
||||
return w;
|
||||
}
|
||||
case QVariant::StringList: {
|
||||
case QMetaType::QStringList: {
|
||||
auto w = new ArrayOptionLineEdit{parent};
|
||||
w->setPlainText(data.toStringList().join(" "));
|
||||
return w;
|
||||
}
|
||||
case QVariant::String: {
|
||||
case QMetaType::QString: {
|
||||
auto w = new QLineEdit{parent};
|
||||
w->setText(data.toString());
|
||||
return w;
|
||||
|
||||
Reference in New Issue
Block a user