forked from qt-creator/qt-creator
Utils: Add a 'tight' layout modifier
Combine contentsMargin(0, 0, 0, 0) and spacing(0) for finger painting convenience. Change-Id: I6928560a8888df692aa64724098512f4101d6adb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -1091,6 +1091,12 @@ void addToLayout(Layout *layout, const Stretch &inner)
|
|||||||
lt->addStretch(inner.stretch);
|
lt->addStretch(inner.stretch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tight(Layout *layout)
|
||||||
|
{
|
||||||
|
layout->setNoMargins();
|
||||||
|
layout->setSpacing(0);
|
||||||
|
}
|
||||||
|
|
||||||
// void createItem(LayoutItem *item, QWidget *t)
|
// void createItem(LayoutItem *item, QWidget *t)
|
||||||
// {
|
// {
|
||||||
// if (auto l = qobject_cast<QLabel *>(t))
|
// if (auto l = qobject_cast<QLabel *>(t))
|
||||||
|
@@ -527,6 +527,7 @@ QTCREATOR_UTILS_EXPORT void noMargin(Layout *);
|
|||||||
QTCREATOR_UTILS_EXPORT void normalMargin(Layout *);
|
QTCREATOR_UTILS_EXPORT void normalMargin(Layout *);
|
||||||
QTCREATOR_UTILS_EXPORT void withFormAlignment(Layout *);
|
QTCREATOR_UTILS_EXPORT void withFormAlignment(Layout *);
|
||||||
QTCREATOR_UTILS_EXPORT void hr(Layout *);
|
QTCREATOR_UTILS_EXPORT void hr(Layout *);
|
||||||
|
QTCREATOR_UTILS_EXPORT void tight(Layout *); // noMargin + spacing(0)
|
||||||
|
|
||||||
QTCREATOR_UTILS_EXPORT LayoutModifier spacing(int space);
|
QTCREATOR_UTILS_EXPORT LayoutModifier spacing(int space);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user