Commit 34dad7e3 authored by Vikas Pachdha's avatar Vikas Pachdha

iOS: Enable sorting for simulator listing

Task-number: QTCREATORBUG-18512
Change-Id: I4713165f131894bd9b881d8de25ff1e8a1a39e51
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent a78fd025
......@@ -38,6 +38,7 @@
#include <QInputDialog>
#include <QMessageBox>
#include <QPointer>
#include <QSortFilterProxyModel>
static const int simStartWarnCount = 4;
......@@ -64,11 +65,12 @@ static void onSimOperation(const SimulatorInfo &simInfo, SimulatorOperationDialo
IosSettingsWidget::IosSettingsWidget(QWidget *parent)
: QWidget(parent),
m_ui(new Ui::IosSettingsWidget),
m_simControl(new SimulatorControl(this)),
m_simInfoModel( new SimulatorInfoModel(this))
m_simControl(new SimulatorControl(this))
{
m_ui->setupUi(this);
m_ui->deviceView->setModel(m_simInfoModel);
auto proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel(new SimulatorInfoModel(this));
m_ui->deviceView->setModel(proxyModel);
m_ui->deviceView->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
m_ui->pathWidget->setExpectedKind(Utils::PathChooser::ExistingDirectory);
m_ui->pathWidget->lineEdit()->setReadOnly(true);
......
......@@ -59,7 +59,6 @@ private:
Ui::IosSettingsWidget *m_ui = nullptr;
bool m_saveSettingsRequested = false;
SimulatorControl *m_simControl = nullptr;
SimulatorInfoModel *m_simInfoModel = nullptr;
};
} // namespace Internal
......
......@@ -47,6 +47,9 @@
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="1">
<widget class="QPushButton" name="renameButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Rename a simulator device.</string>
</property>
......@@ -57,6 +60,9 @@
</item>
<item row="5" column="1">
<widget class="QPushButton" name="deleteButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -86,6 +92,9 @@
</item>
<item row="4" column="1">
<widget class="QPushButton" name="resetButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -114,6 +123,9 @@
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="1">
......@@ -178,6 +190,9 @@
</item>
<item row="2" column="1">
<widget class="QPushButton" name="startButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment