View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0038517 | Lazarus | LCL | public | 2021-02-19 21:16 | 2021-03-07 16:01 |
Reporter | Benjamin Rosseaux | Assigned To | wp | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Qt5 | OS | Windows | ||
Product Version | 2.1 (SVN) | ||||
Summary | 0038517: Revision 64575 breaks LCLQt5+Windows in connection with AnchorDocking together with a docked-form with TTreeView | ||||
Description | Revision 64575 breaks LCLQt5+Windows in connection with AnchorDocking together with a docked-form with TTreeView a AV occurs then in the ShellCtrls.pas somewhere at ico := GetShellIcon(WideString('C:')); try Result := Types.Size(ico.Width, ico.Height); FBuiltinIconSize := Result; finally ico.Free; end; in direction to the "ico.Free;" code line This is inside a `{$ifdef mswindows}` block? My suggestion would be to undo the changes in #64575, so that the Qt5 widgetset is fully usable under Windows again, and redo the #64575 changes on pure Win32-LCL-widgetset-implementation-level instead with a global `{$ifdef mswindows}` block inside the ShellCtrls.pas. Because this is not LCL-widgetset portable in my view. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
LazTarget | - | ||||
Widgetset | Win32/Win64, QT5 | ||||
Attached Files |
|
|
OK, when i renamed the mswindows define stuff to a other dummy name inside ShellCtrls.pas so it is ifdefed out, then my LCLQt5-based application is working again unter Windows. |
|
I've replaced {$ifdef mswindows} with {$ifdef DEFINED(LCLWin32) or DEFINED(LCLWin64)} in my patch now, and it seems to work. shellctrls.pas.patch (761 bytes)
Index: lcl/shellctrls.pas =================================================================== --- lcl/shellctrls.pas (revision 64623) +++ lcl/shellctrls.pas (working copy) @@ -85,7 +85,7 @@ procedure DoAddItem(const ABasePath: String; const AFileInfo: TSearchRec; var CanAdd: Boolean); function CanExpand(Node: TTreeNode): Boolean; override; - {$ifdef mswindows} + {$if DEFINED(LCLWin32) or DEFINED(LCLWin64)} private FBuiltinIconSize: TSize; protected @@ -1002,7 +1002,7 @@ FOnAddItem(Self, ABasePath, AFileInfo, CanAdd); end; -{$ifdef mswindows} +{$ifdef DEFINED(LCLWin32) or DEFINED(LCLWin64)} { Extracts the windows shell icon of the specified file. } function GetShellIcon(const AFileName: WideString): TIcon; var |
|
What is the difference between {$ifdef mswindows} and {$ifdef DEFINED(LCLWin32) or DEFINED(LCLWin64)} ? |
|
You can build a LCL app using default Windows API - {$ifdef DEFINED(LCLWin32) or DEFINED(LCLWin64)}. You can also use a other widgetset on Windows like QT5 - then you are still on Windows - {$ifdef mswindows} -, but this is also true {$IF DEFINED(LCLQt5)}. |
|
Any update on this? The actually quick to make change in the lcl/shellctrls.pas from {$ifdef mswindows} to {$if DEFINED(LCLWin32) or DEFINED(LCLWin64)} as from my patch would be already enough to make Qt5 usable again with Lazarus under Windows. |
|
Ideally these IFDEFS should be avoided and the code should be moved to the widgetset. But since the unit already contains already lots of {$if defined(Windows)} I took the easy way... However, applying your patch opens a lot of compilation issues on native Windows... Trying to put the code into the widgetset... |
|
Deactivated the former Windows-dependent changes in ShellCtrls. Currently I am testing a widgetset-based solution. |
|
Widgetset-based built-in solution for TShellTreeView in r64747 and for TShellListView in r64764. Both are windows-only at the moment. Should not interfere with "qt-on-windows" any more. Resolving the issue. Please test and close if ok. |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-02-19 21:16 | Benjamin Rosseaux | New Issue | |
2021-02-19 21:22 | Benjamin Rosseaux | Note Added: 0129021 | |
2021-02-19 21:33 | Benjamin Rosseaux | Note Added: 0129022 | |
2021-02-19 21:33 | Benjamin Rosseaux | File Added: shellctrls.pas.patch | |
2021-02-20 10:21 | Juha Manninen | Note Added: 0129032 | |
2021-02-20 10:24 | Juha Manninen | Assigned To | => wp |
2021-02-20 10:24 | Juha Manninen | Status | new => assigned |
2021-02-20 13:01 | Michl | Note Added: 0129034 | |
2021-02-27 05:19 | Benjamin Rosseaux | Note Added: 0129192 | |
2021-02-27 10:54 | wp | Note Added: 0129195 | |
2021-02-27 13:59 | wp | Note Edited: 0129195 | View Revisions |
2021-02-28 12:19 | wp | Note Added: 0129229 | |
2021-03-07 16:01 | wp | Status | assigned => resolved |
2021-03-07 16:01 | wp | Resolution | open => fixed |
2021-03-07 16:01 | wp | LazTarget | => - |
2021-03-07 16:01 | wp | Widgetset | Win32/Win64, QT5 => Win32/Win64, QT5 |
2021-03-07 16:01 | wp | Note Added: 0129485 |