QT Module

BlitzMax Forums/Brucey's Modules/QT Module

Glenn Dodd(Posted 2012) [#1]
Hello,
I have SVN'ed to http://qtmax.googlecode.com/svn/trunk/qt.mod and got all the files.
When i run the examples i get the following error:

QtCore4.dll is missing

I could download the file manually i suppose but this isn't normal of the module brucey submits.
Is this to do with the GCC version issues discussed in the Build Error thread?
For WXMax everything it needed came with the SVN stuff.

Any thoughts?
I am not in any rush to use this. I was just checking it out so i could read the documentation.

Cheers
Glenn


Brucey(Posted 2012) [#2]
Oh, you don't want to go there!

It's not nearly useful yet, but everything you need to run the examples are there. The dlls are in the lib/win32 dir.

But if you are not using BMK NG, you'll need to copy stuff manually. (you'll see there is a post.bmk file in each dir. That runs after a compile, and does things like getting DLLs into the right place - on Windows into the dir, on Mac into the bundle).

It's easier for now, to pretend the project isn't there :-p


Glenn Dodd(Posted 2012) [#3]
I like pretending :)
I will wait till official word comes down that you are ready for people to check it out :)

Cheers
Glenn


Brucey(Posted 2012) [#4]
Good grief, this model/view stuff is hard work! :-/


Russell(Posted 2013) [#5]
Just curious: Why QT *AND* wxMax? Is it worth the trouble to support both? Does one have an advantage over the other? Are they the same thing or do they have different purposes?

Russell

p.s. Good to have you back, Brucey!

p.p.s. Do you do anything with monkey? (If I were BRL/Mark, I'd send you monkey for free considering all you've done for us Blitzers over the years!)


Armitage 1982(Posted 2013) [#6]
I remember I was interested in Qt because it was 3D accelerated and you could use it inside OpenGl for in-game UI. But somekind of module was necessary to use it that way. CeGUI is currently the best alternative for this especially with the latest version of Brucey compatible with the GUI/Skin unified Editor.

More choice more fun :)

Anyway, Qt as a very interesting set of tools and is pretty solid.


Brucey(Posted 2013) [#7]
Why QT *AND* wxMax?

Dunno. It seemed a good idea at the time ;-)

And well, I like to stretch myself a bit and see what kind of things I can squeeze out of BlitzMax. Like the SIGNAL/SLOT stuff that Qt uses, which I managed to integrate with BlitzMax using some funky reflection stuff.

Although perhaps you meant, Qt and wxMax and GTK+? Hmm… yeah… I kind of see what you mean.
They are more or less the same thing - in that they are GUI toolkits - but each takes a slightly different look at the whole, and perhaps you prefer to work in one way or the other, that each of them give you. Certainly, they are both OO, and therefore *much* easier to use than MaxGUI, which is very procedural and fills your world with Select statements :-/

But, QtMaxGUI also gives me the opportunity to really test my wrapper, and you get another MaxGUI driver for free in the process. (probably, if it works)


Ole JR(Posted 2013) [#8]
Just a quick question about your QT wrapper.

Are you targeting all platforms, or just on mac for now?

Reason is that it fail to build here on Linux & win7..
Using OpenSuse 12.2, 32bit gcc 4.7.1.
And windows with mingw tdm-1 4.7.1.

Ole JR


Brucey(Posted 2013) [#9]
It's failing? I am testing it on all platforms as I go.

I've been running it on Kubuntu Linux 64-bit and Windows XP 32-bit (in two different VMs).

Last edited 2013


Ole JR(Posted 2013) [#10]
On win7 I get:
"mod/qt.mod/qglwidget.mod/ ../qwidget.mod/glue.h 50:60: error: 'MaxQKeySequence' has not been declared"

On Linux it seem be something with my setup:
"Build Error: failed to compile mod/qt.mod/core.mod/glue.h:23:18: fatal error: QtCore: No such file or directory"

Ole JR

Last edited 2013


Brucey(Posted 2013) [#11]
On windows, your code is out-of-date ;-)

On Linux, you need the Qt dev packages (which include the headers, etc). For Win and Mac I use the provided stuff (in src/lib), on Linux you are expected to have all that installed on your machine if you expect to develop with it - as is the way on Linux.

edit: it is very much a work-in-progress. I've already had to re-engineer the event code to sit better with the BlitzMax object model. Also you'll find problems with 2 of the examples on Windows, and one on Linux - they crash, and I can't work out what I'm doing wrong (probably something I've broken in the wrapping or some such).
But the basic stuff is working. You'll also find in there the QtMaxGUI module source, which I'm using as my testbed as I implement Qt.

Last edited 2013


Ole JR(Posted 2013) [#12]
No problem about the work-in-progress part.
Just checking if it builds for now.

And about old code on windows.
svn revision 242 is what I'm trying to build..
Just tried a 'svn up' now, still the same thing on windows..

I also know about the dev packages on Linux,
Problem seem to be that here the include files/directories for Qt
is located straight under /usr/include/.. No /qt4/ at the end..

It like:
/usr/include/Qt/*.h
/usr/include/QtCore/*.h
/usr/include/QtGui/*.h
/usr/include/QtOpenGL/*.h

Ole JR


Brucey(Posted 2013) [#13]
Hmm, well I updated my Windows svn, and all built fine, as it should I suppose.
qwidget.mod/glue.h does have the include for qkeysequence, so I don't know why it would complain on yours, unless your file is not up-to-date for some reason.

I am not sure what to do about the Linux stuff tho…
.. other than to have it set up for pointing to several places in the code (common.bmx).

Last edited 2013


Ole JR(Posted 2013) [#14]
Deleted qt.mod, and a clean checkout on windows.
Still get the the same error.

As for Linux.. There's alot of common.bmx file in there that need to be fixed.. If one should even think about going in that direction :-P

So I just made the qt4 dir, and softlinked the others in there for now..
Guess what happens then. I get the same error on Linux that I do on windows..

ar: creating /home/olejr/BlitzMax/mod/qt.mod/qglcontext.mod/qglcontext.debug.linux.x86.a
Compiling:glue.cpp
Compiling:common.bmx
In file included from /home/olejr/BlitzMax/mod/qt.mod/qglwidget.mod/glue.h:28:0,
from /home/olejr/BlitzMax/mod/qt.mod/qglwidget.mod/glue.cpp:23:
/home/olejr/BlitzMax/mod/qt.mod/qglwidget.mod/../qwidget.mod/glue.h:250:60: error: ‘MaxQKeySequence’ has not been declared
Build Error: failed to compile (1) /home/olejr/BlitzMax/mod/qt.mod/qglwidget.mod/glue.cpp

And yes, while typing the error from windows I missed one '2' (250:60).
This is a copy/paste.

Ole JR


Brucey(Posted 2013) [#15]
Ah, yes, sorry.. QGLWidget… I once committed it when I shouldn't have and it's been a pain ever since. I fixed the broken define at the top of the file and all should build now. Sorry about that. :-/

*sigh*

I use a template set of files to ease creating a new class, and obviously I had missed changing the define part at the top of that file. It seems to imply that there is another one missing somewhere else too then…


Brucey(Posted 2013) [#16]
The number of common.bmx is not such an issue - I can change all of them with a single script if I need to (the wonders of perl and sed!), but of course the bigger issue is how many different places does Qt tend to live, and therefore how many should it support. Up until now, the current path that you see in the code has worked fine on the distro's I've been playing with.


Ole JR(Posted 2013) [#17]
Yes indeed:

In file included from /home/olejr/BlitzMax/mod/qt.mod/qgraphicsrectitem.mod/../qgraphicsview.mod/glue.h:29:0,
from /home/olejr/BlitzMax/mod/qt.mod/qgraphicsrectitem.mod/glue.h:27,
from /home/olejr/BlitzMax/mod/qt.mod/qgraphicsrectitem.mod/glue.cpp:23:
/home/olejr/BlitzMax/mod/qt.mod/qgraphicsrectitem.mod/../qgraphicsview.mod/../qwidget.mod/glue.h:250:60: error: ‘MaxQKeySequence’ has not been declared
Build Error: failed to compile (1) /home/olejr/BlitzMax/mod/qt.mod/qgraphicsrectitem.mod/glue.cpp



And nothing to be sorry about, this is kind of why I do this.
To "bug-hunt" modules on some other setup(s) than you have.

Ole JR


Brucey(Posted 2013) [#18]
Funnily enough, I've just gone through and found lots of them, which I've now fixed…

I don't often do full-clean builds as it takes a while usually, and I'm too busy writing code to wait that long… but I should probably make time to do it occasionally, just because it seems to need it.

Last edited 2013


Ole JR(Posted 2013) [#19]
Oki.

And I did a search for where distro's keep their QT includes.
I found that most (all?) rpm based (Fedora/Red Hat/Suse/CenOS/Mandriva)
install them right under /usr/include (without the qt4 directory).

You have Ubuntu. so that should make (X)(K)ubuntu, and probably Mint,
the same as you have it..
As those are based on Debian, my guess is that it look the same over there.

So two places to look for the includes, should atleast cover some distro's..

I do clean builds, so if I find something I'll tell you :)

Ole JR

Last edited 2013


Brucey(Posted 2013) [#20]
Okay, so I installed Fedora VM, and set everything up.
A change to the Linux includes allows it all to build there. So I've just committed that.

Heh, but it seems the "oxygen" theme is broken somehow, as all my apps crash with that enabled. However, changing it to any other theme and the apps start okay. I did a google about it and it appears to have been a known issue.


Nigel Brown(Posted 2013) [#21]
Almost there, getting an error of libQtGui.4.dylib Reason: image not found I am using:

Qt5
BMK bmk 2.15 mt-macos-x86 / gcc 40201 (cpu x2)
latest source build of qt.mod
gcc 4.2.1
g++ 4.2.1
bcc 1.49

any advice would be appreciated.


Brucey(Posted 2013) [#22]
Sounds like the dylib is not in your application bundle.

There are several ways you can fix this :-)

1) manually copy them into the BlitzMax-created bundle.
2) use a script to do it after your build
3) use bmk(NG) to do it automatically via a post-build script. (there are examples of these throughout my modules which require shared libraries - look for post.bmk files)

And also make sure you set "build gui app" in the IDE.


Nigel Brown(Posted 2013) [#23]
Brucey, thanks for that using BMK NG the full error is :

dyld: Library not loaded: /usr/local/lib/libpng12.0.dylib
Referenced from: /Applications/BlitzMax/mod/qt.mod/examples/widgets/analogclock/analogclock.app/Contents/MacOS/libQtGui.4.dylib
Reason: image not found


Nigel Brown(Posted 2013) [#24]
Just built the same on PC bkkng copies the correct dll's etc. However I am getting an EXCEPTION_ACCESS_VIOLATION when running the analogue clock example. On the line: Local app:QApplication = New QApplication.Create()


After spending some time on Google the Mac error seems to be something to do with libpng versions but have not found a solution to it yet.


Nigel Brown(Posted 2013) [#25]
have found a workaround for this on mac by downloading and installing the libpng package here: http://ethan.tira-thompson.com/Mac_OS_X_Ports.html

running the sliders example then returned a new error that was fixable by copying the qt_menu.nib into the package

It would be good to get a workaround that was not dependent on pre installed libraries of a specific version.


Brucey(Posted 2013) [#26]
Hmm, I just let it build as default.
Perhaps I should set it to use it's own libpng shared object on OSX…

*sigh*


Nigel Brown(Posted 2013) [#27]
Here are the steps I have taken to get the QT stuff working under Windows7:

1> Fresh Install of BlitzMax 1.48
2> Fresh install of (http://tdm-gcc.tdragon.net/download) tdm-gcc-4.7.1-2.exe
3> Fresh checkout of the latest qtmax
4> Create a copylibs.bat and copy this to it, then run it.
@echo off
@set dirMinGW=c:\MinGW
@set minGWVersionString=4.7.1
@set dirBlitzmax=c:\BlitzMax

copy %dirMinGW%\bin\ar.exe %dirBlitzmax%\bin /Y
copy %dirMinGW%\bin\ld.exe %dirBlitzmax%\bin /Y

for /f "delims=" %%i in ('dir %dirBlitzmax%\lib /b') do (
copy "%dirMinGW%\lib\%%i" "%dirBlitzmax%\lib\%%i" /z /y
copy "%dirMinGW%\lib\gcc\mingw32\%minGWVersionString%\%%i" "%dirBlitzmax%\lib\%%i" /z /y
)
5> Compile all modules

All modules compiled without error, loaded qt.mod/examples/widgets/analogclock/analogclock.bmx and Run, and I get the following "EXCEPTION_ACCESS_VIOLATION" this results in me trying to pull what remaining hair from my scalp!