forked from qt-creator/qt-creator
Device support: Use double click to select device
Change-Id: I270da814f3278100e8bc1f90cc1c244cde08ada5 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
committed by
Christian Kandeler
parent
4d3c58dee5
commit
a6f3ec03f2
@@ -62,6 +62,8 @@ DeviceFactorySelectionDialog::DeviceFactorySelectionDialog(QWidget *parent) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
connect(ui->listWidget, SIGNAL(itemSelectionChanged()), SLOT(handleItemSelectionChanged()));
|
connect(ui->listWidget, SIGNAL(itemSelectionChanged()), SLOT(handleItemSelectionChanged()));
|
||||||
|
connect(ui->listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
|
||||||
|
SLOT(handleItemDoubleClicked()));
|
||||||
handleItemSelectionChanged();
|
handleItemSelectionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,6 +78,11 @@ void DeviceFactorySelectionDialog::handleItemSelectionChanged()
|
|||||||
->setEnabled(!ui->listWidget->selectedItems().isEmpty());
|
->setEnabled(!ui->listWidget->selectedItems().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceFactorySelectionDialog::handleItemDoubleClicked()
|
||||||
|
{
|
||||||
|
accept();
|
||||||
|
}
|
||||||
|
|
||||||
Core::Id DeviceFactorySelectionDialog::selectedId() const
|
Core::Id DeviceFactorySelectionDialog::selectedId() const
|
||||||
{
|
{
|
||||||
QList<QListWidgetItem *> selected = ui->listWidget->selectedItems();
|
QList<QListWidgetItem *> selected = ui->listWidget->selectedItems();
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/id.h>
|
#include <coreplugin/id.h>
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -55,7 +54,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Q_SLOT void handleItemSelectionChanged();
|
Q_SLOT void handleItemSelectionChanged();
|
||||||
|
Q_SLOT void handleItemDoubleClicked();
|
||||||
Ui::DeviceFactorySelectionDialog *ui;
|
Ui::DeviceFactorySelectionDialog *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user