Solved Error in using MultiPageWidget from QtDesigner
-
@JonB
OOPS , Sorry i missedthis is the image of error and the errors it self in the previous reply
url : "https://ibb.co/CMFk540"and this image for including multipagewidget in ui_profile.h
url :"https://ibb.co/gRJ8kCL" -
Hi
Just as a note.
There is also QStackedWidget which is a multi page widget.
https://doc.qt.io/qt-5/qstackedwidget.html#details -
@mrjj
Yeah , i know QStackedWidget and used it in this Design but i've many stuff so i need multipagewidget to container these stuff in it and MultiPageWidget similar to QToolBox in containg the stuff and MultiPageWidget the Perfect solution here -
@MostafaEzzat
Ok. fair enough.
You are using the Qt5 version ? (seems so)
C:\Qt\Examples\Qt-5.12.0\designer\containerextension
I just tried open it in Creator and it just compiled and generated the .DLL ( the plugin)So are you trying to use this in Qt4 ?
Im wondering why you get error as it just compiles here.
Also it seems that you are adding the sources to your app ?
And not create the SO file ( the plugin ) and copy it to designers plugin dir for it to load
when run.
So do you mean you want to use as a true plugin or simply use the Widget via promotion ? -
@mrjj
Thank you alot it works now , but just for curiosity why didn't it work with qt-qmake4 ?
i've both qt4-qmake and qt5-qmake and compiled this widget with qt-qmake5 and worked and the errors was on qt-qmake4 .. so if i wanna compile it with qt-qmake4 what should i do?
the widget after displaying : "https://ibb.co/wSZ9S7V" -
Hi
Congrats, you fist Designer plugin :)
Well with qt-qmake4 it would use Qt4 headers and stuff like QStringLiteral ( from Qt5.0) and QOverload (from Qt 5.7.)
is not defined there.
You can replace QStringLiteral with nothing and QOverload withstatic_cast
with SIGNAL/SLOT macros.
However, you could also just find the same sample in Qt4 samples.
(it seems to have existed back there)Anyway, if you build and use the actual Designer plugin, im not sure Creator will load it (if compiled with Qt4)
as Creator Qt5 based (unless its old version).You also need at Qt4 version besides the Qt5 version or why, if i may ask?
-
Thank you alot it works now , but just for curiosity why didn't it work with qt-qmake4 ?
- When you build with
qt4-qmake
you are compiling for Qt 4; when you build withqt5-qmake
you are compiling for Qt 5. - There are changes in the Qt functions between Qt 4 and Qt 5.
- Code written for one of these may not compile in the other.
- You are using an example supplied with Qt 5 (
-/usr/lib64/qt5/examples/designer/containerextension
). - For example, I saw one of your error messages was
'windowTitleChanged' is not a member of 'QWidget'
. Qt 5 documentation shows https://doc.qt.io/qt-5/qwidget.html#windowTitleChanged, and says "This function was introduced in Qt 5.2.". Qt 4 documentation https://doc.qt.io/archives/qt-4.8/qwidget.html shows it did not exist back then. - This means that line of code must have been added just for Qt 5.
- If you try to compile that for Qt 4 it will error as you have seen.
- You would need the code of that example as it was supplied in Qt 4 if you want to build for Qt 4. Or you have to make all necessary edits yourself.
- When you build with
-
@mrjj said in Error in using MultiPageWidget from QtDesigner:
Hi
Congrats, you fist Designer plugin :)
Well with qt-qmake4 it would use Qt4 headers and stuff like QStringLiteral ( from Qt5.0) and QOverload (from Qt 5.7.)
is not defined there.
You can replace QStringLiteral with nothing and QOverload withstatic_cast
with SIGNAL/SLOT macros.
However, you could also just find the same sample in Qt4 samples.
(it seems to have existed back there)Anyway, if you build and use the actual Designer plugin, im not sure Creator will load it (if compiled with Qt4)
as Creator Qt5 based (unless its old version).You also need at Qt4 version besides the Qt5 version or why, if i may ask?
Sure , First of all thank you for your help
in the first i had only qt4 then my OS (which is fedora 29) lost his grub and also Windows but i was owning my project when installed a new Systems , i faced many problems in connecting the database and so on so i downloaded qt4 then qt5 coz qt5 downloaded with all .so files of mysql but qt5 consumes too much memory while compiling and make the system freezing Especially with GNOME but the final project will be compiled in Qt5 (and i guess i've to sober in using Qt5 Libraries For Performance .. right ? or it included the main Libraries ? )
-
@JonB said in Error in using MultiPageWidget from QtDesigner:
Thank you maybe i'll give it a try in someday ..
-
@MostafaEzzat
Hi
Qt4 is really old so new development is best to do on Qt5.
And all the new stuff comes in Qt5+. So yes, much more fun to use.How much memory do you have?
-
@mrjj
i've 4 gb Ram when i use Qt5 and compile the code the memory usage reaches about 2.9 GB maybe more but i ain't know why only Qt5 make the system freezing (but i'll try the new upgrade of the system and see it again )