Utils: Introduce Layouting::{br,st}

... as "standard" ways to define line breaks and simple stretch.

There have already been too many patterns to do it.

Break() and Stretch() still work for the patches in flight, but
they are planned to be removed.

Change-Id: I9b70dcdc11244a904a496b0c55938dfb0b265fc8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2022-07-22 18:54:04 +02:00
parent 80aef9c0ef
commit 14257a24f9
71 changed files with 211 additions and 254 deletions

View File

@@ -65,6 +65,8 @@ public:
Break,
};
using Modifier = std::function<void(QLayout *)>;
class QTCREATOR_UTILS_EXPORT LayoutItem
{
public:
@@ -215,11 +217,15 @@ public:
Form(std::initializer_list<LayoutItem> items) : LayoutBuilder(FormLayout, items) {}
};
using Stretch = LayoutBuilder::Stretch;
using Space = LayoutBuilder::Space;
using Span = LayoutBuilder::Span;
using AlignAsFormLabel = LayoutBuilder::AlignAsFormLabel;
using Break = LayoutBuilder::Break;
}
} // namespace Utils
using Stretch = LayoutBuilder::Stretch; // FIXME: Remove
using Break = LayoutBuilder::Break; // FIXME: Remove
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::Break br;
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::Stretch st;
} // Layouting
} // Utils