From 7d042a0d370f229cb6458140a4536199281fc76a Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 14 Jul 2023 15:37:27 +0800 Subject: [PATCH] Doc: explain how to create a QToolBar Surprisingly, this wasn't mentioned in the detailed description at all. Users would need to click on the link for the example in the "See also" section and then read through it to find any mention of how tool bars are created. Change-Id: I9db23b475009072f34defab38b6d6200a45f2f35 Reviewed-by: Volker Hilsheimer (cherry picked from commit 14d10c632bad3346d404271535e6225d226afaa5) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/widgets/qtoolbar.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index ff656e58918..c2def3c6d4e 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -389,6 +389,10 @@ void QToolBarPrivate::plug(const QRect &r) \ingroup mainwindow-classes \inmodule QtWidgets + A toolbar is typically created by calling + \l QMainWindow::addToolBar(const QString &title), but it can also + be added as the first widget in a QVBoxLayout, for example. + Toolbar buttons are added by adding \e actions, using addAction() or insertAction(). Groups of buttons can be separated using addSeparator() or insertSeparator(). If a toolbar button is not