forked from qt-creator/qt-creator
DeviceProcessDialog: Use Utils::TreeView
Should not change any behavior. Change-Id: Ibe3ac32aea4c25f8752c83dd711eceb1ccd19f23 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
#include <projectexplorer/kitinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
|
|
||||||
#include <utils/fancylineedit.h>
|
#include <utils/fancylineedit.h>
|
||||||
|
#include <utils/itemviews.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
@@ -44,7 +45,6 @@
|
|||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QTextBrowser>
|
#include <QTextBrowser>
|
||||||
#include <QTreeView>
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -113,7 +113,7 @@ public:
|
|||||||
QLabel *kitLabel;
|
QLabel *kitLabel;
|
||||||
KitChooser *kitChooser;
|
KitChooser *kitChooser;
|
||||||
|
|
||||||
QTreeView *procView;
|
Utils::TreeView *procView;
|
||||||
QTextBrowser *errorText;
|
QTextBrowser *errorText;
|
||||||
FancyLineEdit *processFilterLineEdit;
|
FancyLineEdit *processFilterLineEdit;
|
||||||
QPushButton *updateListButton;
|
QPushButton *updateListButton;
|
||||||
@@ -143,7 +143,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(KitChooser *chooser,
|
|||||||
|
|
||||||
kitChooser->populate();
|
kitChooser->populate();
|
||||||
|
|
||||||
procView = new QTreeView(q);
|
procView = new Utils::TreeView(q);
|
||||||
procView->setModel(&proxyModel);
|
procView->setModel(&proxyModel);
|
||||||
procView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
procView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
procView->setSelectionMode(QAbstractItemView::SingleSelection);
|
procView->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
@@ -154,6 +154,7 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(KitChooser *chooser,
|
|||||||
procView->header()->setDefaultSectionSize(100);
|
procView->header()->setDefaultSectionSize(100);
|
||||||
procView->header()->setStretchLastSection(true);
|
procView->header()->setStretchLastSection(true);
|
||||||
procView->sortByColumn(1, Qt::AscendingOrder);
|
procView->sortByColumn(1, Qt::AscendingOrder);
|
||||||
|
procView->setActivationMode(Utils::DoubleClickActivation);
|
||||||
|
|
||||||
errorText = new QTextBrowser(q);
|
errorText = new QTextBrowser(q);
|
||||||
|
|
||||||
@@ -331,8 +332,8 @@ void DeviceProcessesDialog::addAcceptButton(const QString &label)
|
|||||||
{
|
{
|
||||||
d->acceptButton = new QPushButton(label);
|
d->acceptButton = new QPushButton(label);
|
||||||
d->buttonBox->addButton(d->acceptButton, QDialogButtonBox::AcceptRole);
|
d->buttonBox->addButton(d->acceptButton, QDialogButtonBox::AcceptRole);
|
||||||
connect(d->procView, SIGNAL(doubleClicked(QModelIndex)),
|
connect(d->procView, SIGNAL(activated(QModelIndex)),
|
||||||
d->acceptButton, SLOT(animateClick()));
|
d->acceptButton, SLOT(click()));
|
||||||
d->buttonBox->addButton(QDialogButtonBox::Cancel);
|
d->buttonBox->addButton(QDialogButtonBox::Cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user