diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-10-02 17:36:21 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-10-02 22:11:19 +0200 |
commit | cc7f535f1615f65ce276eb9e9d27b8a6b11aaa3a (patch) | |
tree | ec063a8c72dcc55337fe9aefad9b04995c6a4655 /vcl/inc/qt5/QtInstanceCheckButton.hxx | |
parent | 9dd1c9f9df5b0a60ee9fbe8d7db79561ac3eca0c (diff) |
tdf#130857 qt weld: Add QtInstanceCheckButton
Add a QtInstanceCheckButton as the native Qt
implementation for a weld::CheckButton.
This uses a QCheckBox.
Handle the "GtkCheckButton" object type from .ui
files in QtBuilder.
This will e.g. be needed for the "Insert" -> "Axes..."
dialog seen in Calc after a chart has been inserted
and double-clicked -- once further
remaining aspects needed to be able to support that dialog
has been implemented and it will be enabled
in QtInstanceBuilder::IsUIFileSupported.
The handling for the "inconsistent" state
is mostly based on the the VCL implementation,
see SalInstanceCheckButton::set_inconsistent etc.
QtInstanceCheckButton::QtInstanceCheckButton::set_label_wrap
remains unimplemented for now and triggers an assert,
can be implemented when adding support for a dialog
that actually makes use of it.
Change-Id: I1e43ba25a23312534ee7cc0e650cd6e7aae20000
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174398
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/inc/qt5/QtInstanceCheckButton.hxx')
-rw-r--r-- | vcl/inc/qt5/QtInstanceCheckButton.hxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/vcl/inc/qt5/QtInstanceCheckButton.hxx b/vcl/inc/qt5/QtInstanceCheckButton.hxx new file mode 100644 index 000000000000..f6dbe2ee662a --- /dev/null +++ b/vcl/inc/qt5/QtInstanceCheckButton.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 "QtInstanceWidget.hxx" + +#include <QtCore/QObject> +#include <QtWidgets/QCheckBox> + +class QtInstanceCheckButton : public QtInstanceWidget, public virtual weld::CheckButton +{ + QCheckBox* m_pCheckBox; + +public: + QtInstanceCheckButton(QCheckBox* pCheckBox); + + // weld::Toggleable methods + virtual void set_active(bool bActive) override; + virtual bool get_active() const override; + virtual void set_inconsistent(bool bInconsistent) override; + virtual bool get_inconsistent() const override; + + // weld::CheckButton methods + virtual void set_label(const OUString& rText) override; + virtual OUString get_label() const override; + virtual void set_label_wrap(bool bWrap) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |