Lazarus
Programming => Widgetset => QT => Topic started by: Groffy on September 28, 2015, 10:29:17 am
-
There was a discussion about that topic two weeks ago on the qt mailing list. I installed the package under Win7 /qt and win32 widgets + Lazarus 1.5 trunk. Its working for me so far, but with qt the keyboard keys CTRL+C / CTRL+V / CTRL+X and the [Delete] key are not working. Can I post these issues here or should it stay separately in the QT mailing list?
Best regards
-
Can be here. We have some bug in QT related to handling form where is set "ParentWindow" :/
-
Where exactly ? Maybe I can fix it
-
An issue I noticed so far (Lazarus trunk revision 49877 + qt 4.8.5) : Place a control on an empty form. Focus the control and press CTRL+C, focus the form and press CTRL+V. Exception message : "Cannot focus a disabled or invisible window"
-
Can you fill an issue about it ?
-
btw. I cannot reproduce it with trunk lazarus, fpc.2.6.4, linux 32 bit, qt 4.7.4
-
@zelko
http://bugs.freepascal.org/view.php?id=28744
I did not test it under Linux Mint, I read somewhere that Sparta basic package is only compiling with fpc3.x (?)
-
You need to install "Sparta Basic" package. As mentioned above keyboard keys CTRL+C / CTRL+V / CTRL+X and the [Delete] key are not working for "docked designed form". Same for Popup menu - is not handled/detected for "docked designed form". Right click on form will bring to front PopupMenu assigned to PageControl (ide/sourceeditor.pp)
-
@hnb, ok I'll take a look into
-
Is there anywhere howto install sparta package ? Where I can download it ?
-
@zeljko
You can find it in the FreeSparta branch(components directory): http://svn.freepascal.org/svn/lazarus/branches/free-sparta
-
Thanks
-
I made a mistake, I checked out the
http://svn.freepascal.org/svn/lazarus/branches/free-sparta
source, not Lazarus trunk. I guess the Sparta basic package will not compile under Lazarus trunk(?)
-
@Groffy
It should compile with trunk without any problems (ofc you need to use FPC 3.x). All changes from Sparta branch are merged to trunk (only "Sparta Basic" package is outside trunk. I need to fix few things. Anyway it is almost done :) ).
-
@hnb
Thank you, Sparta basic package is compiling with Lazarus trunk / FPC3.0rc1
-
@zeljko QT is only platform where is not painted correctly Data Module for FreeSparta branch :\
-
@hnb, according to that statement carbon works perfect ? I've started yesterday to look into sparta docking but haven't investigate code yet.
-
DataModule was not tested for carbon yet :\
-
I suppose that painting problems comes from painting outside of paint event, otherwise Qt paints perfectly.
-
Can be here. We have some bug in QT related to handling form where is set "ParentWindow" :/
Well....Ctrl+V raises error with Gtk2 too. So this is not Qt only problem, but I guess (maybe) some winapi implementation in lcl.
I'd like to extract example (so no need for sparta package) where Qt have problems with ParentWindow. Can you create one ?
-
I suppose that painting problems comes from painting outside of paint event, otherwise Qt paints perfectly.
It is very strange because painting for non visual components works perfectly for normal forms, the only problem is with DataModule.
Well....Ctrl+V raises error with Gtk2 too. So this is not Qt only problem, but I guess (maybe) some winapi implementation in lcl.
I'd like to extract example (so no need for sparta package) where Qt have problems with ParentWindow. Can you create one ?
I will try.
-
Ok, this is what needs to be done for Qt and Gtk2:
1.main.pp TMainIDE.GetActiveDesignerSkipMainBar always returns nil (gtk2 and Qt), that's why shortcuts does not work , mean copy paste of components inside designed form via keyboard. With menu it does work. So, in this function sparta must return current designer somehow. I'm not sure that shortcuts works on win32 too because of this, or win32 contains some extra magic.
2.sparta_ResizerFrame.pas im procedure TResizerFrame.TryBoundDesignedForm;
{$IF DEFINED(LCLGtk2) OR DEFINED(LCLQt)}
pClient.SendToBack; // <--- this is a must.
{$ENDIF}
pClient.BringToFront;
-
I can confirm that TDataModule isn't painted properly, but I guess that root of problem is missing paint event for TDataModule design widget under Qt.I suppose that gtk2 paints TDataModule correct since it can paint outside of paint event, so no need for paintevent.
Now you must investigate why TDataModule does not send single paint event to designer form.
-
Ok, problem with TDataModule is located. gtk2 and win32 works because they paint outside of paintevent. What's exact problem:
1.TDataModule uses TFakeNonControl as design form.
2.TFakeNonControl does not have csDesigning in TFakeNonControl.ComponentState
3.When Qt creates form handle it checks for csDesigning (TFakeNonControl in this case) and it creates TQtDesignWidget. If there's no csDesigning in params, it create normal TQtMainWindow.
I've added simple check in TQtWSCustomForm.CreateHandle (QtWSForms.pp unit), so instead of checking csDesigning I'm checking for csDesigning or AWinControl.ClassName = 'TFakeNonControl'. It creates TQtDesignWidget and voila, TDataModule is properly painted.
So, when TFakeNonControl contains csDesigning (or any other flag which says that it will be design form) then it'll work.
-
@zaljko thanks for your valuable input! Painting and copy/paste problems are fixed (painting in r50111, copy/paste in r50113). :D
I have one new bugreport : Painting of "selecting rectangle" for designed forms don't work for Qt under Windows (even without "Sparta Basic" package).
-
I have one new bugreport : Painting of "selecting rectangle" for designed forms don't work for Qt under Windows (even without "Sparta Basic" package).
Then open an issue and attach example project.
-
Then open an issue and attach example project.
Done.
http://bugs.freepascal.org/view.php?id=28882