Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Menu
Projects
Groups
Snippets
Sign up now
Login
Sign in / Register
Toggle navigation
Menu
Open sidebar
FPC
Lazarus
Lazarus
Commits
23b41701
Commit
23b41701
authored
Apr 10, 2015
by
Željan Rikalo
🏊🏼
Browse files
Qt: fixed TPageControl ignores nboKeyboardTabSwitch. issue
#22853
git-svn-id: trunk@48696 -
parent
b4fcc4f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
lcl/interfaces/qt/qtpagecontrol.inc
View file @
23b41701
...
...
@@ -503,5 +503,6 @@ end;
class
procedure
TQtWSCustomTabControl
.
UpdateProperties
(
const
ATabControl
:
TCustomTabControl
);
begin
TQtTabWidget
(
ATabControl
.
Handle
)
.
setTabsClosable
(
nboShowCloseButtons
in
ATabControl
.
Options
);
TQtTabWidget
(
ATabControl
.
Handle
)
.
SwitchTabsByKeyboard
:=
nboKeyboardTabSwitch
in
ATabControl
.
Options
;
end
;
lcl/interfaces/qt/qtwidgets.pas
View file @
23b41701
...
...
@@ -932,6 +932,7 @@ type
FCurrentChangedHook: QTabWidget_hookH;
FCloseRequestedHook: QTabWidget_hookH;
FStackedWidgetHook: QObject_hookH;
FSwitchTabsByKeyboard: boolean;
FTabBar: TQtTabBar;
FStackWidget: QWidgetH;
function getShowTabs: Boolean;
...
...
@@ -970,6 +971,7 @@ type
property ShowTabs: Boolean read getShowTabs write setShowTabs;
property TabBar: TQtTabBar read getTabBar;
property StackWidget: QWidgetH read getStackWidget;
property SwitchTabsByKeyboard: boolean read FSwitchTabsByKeyboard write FSwitchTabsByKeyboard;
end;
{ TQtComboBox }
...
...
@@ -9664,6 +9666,14 @@ begin
end;
function TQtTabBar.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
function StopShortcutEvent: boolean;
begin
Result := Assigned(FOwner) and (FOwner.ChildOfComplexWidget <> ccwTTabControl) and
not TQtTabWidget(FOwner).FSwitchTabsByKeyboard and (QKeyEvent_matches(QKeyEventH(Event), QKeySequenceNextChild) or
QKeyEvent_matches(QKeyEventH(Event), QKeySequencePreviousChild));
end;
{$IFDEF QT_ENABLE_LCL_PAINT_TABS}
var
R: TRect;
...
...
@@ -9694,6 +9704,7 @@ begin
QEvent_ignore(Event);
end;
{$ENDIF}
QEventShortcutOverride: Result := StopShortcutEvent;
QEventKeyPress,
QEventKeyRelease:
begin
...
...
@@ -9703,6 +9714,8 @@ begin
if (LCLObject = nil) or
((LCLObject <> nil) and not LCLObject.HandleAllocated) then
Result := True;
if not Result then
Result := StopShortcutEvent;
end;
QEventMouseButtonPress,
QEventMouseButtonRelease,
...
...
@@ -9796,6 +9809,7 @@ begin
{$ifdef VerboseQt}
WriteLn('TQtTabWidget.Create');
{$endif}
FSwitchTabsByKeyboard := False; {shortcuts are enabled by default under qt, but not under LCL}
FWidgetNeedFontColorInitialization := True;
if AParams.WndParent <> 0 then
Parent := TQtWidget(AParams.WndParent).GetContainerWidget
...
...
FPC Admin account
@fpc_admin
mentioned in issue
#22853 (closed)
·
Jul 28, 2021
mentioned in issue
#22853 (closed)
mentioned in issue #22853
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment