Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Post by uwestoehr »

wmayer wrote: Fri Mar 27, 2020 5:23 pm You can also try: qmake -t vclib plugin.pro to create a VS project.
Thanks! This solved the x664 issue because also with this Qmake made win32 as target. In MSVC I could change this to x64 and compile the DLL.

However I still cannot use it as plugin, because my Qt here is the one from the FreeCAD LibPack, compiled using MSVC 2015. I have MSVC 2017 installed and I found by googling that Qt designer and the DLL must be compiled using the same MSVC version. That is odd.
However the LibPack already has 3 plugins in its designer folder

Code: Select all

D:\FreeCAD-build\FreeCADLibs_12.1.4_x64_VC15\plugins\designer
bur when I start Designer it finds not any plugin. So also the ones compiled with the same MSVC version than designer are not recognized.


I also tried to set the environment variable

Code: Select all

QT_PLUGIN_PATH
without success. That is more odd.

However, I'll make a PR to add the project file making it others easier to compile at least.

At my main development PC I have my own full Qt installation and I'll try it there.
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Post by wmayer »

uwestoehr wrote: Fri Mar 27, 2020 6:30 pm However, I'll make a PR to add the project file making it others easier to compile at least.
This doesn't make easier anything because everybody who wants to use it must change tons of include paths. In the past we already had a VS project file and it only worked on the system it has been created but not out-of-the-box on others.
So, it's easier to re-create it using qmake.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Post by uwestoehr »

uwestoehr wrote: Fri Mar 27, 2020 6:30 pm However the LibPack already has 3 plugins in its designer folder

Code: Select all

D:\FreeCAD-build\FreeCADLibs_12.1.4_x64_VC15\plugins\designer
Heureka! I managed it. The path was wrong, one MUST use this path, any other one fails:

Code: Select all

D:\FreeCAD-build\FreeCADLibs_12.1.4_x64_VC15\bin\designer

@apeltauer, for the next LibPack can ypu please create this folder and put in there the DLL? (It turns out the MSVC version used to compile the DLL is not important. so we can directly deliver our DLL with the LibPack.)

Here is the DLL to be included:
FreeCAD_widgets.zip
DLL file for Qt designer in a ZIP file
(49.58 KiB) Downloaded 33 times
apeltauer wrote: .
Last edited by uwestoehr on Mon Aug 10, 2020 5:37 pm, edited 3 times in total.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Post by uwestoehr »

wmayer wrote: Fri Mar 27, 2020 6:43 pm This doesn't make easier anything because everybody who wants to use it must change tons of include paths. In the past we already had a VS project file and it only worked on the system it has been created but not on others.
This has changed. because once I compiled the Thumbnailprovider
https://github.com/FreeCAD/FreeCAD/tree ... ilProvider
I took the existing .sln project file created by another user long ago using VC 2008. MSVC 2017 was able to import it and all paths were automatically updated. Therefore I once made a PR to update it you you merged it:
https://github.com/FreeCAD/FreeCAD/comm ... 754988f6a2

Therefore having a .sln file helps a lot because it only cost you a few clicks to get it running and MSVC helps you with this.
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Post by wmayer »

uwestoehr wrote: Fri Mar 27, 2020 6:48 pm This has changed. because once I compiled the Thumbnailprovider
https://github.com/FreeCAD/FreeCAD/tree ... ilProvider
I took the existing .sln project file created by another user long ago using VC 2008. MSVC 2017 was able to import it and all paths were automatically updated. Therefore I once made a PR to update it you you merged it:
The VS project for ThumbnailProvider is a completely different story because it only depends on the zipios++ and CxImage sources that are compiled into the DLL. There are no dependency to any of the libraries of the LibPack. This way it's possible that all include paths are relative and thus no problem to build on any Win system.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Post by uwestoehr »

wmayer wrote: Fri Mar 27, 2020 6:55 pm The VS project for ThumbnailProvider is a completely different story ...
Please give me first a chance to test: I take the project file from this PC with the Qt from the LibPack to my other development PC with a standalone Qt installation. There all paths and even the installation path drive letter is different. If I can use the .sln file there out of the box, I'll make a PR, if not, then of course a PR is not helpful.
OK?
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Post by uwestoehr »

uwestoehr wrote: Fri Mar 27, 2020 6:43 pm

Code: Select all

D:\FreeCAD-build\FreeCADLibs_12.1.4_x64_VC15\plugins\designer
one MUST use this path, any other one fails:
Well, it is much more complicated:
* when using the Qt in the LibPack, then this is true.
* when using Qt as standalone installation, you can choose between

Code: Select all

C:\Qt\Qt5.12.5\5.12.5\msvc2017_64\bin\designer
and

Code: Select all

C:\Qt\Qt5.12.5\5.12.5\msvc2017_64\plugins\designer
Put there the compiled DLL:

and Qt Designer will find it as plugin.

In contrary Qt Creator does not. It expects the DLL in this path:

Code: Select all

C:\Qt\Qt5.12.5\Tools\QtCreator\bin\plugins\designer
I use Qt Creator 4.10 (based on Qt 5.13.1) as standalone installation and since my Qt is 5.12.5 it cannot load the DLL as plugin. So what seems to be true (read it in forums by googling around) is that Qt Creator can only read the DLL as plugin, if it was compiled using the same Qt version.

@Werner: VC project file works on both my machines. I don't need to do anything, just open it and compile. The resulting DLL is recognized by Qt Designer as well as the DLL I compiled on the other machine -> I'll make a PR.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Post by uwestoehr »

For the records: The process of installing and compiling FreeCAD's Qt widgets a Qt Designer plugin on Windows is now described in the Wiki:
Compile_on_Windows#Qt_Designer_plugin
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Post by uwestoehr »

uwestoehr wrote: Fri Mar 27, 2020 6:43 pm Here is the DLL to be included:
Here is a new one including bugfixes and additional features by Werner:
FreeCAD_widgets.zip
DLL file for Qt designer in a ZIP file
(50.17 KiB) Downloaded 554 times

@apeltauer, for the next LibPack can you please create this folder and put in there the DLL? (It turns out the MSVC version used to compile the DLL is not important. so we can directly deliver our DLL with the LibPack.)
[/quote]
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Gui::QuantitySpinBox miss QAbstractSpinBox inheritance

Post by uwestoehr »

uwestoehr wrote: Fri Mar 27, 2020 6:43 pm

Code: Select all

D:\FreeCAD-build\FreeCADLibs_12.1.4_x64_VC15\bin\designer
@apeltauer, for the next LibPack can ypu please create this folder and put in there the DLL? (It turns out the MSVC version used to compile the DLL is not important. so we can directly deliver our DLL with the LibPack.)
Ping @apeltauer
Can you please add the folder ~bin\designer in your LibPack and put in the DLL I compiled: https://forum.freecadweb.org/download/f ... ?id=124239

apeltauer wrote: :bell:
Post Reply