iOS: Enable sorting for simulator listing

Task-number: QTCREATORBUG-18512
Change-Id: I4713165f131894bd9b881d8de25ff1e8a1a39e51
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Vikas Pachdha
2017-07-06 13:20:18 +02:00
parent a78fd02574
commit 34dad7e3a3
3 changed files with 20 additions and 4 deletions

View File

@@ -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);

View File

@@ -59,7 +59,6 @@ private:
Ui::IosSettingsWidget *m_ui = nullptr;
bool m_saveSettingsRequested = false;
SimulatorControl *m_simControl = nullptr;
SimulatorInfoModel *m_simInfoModel = nullptr;
};
} // namespace Internal

View File

@@ -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>