mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 18:30:44 +02:00
Qt: creation of QMainWindow class could fail in case when splash screen is shown before Application.MainForm is created, so we never have MainForm=True (eg. lazarus on win32 - triggers sometimes).Returned checking of QKeySequence_isEmpty() for global actions.
git-svn-id: trunk@29545 -
This commit is contained in:
parent
0080ce812a
commit
8308cf24d5
@ -4698,7 +4698,6 @@ end;
|
|||||||
|
|
||||||
function TQtMainWindow.CreateWidget(const AParams: TCreateParams): QWidgetH;
|
function TQtMainWindow.CreateWidget(const AParams: TCreateParams): QWidgetH;
|
||||||
var
|
var
|
||||||
w: QWidgetH;
|
|
||||||
p: QPaletteH;
|
p: QPaletteH;
|
||||||
begin
|
begin
|
||||||
// Creates the widget
|
// Creates the widget
|
||||||
@ -4713,14 +4712,11 @@ begin
|
|||||||
FPopupMode := pmNone;
|
FPopupMode := pmNone;
|
||||||
FPopupParent := nil;
|
FPopupParent := nil;
|
||||||
|
|
||||||
IsMainForm := False;
|
IsMainForm := (LCLObject <> nil) and (LCLObject = Application.MainForm);
|
||||||
|
|
||||||
w := QApplication_activeWindow;
|
if IsMainForm then
|
||||||
if not Assigned(w) and not ((Application.MainForm <> nil) and (Application.MainForm.Visible))
|
|
||||||
and (TCustomForm(LCLObject).FormStyle <> fsSplash) then
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
IsMainForm := True;
|
|
||||||
Result := QMainWindow_create(nil, QtWindow);
|
Result := QMainWindow_create(nil, QtWindow);
|
||||||
|
|
||||||
{$ifdef darwin}
|
{$ifdef darwin}
|
||||||
@ -11163,6 +11159,8 @@ begin
|
|||||||
Action := QActionH(Actions[i]);
|
Action := QActionH(Actions[i]);
|
||||||
seq := QKeySequence_create();
|
seq := QKeySequence_create();
|
||||||
try
|
try
|
||||||
|
if QKeySequence_isEmpty(seq) then
|
||||||
|
begin
|
||||||
QAction_shortcut(Action, seq);
|
QAction_shortcut(Action, seq);
|
||||||
WStr := '';
|
WStr := '';
|
||||||
QAction_text(Action, @WStr);
|
QAction_text(Action, @WStr);
|
||||||
@ -11175,6 +11173,7 @@ begin
|
|||||||
QAction_setShortcutContext(Action, QtApplicationShortcut);
|
QAction_setShortcutContext(Action, QtApplicationShortcut);
|
||||||
QtWidgetSet.AddGlobalAction(Action);
|
QtWidgetSet.AddGlobalAction(Action);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
finally
|
finally
|
||||||
QKeySequence_destroy(seq);
|
QKeySequence_destroy(seq);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user