forked from qt-creator/qt-creator
ProjectExplorer: Move use of some knowledge from KitAspectWidget to KitAspect
Essentially a follow-up to 09a7d2bd45
.
Change-Id: I4dd9d64eec77ddf9cdccbac808e9a0978b9986bf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -80,7 +80,7 @@ public:
|
||||
{
|
||||
m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy());
|
||||
m_comboBox->setEnabled(false);
|
||||
m_comboBox->setToolTip(toolTip());
|
||||
m_comboBox->setToolTip(ki->description());
|
||||
|
||||
foreach (CMakeTool *tool, CMakeToolManager::cmakeTools())
|
||||
cmakeToolAdded(tool->id());
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
m_label(new QLabel),
|
||||
m_changeButton(new QPushButton)
|
||||
{
|
||||
m_label->setToolTip(toolTip());
|
||||
m_label->setToolTip(ki->description());
|
||||
m_changeButton->setText(tr("Change..."));
|
||||
refresh();
|
||||
connect(m_changeButton, &QPushButton::clicked,
|
||||
|
@@ -67,6 +67,7 @@ public:
|
||||
m_comboBox->setEnabled(true);
|
||||
|
||||
refresh();
|
||||
m_comboBox->setToolTip(ki->description());
|
||||
connect(m_comboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &DebuggerKitAspectWidget::currentDebuggerChanged);
|
||||
|
||||
@@ -96,7 +97,6 @@ private:
|
||||
{
|
||||
m_ignoreChanges = true;
|
||||
m_comboBox->clear();
|
||||
m_comboBox->setToolTip(toolTip());
|
||||
m_comboBox->addItem(tr("None"), QString());
|
||||
for (const DebuggerItem &item : DebuggerItemManager::debuggers())
|
||||
m_comboBox->addItem(item.displayName(), item.id());
|
||||
|
@@ -243,7 +243,7 @@ public:
|
||||
layout->addWidget(new QLabel(ToolChainManager::displayNameOfLanguageId(l) + ':'), row, 0);
|
||||
auto cb = new QComboBox;
|
||||
cb->setSizePolicy(QSizePolicy::Ignored, cb->sizePolicy().verticalPolicy());
|
||||
cb->setToolTip(toolTip());
|
||||
cb->setToolTip(ki->description());
|
||||
|
||||
m_languageComboboxMap.insert(l, cb);
|
||||
layout->addWidget(cb, row, 1);
|
||||
@@ -768,7 +768,7 @@ public:
|
||||
{
|
||||
for (IDeviceFactory *factory : IDeviceFactory::allDeviceFactories())
|
||||
m_comboBox->addItem(factory->displayName(), factory->deviceType().toSetting());
|
||||
m_comboBox->setToolTip(toolTip());
|
||||
m_comboBox->setToolTip(ki->description());
|
||||
refresh();
|
||||
connect(m_comboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &DeviceTypeKitAspectWidget::currentTypeChanged);
|
||||
@@ -893,7 +893,7 @@ public:
|
||||
m_comboBox->setModel(m_model);
|
||||
m_manageButton = new QPushButton(KitAspectWidget::msgManage());
|
||||
refresh();
|
||||
m_comboBox->setToolTip(toolTip());
|
||||
m_comboBox->setToolTip(ki->description());
|
||||
|
||||
connect(m_model, &QAbstractItemModel::modelAboutToBeReset,
|
||||
this, &DeviceKitAspectWidget::modelAboutToReset);
|
||||
|
@@ -127,8 +127,6 @@ public:
|
||||
KitAspectWidget(Kit *kit, const KitAspect *ki);
|
||||
|
||||
Core::Id kitInformationId() const;
|
||||
QString displayName() const { return m_kitInformation->displayName(); }
|
||||
QString toolTip() const { return m_kitInformation->description(); }
|
||||
|
||||
virtual void makeReadOnly() = 0;
|
||||
virtual void refresh() = 0;
|
||||
|
@@ -218,8 +218,8 @@ void KitManagerConfigWidget::addAspectToWorkingCopy(KitAspect *aspect)
|
||||
QTC_ASSERT(widget, return);
|
||||
QTC_ASSERT(!m_widgets.contains(widget), return);
|
||||
|
||||
const QString name = widget->displayName() + ':';
|
||||
QString toolTip = widget->toolTip();
|
||||
const QString name = aspect->displayName() + ':';
|
||||
QString toolTip = aspect->description();
|
||||
|
||||
auto action = new QAction(tr("Mark as Mutable"), nullptr);
|
||||
action->setCheckable(true);
|
||||
|
@@ -593,7 +593,7 @@ void KitAreaWidget::setKit(Kit *k)
|
||||
if (k && k->isMutable(ki->id())) {
|
||||
KitAspectWidget *widget = ki->createConfigWidget(k);
|
||||
m_widgets << widget;
|
||||
QLabel *label = new QLabel(widget->displayName());
|
||||
QLabel *label = new QLabel(ki->displayName());
|
||||
m_labels << label;
|
||||
|
||||
widget->setStyle(QStyleFactory::create(QLatin1String("fusion")));
|
||||
|
@@ -53,7 +53,7 @@ public:
|
||||
: KitAspectWidget(k, ki), m_lineEdit(new QLineEdit)
|
||||
{
|
||||
refresh(); // set up everything according to kit
|
||||
m_lineEdit->setToolTip(toolTip());
|
||||
m_lineEdit->setToolTip(ki->description());
|
||||
connect(m_lineEdit, &QLineEdit::textEdited, this, &QmakeKitAspectWidget::mkspecWasChanged);
|
||||
}
|
||||
|
||||
|
@@ -64,7 +64,7 @@ public:
|
||||
m_manageButton = new QPushButton(KitAspectWidget::msgManage());
|
||||
|
||||
refresh();
|
||||
m_combo->setToolTip(toolTip());
|
||||
m_combo->setToolTip(ki->description());
|
||||
|
||||
connect(m_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &QtKitAspectWidget::currentWasChanged);
|
||||
|
Reference in New Issue
Block a user