Solved Making a Qt custom widget without Qt Creator
-
@mrjj said in Making a Qt custom widget without Qt Creator:
Hi
just a note
Unless you compile your own Creator with mingw then
its not possible to make Designer plugins with
mingw.
It has to be vs 2013/ 2015 ( for 5.8)
Since Creator is build with that compiler and the plugin is an DLL.So it sounds good but unless you use visual studio or your own mingw Creator it
Wow!! this was quite a shock form me! :)
I 'd rather not to compile it with my MingW, I think this is a very loooong process..So you 're saying I should Uninstall Qt Creator + Qt, and install a version:
a. either With Visual Studio
b. or a different mingW Creator version?If so, I choose the second. But, which MingW + Qt Creator file should I download? (I don't care if it's gonna be Qt 5.8 or any other)
-
@Panoss No. No need to uninstall QtCreator (why should you)? Install Qt for VC2015 and VC2015 (you can get it for free).
The thing is: you cannot mix different compilers (because of C++, not Qt fault). Since QtCreator is built using VC2015 you have to use VC2015 to write plug-ins for it.
Official QtCretor is built using VC2015, you cannot use MinGW to write plug-ins for it. As far as I know there is no official QtCreator build made with MinGW. -
@jsulm said in Making a Qt custom widget without Qt Creator:
Install Qt for VC2015 and VC2015 (you can get it for free).
I'll have to uninstall my curent Qt, right? (through on-line installer I mean)
-
@Panoss No need to uninstall your current Qt - you can have as many Qt installations as you like.
Use Qt Maintenance Tool to add Qt for VC2015. -
In Qt Maintenance Tool I have these options under Qt 5.8:
WinRt arm7(MSVC2015)
WinRt x64 (MSVC2015)
WinRt x86 (MSVC2015)
Windows Phone arm (MSVC2013)
Windows Phone x86(MSVC2013)
Windows Runtime 8.1 x64 (MSVC2013)
msvc2013 32-bit
msvc2015 32-bitI suppose I 'll have to choose the 'msvc2015 32-bit', right?
-
@Panoss
yes. as long as it matches the visual studio suite you install later it should be fine.Can I ask what goal is ?
You want to create a custom Designer plugin and use in your windows project or
what is the plan?
Or is just to test it out?Yes compiling Creator do take some time.
I didnt use the make install thing.
I simply copied worldtimeclockplugin.dll to
M:\1_Creator\qt-creator-build-2\bin\plugins\designer
(bin\plugins\designer)
and it was visible in designer.So if goal is to produce a real plugin for Designer, then you need visual studio.
If just for trying it out, we could cheat and i can give u the mingw Creator.
Its like 50 MB download.
But for a real project/plugin, the Visual Studio road is better. -
My goal is to create a real widget (ok plugin which wraps the widget).
The strange thing is that I managed to create Qt widgets with Python, SO MUCH easier, just two files, one the plugin and one the widget, put in the right place and immediatelly show up in Qt Designer!!!
I can't believe that with Qt Creator it's so much harder!!!
Antway...I 'm thinking of using Visual Studio Express 2015.
Is this suitable as Visual Studio? -
@Panoss
Im not sure express will work but it might nowadays.
I only heard of
https://www.visualstudio.com/vs/community/
But i can be wrong. I dont use visual studio at all. :)The reason for it being hard in C++ than python is the way DLLS works in windows.
( and python is not compiled)
On linux its more easy as there is only gcc compiler.Just final question.
It is easy to use custom plugins without all the plugin code using
promotion.
http://doc.qt.io/qt-5/designer-using-custom-widgets.htmlThat however do not provide Design time editing of its properties.
-
@Panoss Use Community edition, it is free. Don't forget to select C++ during installation.
-
@mrjj said in Making a Qt custom widget without Qt Creator:
@Panoss
Just final question.
It is easy to use custom plugins without all the plugin code using
promotion.No, I need real widget(plugin).
Well, I thought of it again, I think I'd better compile Qt Creator with mingw.
How can I do this?
According to this...it's a nightmare!!
Will I have to re-compile if I create a new plugin sometime later?
Or it's done once and forever? -
@Panoss
Its sort of a do once and use mingw Creator for ever with that version of Qt
But in a few version of Qt you might need to recompile Creator.Its not a nightmare as such ( webkit is: ) but it does take some (long) time.
If you plan on others to use your plugin , the VS way is still better :)
You will still use Creator etc and its just other compiler.And no, the whole reason to compile Creator with mingww is so it will load plugins compiled with
mingw. So as long as you do not upgrade mingw , then no need to ever recompile Creator for a new plugin.The normal Creator is compiled with Vs and only like VS compiled plugins.
So in my opinion, for your use case Visual Studio is better as its how it normally works and
all other installations of Qt can just use it. -
Ok, I 'll go for the Visual Studio, you convienced me :).
-
@Panoss
Super. Its fun with plugins.
We need more , one can never have too many Designer widgets :)Final note:
The debugger is a separate download.
https://forum.qt.io/topic/60713/setting-visual-studio-2015-debugger/optional component called "debugging tools for windows"
This is often a surprise :)
-
"Optional". So I can live without it, right?
You mean, 'this is often a good surprise' ? -
You will need debugger :)
We all do.
And no its was not good surprise.
They come here and say.
"Program crash"
and we go like "ok, place a breakpoint and single step the function to find crash point."But it can wait till later i guess :)
-
Fast question:
This plugin will run on windows xp?
The app is for Xp?Note that from 5.7 ( think) its not tested on xp.
Might work or might not. Its not supported. -
It will run on Win 10, Win 7 and XP.
-
@Panoss
Ok. just asking as XP is not on ppl mind anymore.
https://forum.qt.io/topic/73292/the-last-qt-version-that-supported-windows-xpSounds like using 5.6 is the best bet :)
Did u try that version of Creator on xp?
It didn't start or ?
Note that Xp in virtual machine do not have openGL (often) and can only work if started with some option
https://forum.qt.io/topic/36827/qt-creator-3-0-welcome-mode-not-working-in-virtualbox-vmlike
c:\path\qtcreator -noload Welcome -noload QmlDesigner -noload QmlProfiler -
On XP I haven't tried Qt Creator yet.
I was thinking of trying an older version, and adjusting the code where necessary. -
@Panoss
well if u go back to Qt4 then all plugin stuff is a bit different. ( from Qt5 series)
So would be great if 5.6 can be used. :)