From 40d96c7e7907c7e6a9261cd9ac6b12d810740b4c Mon Sep 17 00:00:00 2001 From: zeljko Date: Tue, 10 Feb 2015 12:09:10 +0000 Subject: [PATCH] Qt: improved TQtGroupBox, added ability to show/hide checkbox in title of TQtGroupBox, needed by 3rd party components. git-svn-id: trunk@47673 - --- lcl/interfaces/qt/qtwidgets.pas | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index 3e3ab6941e..d69599ec46 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -739,6 +739,10 @@ type private FGroupBoxType: TQtGroupBoxType; FCWEventHook: QObject_hookH; + function GetCheckBoxState: boolean; + function GetCheckBoxVisible: boolean; + procedure SetCheckBoxState(AValue: boolean); + procedure SetCheckBoxVisible(AValue: boolean); procedure setLayoutThemeMargins(ALayout: QLayoutH; AWidget: QWidgetH); protected function CreateWidget(const AParams: TCreateParams):QWidgetH; override; @@ -754,6 +758,8 @@ type procedure setText(const W: WideString); override; procedure setFocusPolicy(const APolicy: QtFocusPolicy); override; property GroupBoxType: TQtGroupBoxType read FGroupBoxType write FGroupBoxType; + property CheckBoxState: boolean read GetCheckBoxState write SetCheckBoxState; + property CheckBoxVisible: boolean read GetCheckBoxVisible write SetCheckBoxVisible; end; { TQtToolBar } @@ -7614,6 +7620,27 @@ begin end; end; +function TQtGroupBox.GetCheckBoxVisible: boolean; +begin + Result := QGroupBox_isCheckable(QGroupBoxH(Widget)); +end; + +function TQtGroupBox.GetCheckBoxState: boolean; +begin + Result := CheckBoxVisible and QGroupBox_isChecked(QGroupBoxH(Widget)); +end; + +procedure TQtGroupBox.SetCheckBoxState(AValue: boolean); +begin + if CheckBoxVisible then + QGroupBox_setChecked(QGroupBoxH(Widget), AValue); +end; + +procedure TQtGroupBox.SetCheckBoxVisible(AValue: boolean); +begin + QGroupBox_setCheckable(QGroupBoxH(Widget), AValue); +end; + function TQtGroupBox.CreateWidget(const AParams: TCreateParams): QWidgetH; var Layout: QBoxLayoutH;