tdf#130857 qt weld: Add initial dummy SizeGroup implementation

Introduce QtInstanceSizeGroup as the Qt-based
weld::SizeGroup implementation.

Initially, this is doesn't actually implement the
logic to keep widgets that are added at the same
size, but emits warnings when its methods are
called.

Change-Id: I26dcab92a13ca4a4907c06d5834d98d566246920
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203995
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This commit is contained in:
Michael Weghorn
2026-04-21 10:25:52 +02:00
parent 8ac9964792
commit 1959e62ea3
9 changed files with 87 additions and 3 deletions
+1
View File
@@ -51,6 +51,7 @@ $(call gb_CustomTarget_get_target,vcl/qt5) : \
$(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceScale.moc \
$(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceScrollbar.moc \
$(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceScrolledWindow.moc \
$(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceSizeGroup.moc \
$(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceSpinButton.moc \
$(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceSpinner.moc \
$(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceTextView.moc \
+1
View File
@@ -51,6 +51,7 @@ $(call gb_CustomTarget_get_target,vcl/qt6) : \
$(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceScale.moc \
$(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceScrollbar.moc \
$(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceScrolledWindow.moc \
$(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceSizeGroup.moc \
$(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceSpinButton.moc \
$(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceSpinner.moc \
$(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceTextView.moc \
+1
View File
@@ -133,6 +133,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
vcl/qt5/QtInstanceScale \
vcl/qt5/QtInstanceScrollbar \
vcl/qt5/QtInstanceScrolledWindow \
vcl/qt5/QtInstanceSizeGroup \
vcl/qt5/QtInstanceSpinButton \
vcl/qt5/QtInstanceSpinner \
vcl/qt5/QtInstanceTextView \
+1
View File
@@ -133,6 +133,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt6,\
vcl/qt6/QtInstanceScale \
vcl/qt6/QtInstanceScrollbar \
vcl/qt6/QtInstanceScrolledWindow \
vcl/qt6/QtInstanceSizeGroup \
vcl/qt6/QtInstanceSpinButton \
vcl/qt6/QtInstanceSpinner \
vcl/qt6/QtInstanceTextView \
+28
View File
@@ -0,0 +1,28 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <sal/config.h>
#include <vcl/weld/SizeGroup.hxx>
#include <QtCore/QObject>
class QtInstanceSizeGroup : public QObject, public virtual weld::SizeGroup
{
Q_OBJECT
public:
QtInstanceSizeGroup(VclSizeGroupMode eMode);
virtual void add_widget(weld::Widget* pWidget) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
+12
View File
@@ -0,0 +1,12 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "../qt5/QtInstanceSizeGroup.hxx"
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
+3 -3
View File
@@ -39,6 +39,7 @@
#include <QtInstanceScale.hxx>
#include <QtInstanceScrollbar.hxx>
#include <QtInstanceScrolledWindow.hxx>
#include <QtInstanceSizeGroup.hxx>
#include <QtInstanceSpinButton.hxx>
#include <QtInstanceSpinner.hxx>
#include <QtInstanceTextView.hxx>
@@ -962,10 +963,9 @@ std::unique_ptr<weld::Scrollbar> QtInstanceBuilder::weld_scrollbar(const OUStrin
return xRet;
}
std::unique_ptr<weld::SizeGroup> QtInstanceBuilder::create_size_group(VclSizeGroupMode)
std::unique_ptr<weld::SizeGroup> QtInstanceBuilder::create_size_group(VclSizeGroupMode eMode)
{
assert(false && "Not implemented yet");
return nullptr;
return std::make_unique<QtInstanceSizeGroup>(eMode);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
+28
View File
@@ -0,0 +1,28 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sal/config.h>
#include <QtInstanceSizeGroup.hxx>
#include <QtInstanceSizeGroup.moc>
#include <sal/log.hxx>
QtInstanceSizeGroup::QtInstanceSizeGroup(VclSizeGroupMode eMode)
{
if (eMode != VclSizeGroupMode::NONE)
SAL_WARN("vcl.qt", "QtInstanceSizeGroup logic not implemented yet");
}
void QtInstanceSizeGroup::add_widget(weld::Widget*)
{
SAL_WARN("vcl.qt", "QtInstanceSizeGroup logic not implemented yet");
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
+12
View File
@@ -0,0 +1,12 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "../qt5/QtInstanceSizeGroup.cxx"
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */