diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index 8c568bb91f..bc7b94d357 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -350,6 +350,7 @@ type function insertTab(index: Integer; page: QWidgetH; p2: PWideString): Integer; procedure SetTabPosition(ATabPosition: QTabWidgetTabPosition); procedure SignalCurrentChanged(Index: Integer); cdecl; + procedure setTabText(index: Integer; p2: PWideString); end; { TQtComboBox } @@ -3333,6 +3334,11 @@ begin end; end; +procedure TQtTabWidget.setTabText(index: Integer; p2: PWideString); +begin + QTabWidget_setTabText(QTabWidgetH(Widget), index, p2); +end; + { TQtComboBox } diff --git a/lcl/interfaces/qt/qtwsextctrls.pp b/lcl/interfaces/qt/qtwsextctrls.pp index e1676d99ed..75627fab6e 100644 --- a/lcl/interfaces/qt/qtwsextctrls.pp +++ b/lcl/interfaces/qt/qtwsextctrls.pp @@ -344,10 +344,21 @@ begin AWinControl.Handle := 0; end; -class procedure TQtWSCustomPage.SetText(const AWinControl: TWinControl; - const AText: string); +class procedure TQtWSCustomPage.SetText(const AWinControl: TWinControl; const AText: string); +var + ANoteBook: TCustomNoteBook; + Index: Integer; + AWsText: WideString; begin - inherited SetText(AWinControl, AText); + if (AWinControl is TCustomPage) and + (AWinControl.Parent <> nil) and + (AWinControl.Parent is TCustomNotebook) then + begin + ANoteBook := TCustomNotebook(AWinControl.Parent); + Index := ANoteBook.IndexOf(TCustomPage(AWinControl)); + AWsText := UTF8Decode(AText); + TQtTabWidget(ANoteBook.Handle).setTabText(Index, @AWsText); + end; end; { TQtWSCustomNotebook }