QtSupport: Visually merge QtKitAspect and QmakeKitAspect

Change-Id: I000dba4726e26ddfd4df210d514200e8adacd989
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2024-11-18 15:05:07 +01:00
parent 4bddce64f5
commit 96bb9964fb
2 changed files with 25 additions and 0 deletions

View File

@@ -35,6 +35,9 @@ public:
{ {
refresh(); // set up everything according to kit refresh(); // set up everything according to kit
m_lineEdit->setToolTip(ki->description()); m_lineEdit->setToolTip(ki->description());
QSizePolicy p = m_lineEdit->sizePolicy();
p.setHorizontalStretch(1);
m_lineEdit->setSizePolicy(p);
connect(m_lineEdit, &QLineEdit::textEdited, this, &QmakeKitAspectImpl::mkspecWasChanged); connect(m_lineEdit, &QLineEdit::textEdited, this, &QmakeKitAspectImpl::mkspecWasChanged);
} }

View File

@@ -19,6 +19,8 @@
#include <projectexplorer/toolchain.h> #include <projectexplorer/toolchain.h>
#include <projectexplorer/toolchainmanager.h> #include <projectexplorer/toolchainmanager.h>
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/buildablehelperlibrary.h> #include <utils/buildablehelperlibrary.h>
#include <utils/guard.h> #include <utils/guard.h>
@@ -26,6 +28,8 @@
#include <utils/macroexpander.h> #include <utils/macroexpander.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QHBoxLayout>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
@@ -78,6 +82,23 @@ public:
refresh(); refresh();
}); });
} }
private:
void addToInnerLayout(Layouting::Layout &parentItem) override
{
if (const QList<KitAspect *> embedded = aspectsToEmbed(); !embedded.isEmpty()) {
Layouting::Layout layout(new QHBoxLayout);
KitAspect::addToInnerLayout(layout);
QSizePolicy p = comboBoxes().first()->sizePolicy();
p.setHorizontalStretch(2);
comboBoxes().first()->setSizePolicy(p);
layout.addItem(Tr::tr("Mkspec:"));
embedded.first()->addToInnerLayout(layout);
parentItem.addItem(layout);
} else {
KitAspect::addToInnerLayout(parentItem);
}
}
}; };
} // namespace Internal } // namespace Internal
@@ -123,6 +144,7 @@ QtKitAspectFactory::QtKitAspectFactory()
"A Qt version is required for qmake-based projects " "A Qt version is required for qmake-based projects "
"and optional when using other build systems.")); "and optional when using other build systems."));
setPriority(26000); setPriority(26000);
setEmbeddableAspects({QmakeProjectManager::Constants::KIT_INFORMATION_ID});
} }
void QtKitAspectFactory::setup(Kit *k) void QtKitAspectFactory::setup(Kit *k)