diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index dc63160b5f..5c30b76b89 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -648,6 +648,7 @@ type public procedure AttachEvents; override; procedure DetachEvents; override; + function GetTabRect(const AIndex: integer): TRect; procedure SignalTabBarCurrentChanged(Index: Integer); cdecl; function SlotTabBarMouse(Sender: QObjectH; Event: QEventH): Boolean; cdecl; function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override; @@ -5628,6 +5629,11 @@ begin inherited DetachEvents; end; +function TQtTabBar.GetTabRect(const AIndex: integer): TRect; +begin + QTabBar_tabRect(QTabBarH(Widget), @Result, AIndex); +end; + procedure TQtTabBar.SignalTabBarCurrentChanged(Index: Integer); cdecl; var Msg: TLMNotify; diff --git a/lcl/interfaces/qt/qtwsextctrls.pp b/lcl/interfaces/qt/qtwsextctrls.pp index e93e44236e..937728ad7d 100644 --- a/lcl/interfaces/qt/qtwsextctrls.pp +++ b/lcl/interfaces/qt/qtwsextctrls.pp @@ -67,6 +67,7 @@ type class function GetCapabilities: TNoteBookCapabilities; override; class function GetDesignInteractive(const AWinControl: TWinControl; AClientPos: TPoint): Boolean; override; class function GetTabIndexAtPos(const ANotebook: TCustomNotebook; const AClientPos: TPoint): integer; override; + class function GetTabRect(const ANotebook: TCustomNotebook; const AIndex: Integer): TRect; override; class procedure SetPageIndex(const ANotebook: TCustomNotebook; const AIndex: integer); override; class procedure SetTabCaption(const ANotebook: TCustomNotebook; const AChild: TCustomPage; const AText: string); override; class procedure SetTabPosition(const ANotebook: TCustomNotebook; const ATabPosition: TTabPosition); override; @@ -380,6 +381,19 @@ begin Result := TabWidget.tabAt(AClientPos); end; +class function TQtWSCustomNotebook.GetTabRect(const ANotebook: TCustomNotebook; + const AIndex: Integer): TRect; +var + TabWidget: TQtTabWidget; + R: TRect; +begin + Result := Rect(-1, -1, -1, -1); + if not WSCheckHandleAllocated(ANotebook, 'GetTabRect') then + Exit; + TabWidget := TQtTabWidget(ANotebook.Handle); + Result := TabWidget.TabBar.GetTabRect(AIndex); +end; + class procedure TQtWSCustomNotebook.SetPageIndex( const ANotebook: TCustomNotebook; const AIndex: integer); var