forked from qt-creator/qt-creator
Revert "Utils: Remove the text option for LayoutItem"
This reverts commit 5154e1eb02
.
For some yet unknown reason, this renders the whole sublayout read-only.
Change-Id: Ide1587382392a57643bed1b3cdd7d8987dbdab57
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QLabel>
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
@@ -97,12 +96,7 @@ LayoutBuilder::LayoutItem::LayoutItem(BaseAspect *aspect)
|
|||||||
/*!
|
/*!
|
||||||
Constructs a layout item containing some static \a text.
|
Constructs a layout item containing some static \a text.
|
||||||
*/
|
*/
|
||||||
LayoutBuilder::LayoutItem::LayoutItem(const QString &text)
|
LayoutBuilder::LayoutItem::LayoutItem(const QString &text) : text(text) {}
|
||||||
{
|
|
||||||
auto label = new QLabel(text);
|
|
||||||
label->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
|
||||||
widget = label;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Utils::LayoutBuilder
|
\class Utils::LayoutBuilder
|
||||||
@@ -241,7 +235,10 @@ void LayoutBuilder::flushPendingFormItems()
|
|||||||
else if (auto widget = m_pendingFormItems.at(1).widget)
|
else if (auto widget = m_pendingFormItems.at(1).widget)
|
||||||
m_formLayout->addRow(label, widget);
|
m_formLayout->addRow(label, widget);
|
||||||
} else {
|
} else {
|
||||||
QTC_CHECK(false);
|
if (auto layout = m_pendingFormItems.at(1).layout)
|
||||||
|
m_formLayout->addRow(m_pendingFormItems.at(0).text, layout);
|
||||||
|
else if (auto widget = m_pendingFormItems.at(1).widget)
|
||||||
|
m_formLayout->addRow(m_pendingFormItems.at(0).text, widget);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QTC_CHECK(false);
|
QTC_CHECK(false);
|
||||||
|
@@ -62,6 +62,7 @@ public:
|
|||||||
QLayout *layout = nullptr;
|
QLayout *layout = nullptr;
|
||||||
QWidget *widget = nullptr;
|
QWidget *widget = nullptr;
|
||||||
BaseAspect *aspect = nullptr;
|
BaseAspect *aspect = nullptr;
|
||||||
|
QString text;
|
||||||
int span = 1;
|
int span = 1;
|
||||||
Qt::Alignment align;
|
Qt::Alignment align;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user