Some Qt Code

Archives Forums/Linux Discussion/Some Qt Code

Brucey(Posted 2007) [#1]
This is the latest source code for my Qt GUI module.

You can download version 0.97 HERE.

Version Date : 14 Apr 2007
Version Summary :
* Fixed CountTreeViewNodes always returning 0.
* Added Key events to active Panel and Canvas.
* Added Panel Pixmap support.
* Added Popup Menu support.


HOWTO : build on various platforms.

The Qt module requires version 4.2.2 of Qt.
The paths defined in qtcommon.bmx refer to the default directories for :
* Windows - the binary install (During installation, you'll probably get a message telling you that your MinGW is not new enough. Just let it Continue, and it should work fine)
* Mac - the source dist compiled with -shared -no-framework
* Linux - the source dist compiled with -shared -release

If your Qt libraries are installed elsewhere, you need to modify appropriately.


NOTE : To link on Mac or Windows, requires changes to the bmk compiler tool that comes with BlitzMax. This is because by default the Mac version doesn't support linking to .dylib (Mac shared objects), or on Windows a non BlitzMax/lib folder of .a files.
I've posted fixes for the Mac HERE and Windows HERE. Hopefully BRL might update it officially one day... but until then...

NOTE 2 : Currently, "Mac Canvas" does not work. You will get errors or the app will crash. Be warned !

WORKLOG
Follow the worklog HERE.


Please remember that this fairly bleeding edge stuff, so only have a go if you aren't afraid of things going wrong :-)


Brucey(Posted 2007) [#2]
After 9 days of part-time hacking (some of us do have a day-job, you know!), I'm almost happy to release the first version of my Qt GUI module.
I say almost, because I would have liked to have things working better before now, but I ran into a brick wall with regards the Menus. So here I am, asking the community for some help :-p

Please be kind when you take a look at my C++ efforts, since I hadn't typed a single line of C++ until I took on this project. So, useful comments in this area would be welcome.

Here's a summary of how I've tried to work with the C++...
Basically, I have sub-classed each Qt Widget I wanted to use, adding to it a "maxHandle" field to represent the Max TGadget object to which the widget belongs.
Where required the classes also include a "public slots" section which defines a function which works like a callback for certain widget events/signals. These functions call actual BlitzMax functions on the appropriate TQtGadget types, passing back the relevant maxHandle and params. These Max functions generally raise a Max GUI event.
A lot of the logic has been coded in C++ since it's a lot less kludgy than calling C++ to return an object just to then send it back to C++ to do something with it.

Along with qtglue.cpp is another .cpp called moc4glue.cpp. This file is generated by a Qt commandline app called "moc". Any time a new GUI class is added or its slots/signals are modifed, this generator needs to be run against qtglue.cpp. It's how Qt works.
There's a note at the foot of qtglue.cpp explaining its usage.

Oh, btw, I apologise for my (lack of) coding standards with regards the C++. I'm a Java guy, so I'm used to putting curly brackets at the end of lines, rather than the start of new ones... ;-)

One more thing.
This module actually runs on ALL THREE platforms. I've posted here cuz there's nowhere else really to put it. That and Linux is my primary development platform.
When not on Linux, I've been using my Mac to work on it, while occasionally trying out some of the examples on Windows.
Surprisingly, to me at least, each platform runs in exactly the same way.

:-)


Brucey(Posted 2007) [#3]
Please please please, if someone who knows C++ can have a look at why the menu stuff might be nuking, I'd be very grateful.

The Max-side is at the bottom of qtgadget.bmx, and at the bottom of qtglue.cpp (both MENU and ACTION).

Thanks in advance... :-)


Brucey(Posted 2007) [#4]
Not to worry, I've worked out what I was doing wrong.... User error, I guess... :-p


Brucey(Posted 2007) [#5]
Summary of Previous Versions...

0.96
Version Date : 22 Feb 2007
Version Summary :
* Fixed Canvas flicker.
* Added Canvas events.
* Fixed gadget not remembering colour changes.
* Added 'Busy' style to progressbar. Set style to 1 at create time.
* Added 'Display Percent' style to progressbar. Set style to 2 at create time.
* Added QueryGadget support.
* Fixed Window creation not using styles.
* Added List/Tree View icon support.
* Added Tabber icon support.
* Fixed TextArea forgetting formatting (notably background colour) after SetText.
* Added mouse Wheel events for active Panel and Canvas.


0.95
Version Date : 19 Feb 2007
Version Summary :
* Fixed TextArea speed issues.
* Fixed TextArea ReplaceText offset issue.
* Implemented TextArea text-changed event.
* More TextArea cursor tweaks.
* Disabled specific shortcuts on QTextEdit to enable use in Max.
* Fixed TextArea SetColor. (partly... doesn't seem to stay set in IDE?)
* Fixed Tabber client size calculations.
* Added HTMLView style support.
* Tweaked Window initial sizing events.
* Added Gadget State().
* Added Tree/List view keyboard navigation.
* Fixed non-visible gadget mouse event generation.
* Added Label mouse events.
* Added Label GetText not returning anything.
* Fixed Window activate problem.
* Added Canvas gadget. ( glcube test draws ok, but it currently flickers like crazy :-p )


0.94
Version Date : 15 Feb 2007
Version Summary :
* Added Combobox setItem.
* Added Tabber removeItem.
* Fixed SetTextAreaText.
* Fixed TextArea cursor position values.
* Added LOSTFOCUS events to TextField and TextArea.
* Added Window activate, minimum size.
* Added Radio/Check button action events, and state/change.
* Added keymappings. Enabled Button and Menu HotKey support.
* Added Label alignment.
* Added Text Field/Area clipboard support.
* Added HTMLView navigation.
* Added Window State().
* Added TextArea SetStyle. Fixed some TextArea cursor position issues.


0.93
Version Date : 12 Feb 2007
Version Summary :
* Implemented utf-8/unicode support. Strings into and out of Qt are converted on the fly.
* Added hack for setting client width/height for windows created hidden...
* Reworked Toolbar code. Added tooltips.
* Added node open/close events for TreeView.
* Added TreeView SELECT, ACTION and MENU events.
* Added tab sizing to TextArea.
* Added Window max/min/restore methods.
* Added gadget SetTextColor().
* Added RequestFile dialog.
* Panel mouse events now record button.
* Fixed gadgetmap not storing correct values.
* Added Toolbar events. Implemented Toolbar toggle support.


0.92
Version Date : 9 Feb 2007
Version Summary :
* Fixed Font dialog crash.
* Added setFont to gadgets.
* Added LoadGuiFont.
* Added PANEL_GROUP support.
* Added ComboBox ClearListItems() and RemoveListItem().
* Added ListBox ClearListItems().
* Added RequestDir dialog.
* Fixed menuitem SetSelected to remember checked status.


0.91
Version Date : 8 Feb 2007
Version Summary :
* Added window Menu support.
* Added Enable/disable of gadgets.
* Fixed iconstrip image issues.
* Fixed listbox doubleclick out of bounds error.
* Added basic HTMLView support using QTextBrowser. Local pages only.


0.90
Version Date : 6 Feb 2007
Version Summary :
Initial Release.

As usual.. lots working, lots not.
Main issue as of this release are CRASHING menus. That is, any app with a menu *will* crash, guaranteed.

Other than that, most gadgets are working, with the exception of the currently unimplemented Stepper, Canvas and HTMLView.
Toolbar icons appear corrupted. General icon support not implemented yet.
Not all events caught on tree view.
TextArea doesn't support styles.



SebHoll(Posted 2007) [#6]
Hi Brucey,

I have never heard of Qt before and so did a Google search for it. It came up with the following website but the toolkit costs $1000s of dollars.

Is this the right website/product I'm looking at?


Cheers


Seb


Brucey(Posted 2007) [#7]
Aye, but they do an open-source GPL version that you can download too.

There's a Windows binary you can download from HERE.
Specifically, go for the ...mingw.exe installer.

For Linux, the source is available HERE.
For Mac, the source is available HERE.

FYI, the KDE gui is built on top of Qt...
(in the same way that Gnome is built on top of GTK)


They do a "dual-license" thing. You can use the GPL license if you are happy having the source to your code available. For closed-source stuff, you would use their commercial license, which would require you looking at the product prices page on their site ;-)

:o)


Brucey(Posted 2007) [#8]
Updated... See first post for details.


Brucey(Posted 2007) [#9]
Another update... still plenty to do, but it's usable in places... ;-)


Brucey(Posted 2007) [#10]
Yet another update...

Alas, it seems that syntax-highlighting in the IDE is mind-numbingly slow... (which is quite the understatement).

And I've no idea how to go about making it faster.

So, if anyone has any bright ideas... :-/


Brucey(Posted 2007) [#11]
Fear not... after much investigation and reading of APIs and browsing Qt's own syntax highlighter code, I worked out what I was doing wrong.
I am happy to say that now, at least on Windows, it is faster than the default IDE highlighter ;-)

Oh well, back to working on less interesting stuff...


Brucey(Posted 2007) [#12]
Here we are then... the latest 0.95 release is working much better.

Here's a wee screeny showing my Locale module utility app running in KDE.


TextArea syntax-highlighting is very speedy indeed now. (I imagine it's even faster with a good lexer ;-)

Started work on the Canvas. It appears to be drawing on the widget, but flickers like mad. (so be warned people with epilepsy !!)
I've dropped it onto a QGraphicsView, which may, or may not be, a good idea. I think the flicker is from the view laying it's own graphics onto the widget too... but who knows...

And yes, it all appears to function identically on all three platforms. (so if you find a bug on one, it's likely to be on the rest too)


Brucey(Posted 2007) [#13]
If anyone is interested, I seem to have fixed the Canvas flicker problem on Windows... (after a lot of googling and browsing of the Qt source to see where I was going wrong).
Will check that both Linux and Mac are also now working, tonight.

Outstanding (biggish) issues :

No Panel pixmaps
No event trapping on Canvas
No scroll-wheel event trapping
No Stepper
...and maybe some other stuff I've missed.

If anyone gets around to trying this (on any platform), some feedback would be quite welcome.


Nigel Brown(Posted 2007) [#14]
Brucey, Great to see yet another BIG module coming to BlitzMAX. Downloaded your module from the link above and also the MINGW version of QT. "qt-win-opensource-4.2.2-mingw.exe"

During the Installation procedure I get "There is a problem with your MinGW installation: The installer could not find a valid C:\MinGW\include\w32api.h (The supported version is 3.2)
Do you still want to continue?(Your installation may not work)


Brucey(Posted 2007) [#15]
Oh yeah... forgot to mention that. Tell it to continue... and all seems to work fine.
You may see an "Info:" during compilation of the app (I get it), but it's harmless.

I'll update the HOWTO at the top to mention the warning on the windows install...


Nigel Brown(Posted 2007) [#16]
Next problem, HOWTO links to BMK broken.


klepto2(Posted 2007) [#17]
me too, after adding your modification to bmk, BMax doesn't link anything. everytime I get linker errors. also modulebuilding etc. doesn't work with your modification.

I'm really interrested in seeing this in action.


Brucey(Posted 2007) [#18]
The link is: http://blitzmax.com/Community/posts.php?topic=66962
Depending on how you are logged in, it might need to be : http://blitzbasic.com/Community/posts.php?topic=66962

I'll make a modified working exe of bmk available from the Tweaks section...

Download available in the Tweaks section here: http://blitzmax.com/Community/posts.php?topic=67519


Nigel Brown(Posted 2007) [#19]
Brucey, still get "ERROR:Internal error" from the tweaks section?

Fixed by logging-in to that section.


Brucey(Posted 2007) [#20]
Sorry.... is posted in Tweaks because it is a "Private" forum, and I include links to Max-derived source code..

:-)


Nigel Brown(Posted 2007) [#21]
after a little copying of dlls into the examples folder SUCCESS! I get this:

Info: resolving __ZN7QString16codecForCStringsE by linking to __imp___ZN7QString16codecForCStringsE (auto-import)

but as everything so far is working guess I should not be concerned.

The glcube demo flickers badly? Gusee there will have been a fix by now though :-)


Brucey(Posted 2007) [#22]
The glcube demo flickers badly?

Fixed for the next release.
It's also working mostly fine on Linux too, except when the window is resized - hopfully I only need to implement a different event and make Max redraw the canvas...

On the same note, it turns out that Qt/Mac uses Carbon to draw all it's widgety stuff, which for now means that the Canvas won't work on Mac - not until I can find a way to either get Qt to let me use Cocoa on a widget, or create a modified version of GlGraphics to expect an HIView instead of an NSView... (any ideas on that Mr Skid?? ;-)

Btw, on Windows, you can avoid having to copy the dlls by adding to your PATH environment variable: C:\Qt\4.2.2\bin (or where you installed it).


Nigel Brown(Posted 2007) [#23]
Everyone that has complained about the inability to use color with labels should now sit up and look at this module as a serious replacement for the BlitzMAX GUI.

Local label:TGadget = CreateLabel("A plain label",10,10,280,52,window)
SetGadgetTextColor(label,255,255,255)
'SetGadgetColor(label, 255,0,0)


It would still seem there are some limitations, as you cannot change the text color of a label and then the background color because the second changes the first! But when you change themes the newly set background color remains. If I had this module a month ago it would have changed my current apps look considerably.


Brucey(Posted 2007) [#24]
It would still seem there are some limitations, as you cannot change the text color of a label and then the background color because the second changes the first!

I may be able to fix that... leave it with me and I'll have a look into it.

There's only so many combinations of things one can test (or think of testing) against... which is where "live" testing helps immensely :-)

UPDATE - Fixed for the next release ;-)
Turns out I was using a "new/blank" widget palette on each colour change, rather than getting the current palette and modifying it. (put this down to my 3 weeks of C++ experience...)


Nigel Brown(Posted 2007) [#25]
Just compiled the last application I released there are a few things that have problems:

1. Canvas attached to panel fails to appear. Or appear as white area.
2. SetWindowFunc() seems not to get messages passed to it.
3. Treeview fails to attach icons using SetGadgetIconStrip(tree,strip)
4. Cannot create a window without furniture.
5. Unable to set icon in top left of window.
6. Bubble help, no longer works.

Is there scope for additional gadgets? One of things I have not been able to do is a delay bar similar to a progress bar but under windows just scrolls 5-6 squares accross the bar and on Apple produces a barberpole.


Brucey(Posted 2007) [#26]
1. will look into it.
2. maybe I missed something... what's SetWindowFunc() ?
3. not yet implemented :-)

I'm hoping once I reach 1.00 most of the mess will be sorted out (with the likely exception of Mac Canvas)

As far as new gadgets... how about I change the progress bar so that if you set the style parameter to say, 1, you get a delay bar style instead of the usual progress bar. (at the moment, progress bars ignore style).
Of course, this would make it fixed to that on creation - unless I implemented more stuff to allow you to switch between the two..

Am open to ideas. And this one would actually be very useful for MaxGUI generally.


Nigel Brown(Posted 2007) [#27]
Sorry, there's me assuming prior knowledge again. Have added a couple more to the list above. It would seem whenever a direct call to windows is involved things go wrong i.e. window icons, additional message handler, adding help balloons. I use the SetWindowFunc() to monitor when a USB key has been added or removed.

    OldWindowFunc = SetWindowFunc( main_window, WindowFunc )


Function SetWindowFunc:Int( window:TGadget, newfunc:Int( hwnd:Int, msg:Int, wparam:Int, lparam:Int))
	Local hwnd:Int = QueryGadget( window, QUERY_HWND)
	Local oldfunc:Int = GetWindowLong( hwnd, GWL_WNDPROC)
	SetWindowLong( hwnd, GWL_WNDPROC, Int(Byte Ptr newfunc))
	Return oldfunc
EndFunction


Function WindowFunc:Int( hwnd:Int, msg:Int, wparam:Int, lparam:Int) "Win32"

	Local hdr:Int Ptr = Int Ptr(lparam)

	Select msg

		Case WM_DEVICECHANGE

		' this MUST be handled, otherwise MaxGUI freezes on window close.
		Case WM_DESTROY
			SetWindowLong( hwnd, GWL_WNDPROC, OldWindowFunc)
	EndSelect
    Return CallWindowProc( OldWindowFunc, hwnd, msg, wparam, Int(lparam))
End Function



Nigel Brown(Posted 2007) [#28]
Brucey, The delay bar as a style would be perfect. For a pre 1.0 release this is looking so very good already.


Ratchet(Posted 2007) [#29]
Hi,
I'm really interested to use this mod! I try to get it to run in Windows, but if I try to compile one of your samples I got this:

Building createbutton
Compiling:createbutton.bmx
flat assembler  version 1.66
3 passes, 2149 bytes.
Linking:createbutton.exe
Info: resolving __ZN7QString16codecForCStringsE by linking to __imp___ZN7QString16codecForCStringsE (auto-import)
D:/Anwendungen/BlitzMax/mod/bah.mod/qtmaxgui.mod/qtmaxgui.release.win32.x86.a(qtgadget.bmx.release.win32.x86.o)(data+0x16c): undefined reference to `_brl_maxgui_TGadget_SetBGStyle'
D:/Anwendungen/BlitzMax/mod/bah.mod/qtmaxgui.mod/qtmaxgui.release.win32.x86.a(qtgadget.bmx.release.win32.x86.o)(data+0x328): undefined reference to `_brl_maxgui_TGadget_SetBGStyle'
D:/Anwendungen/BlitzMax/mod/bah.mod/qtmaxgui.mod/qtmaxgui.release.win32.x86.a(qtgadget.bmx.release.win32.x86.o)(data+0x4e4): undefined reference to `_brl_maxgui_TGadget_SetBGStyle'
D:/Anwendungen/BlitzMax/mod/bah.mod/qtmaxgui.mod/qtmaxgui.release.win32.x86.a(qtgadget.bmx.release.win32.x86.o)(data+0x6c0): undefined reference to `_brl_maxgui_TGadget_SetBGStyle'
D:/Anwendungen/BlitzMax/mod/bah.mod/qtmaxgui.mod/qtmaxgui.release.win32.x86.a(qtgadget.bmx.release.win32.x86.o)(data+0x888): undefined reference to `_brl_maxgui_TGadget_SetBGStyle'
D:/Anwendungen/BlitzMax/mod/bah.mod/qtmaxgui.mod/qtmaxgui.release.win32.x86.a(qtgadget.bmx.release.win32.x86.o)(data+0xa54): more undefined references to `_brl_maxgui_TGadget_SetBGStyle' follow
Build Error: Failed to link D:/Anwendungen/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/createbutton.exe
Process complete


I got no idea where's the problem. I've done everything from your HOWTO.
Maybe you can help?

I hope I get it to work on Linux this evening....


Brucey(Posted 2007) [#30]
Do you have the MaxGUI module?
It won't work without it. (This is a GUI module for MaxGUI)


Ratchet(Posted 2007) [#31]
Yes I have MaxGUI.


Nigel Brown(Posted 2007) [#32]
Here is some example code than will run from the tests folder.

Try removing the framework and uncommenting the win32maxgui you will see the differences.

Strict 

Framework bah.qtmaxgui
'Import	 brl.win32maxgui

Import		brl.d3d7max2d

Local window:TGadget
Local panel:TGadget
Local panel2:TGadget
Local group:TGadget

Global image:TPixmap
Global canvas:TGadget

window=CreateWindow("My Window",140, 140, 320, 240)
AddHook EmitEventHook, MyHook

' create a purple panel that occupies entire window client area
panel=CreatePanel(0,0,ClientWidth(window),ClientHeight(window),window,PANEL_ACTIVE|PANEL_BORDER)
SetGadgetLayout panel,1,1,1,1
SetPanelColor panel,100,0,200

panel2=CreatePanel(10,10,114,87,panel,0)

image:TPixmap = LoadPixmapPNG( "bmax120.png" )
Assert image, "Unable to load image"
SetPanelPixmap(panel2,image)

canvas = CreateCanvas(134,10,114,87,panel)

While True
	WaitEvent 
	Print CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select
Wend

Function MyHook:Object( iId:Int, tData:Object, tContext:Object )

	Local event:TEvent=TEvent(tData)
	If event = Null Return Null

	Select event.ID

		Case EVENT_GADGETPAINT

			If event.source = canvas
				SetGraphics CanvasGraphics(canvas)
				SetClsColor(Rnd(255),Rnd(255),Rnd(255))
				Cls
				Flip
			EndIf

	EndSelect

	Return tData

End Function



Ratchet(Posted 2007) [#33]
With Win32maxGUI it compiles and runs fine. Still the same messages if I'm using QTMaxGUI.


Brucey(Posted 2007) [#34]
@Ratchet, if you have Mingw installed, maybe you could try a Modules build (ctl-D).
I think perhaps the windows libs are out of sync with the source - maybe.

@Nigel, Qt has the Win32 function :
bool QWidget::winEvent ( MSG * message, long * result )

which might be of use to your WindowFunc stuff.
This special event handler can be reimplemented in a subclass to receive native Windows events which are passed in the message parameter.
In your reimplementation of this function, if you want to stop the event being handled by Qt, return true and set result to the value that the window procedure should return. If you return false, this native event is passed back to Qt, which translates the event into a Qt event and sends it to the widget.


The trouble you are having with doing direct windows stuff is that Qt abstracts it away and only exposes bits and pieces.

Am also not entirely sure what the bubble help stuff is that you mention. I'm generally better with Linux/Mac platforms :-/

In the GTK module I added a SetAppIcon(pix:TPixmap) function. I was considering adding it to Qt as well - as it's easy to implement.


Brucey(Posted 2007) [#35]
... QueryGadget isn't implemented yet... perhaps that too is causing you problems, Nigel. (Added to my list ;-)


Ratchet(Posted 2007) [#36]
It looks like my MinGW installation is totally broken. I even can't compile the modules because most header files (like ctypes.h) can not be found. I now have installes MinGW and BM on a other PC. I have to recompile your QT module and it workes fine now. So my dream since BM released becomes within reach: Using BM to write QT apps under linux. I hope I get it to work on my SuSE system :)
Thanks Brucey, you're always making the best mods! *thumbs up*


Ratchet(Posted 2007) [#37]
Hi guys,
I tried to compile the mod on openSuSE 10.2. I really don't know what the following error is meaning:

Building Modules
Compiling:qtglue.cpp
/tmp/cc03nlvb.s: Assembler messages:
/tmp/cc03nlvb.s:2301: Error: suffix or operands invalid for `xchg'
Build Error: failed to compile /home/vanyanie/bin/blitzmax/mod/bah.mod/qtmaxgui.mod/qtglue.cpp
Process complete


Do you have an idea?


Brucey(Posted 2007) [#38]
Yet another release - 0.96.

Fixes a lot of issues with Canvas, amongst other things.
Still no Mac Canvas support (see my worklog for details - link in top post).

Still to do (that I can think of at the moment) :
* Key support on active panel and canvas
* Panel pixmaps
* Stepper (you'd think I'd been putting this off, or something)
* Proper file:/// support on the HTMLView (perhaps http too, if I can work out how)
* Popup Menus!


Brucey(Posted 2007) [#39]
Ratchett,

I assume that is a 32bit SuSe?

Also, I take it you have compiled and installed Qt 4.2.2 ? (Trolltech don't provide binaries for Linux/Mac on their site)

Usually, only Qt 3.x is installed on a Linux distro - and I decided not to build the module against 3.x because it's out of date now and there is better cross-platform support on 4.x

I searched Google for ideas of your problem, but didn't come up with much.
All I know is that I compiled and installed on my FC6 box and it works great.


LarsG(Posted 2007) [#40]
I just wanted to say that I'm amazed by the amount of work you're putting into this, Brucey..

I'm pretty sure that both Skidracer/BRL, and the community in general, appreciate all your hard work and effort.. :)

Thanks.. :)


Ratchet(Posted 2007) [#41]
It's a 64bit SuSE but I have installed all 32bit stuff, too. BlitzMax compiles without problems.
And yes, I've downloaded QT 4.2.2, compiled and installed without errors.
I've searched Google too - there are not really any helpfully information :(


Brucey(Posted 2007) [#42]
Make sure your Qt is compiling for 32 bit, otherwise the two (max and qt) won't work together - you cannot mix 32bit and 64bit code.

For compiling, it should be using the -m32 flag (if I'm not mistaken). I know that stuff we build at work on 64bit SuSe 9 defaults to 64bit if the compiler flag isn't used.


@ Lars
Thanks :-) I enjoy the challenge mostly (that and banging ones head off the desk when you realise that a bug that has pestered you for 4 hours turns out to be a typo somewhere else ;-)


Nigel Brown(Posted 2007) [#43]
Just checked 0.96, looking better again. Is there a way to stop start the new BUSY style on progress bar?

you may want to check CountTreeViewNodes() seems to return zero always.


Brucey(Posted 2007) [#44]
Is there a way to stop start the new BUSY style on progress bar?

I'll see what I can do.

Thanks :-)


Nigel Brown(Posted 2007) [#45]
Oops just noticed something else, open a menu from a menu bar click somewhere other than on the menu or indeed on the menu itself. Now move all windows away from where the menu was open and I have menus left on the backdrop. Persistent until I quit the application.


Brucey(Posted 2007) [#46]
That's strange.
Whenever I click somewhere other than the menu, it always closes. Any chance of a very small example and instructions for repeating it?


Nigel Brown(Posted 2007) [#47]
Using the example createmenu.bmx. Run application, move to a clear part of the desktop. Click file menu then click on the window but not on the menu. Menu closes, now move the window to uncover the desktop it obscured. The file menu still persists.


Brucey(Posted 2007) [#48]
Hmmm... perhaps it is a Qt bug on the version of Windows you are running. On my Win2k here, it doesn't seem to do it.


Ratchet(Posted 2007) [#49]
Are you still working on it Brucey?


Brucey(Posted 2007) [#50]
I are indeed.

After a "wee" break (during which time I hacked together some other modules... RegEx, Format, Database & 6 drivers), I've come back to it and done a bit more work.

For the latest version details, see the first post here.

Interestingly for me, to get the Panel Pixmap stuff working, I ended up porting my Max-only code from the GTK module to C++ for it to work on Qt, given that most of the "working" code for this module is written in C++.

Enjoy,

C++ noob

:-)


Ratchet(Posted 2007) [#51]
I've compiled MAXIDE with your Qt module. Everything looks fine but there is one bug: Open the IDE Option menu. Then move your mouse over one of the buttons. The window closes, the font dialog opens, depending on wich button you move the cursor. Strange.


skidracer(Posted 2007) [#52]
Recent versions of MaxIDE include fix for this (~line 5962):
		If activerequester
			Select event
				Case EVENT_MOUSEENTER,EVENT_MOUSELEAVE,EVENT_GADGETLOSTFOCUS
					Return
			End Select
'			DebugLog CurrentEvent.ToString()
			activerequester.Poll
			Return
		EndIf




Ratchet(Posted 2007) [#53]
@skid: Do you mean the normal or the CE version of the IDE?


Brucey(Posted 2007) [#54]
Both, probably.

The issue is I added extra events to buttons, and the requesters in the IDE only expect a button to raise an Action event, and hence don't even check for Action events before "actioning"...

so it's all my fault, I guess ;-)


Mark Tiffany(Posted 2007) [#55]
Should now be fixed in the source of the CE version (maxide and maxide2 code branches), although untested with qt.

Skid's fix is a little hacky for my tastes, in that it's deciding upfront what events to pass on to the event handler. I've implemented this in the CE version by fixing the code in the IDE Option event handling code to check the eventid (it wasn't! at all!) Admittedly, those events are the only interesting ones for now, but just in case...


#Reaper(Posted 2007) [#56]
Hi,

I have also some problems with your nice Module:

Building cooleffect
Compiling:cooleffect.bmx
flat assembler  version 1.67.21  (1520366 kilobytes memory)
4 passes, 33072 bytes.
Linking:cooleffect.debug.exe
C:/Programme/BlitzMax/lib/crtbegin.o(.text+0x0):crtstuff.c: multiple definition of `__do_sjlj_init'
C:/Programme/BlitzMax/lib/crtbegin.o(.text+0x0):crtstuff.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.text+0x240):crt1.c: multiple definition of `mainCRTStartup'
C:/Programme/BlitzMax/lib/crt2.o(.text+0x240):crt1.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.text+0x260):crt1.c: multiple definition of `WinMainCRTStartup'
C:/Programme/BlitzMax/lib/crt2.o(.text+0x260):crt1.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.text+0x280):crt1.c: multiple definition of `atexit'
C:/Programme/BlitzMax/lib/crt2.o(.text+0x280):crt1.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.text+0x2a0):crt1.c: multiple definition of `_onexit'
C:/Programme/BlitzMax/lib/crt2.o(.text+0x2a0):crt1.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.data+0x0):crt1.c: multiple definition of `_argc'
C:/Programme/BlitzMax/lib/crt2.o(.data+0x0):crt1.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.data+0x4):crt1.c: multiple definition of `_argv'
C:/Programme/BlitzMax/lib/crt2.o(.data+0x4):crt1.c: first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2c2c): multiple definition of `_bb_BITMAPINFO_Delete'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2c2c): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2b4d): multiple definition of `_bb_BITMAPINFO_New'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2b4d): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x0): multiple definition of `_bb_main'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x0): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2333): multiple definition of `_bb_tchunk_Delete'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2333): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2202): multiple definition of `_bb_tchunk_New'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2202): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2438): multiple definition of `bb_GetScreenCaptureHeight'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2438): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2404): multiple definition of `bb_GetScreenCaptureWidth'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x2404): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x626): multiple definition of `bb_Swapscreens'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x626): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x5c): multiple definition of `bb_canvas'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x5c): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x246c): multiple definition of `bb_getpixmapfromwindow'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(code+0x246c): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x24): multiple definition of `bb_height'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x24): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x30): multiple definition of `bb_hwnd'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x30): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0xa8): multiple definition of `bb_image'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0xa8): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x7c): multiple definition of `bb_pixmap'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x7c): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x8c): multiple definition of `bb_topixmap'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x8c): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x18): multiple definition of `bb_width'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x18): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x50): multiple definition of `bb_window'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/cooleffect.bmx.console.debug.win32.x86.o(data+0x50): first defined here
Build Error: Failed to link C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/cooleffect.debug.exe
Process complete

(I tried to run your cooleffect.bmx)

Yeah...
Maybe my MinGW is newer than it should be?
I also have to "comment" the Win32MaxGUI-Module, because it also cause errors.. :(
But I could compile your Module.. :-/
If you could help me, that would be nice :)

Thank your very much! :)

grettings :)
#Reaper


Brucey(Posted 2007) [#57]
I don't think the cooleffect one is working.... but the others should be okay.


#Reaper(Posted 2007) [#58]
Mmm.. no, other examples don't work, too :(

Building glcube
Compiling:glcube.bmx
flat assembler  version 1.67.21  (1607702 kilobytes memory)
3 passes, 12211 bytes.
Linking:glcube.debug.exe
C:/Programme/BlitzMax/lib/crtbegin.o(.text+0x0):crtstuff.c: multiple definition of `__do_sjlj_init'
C:/Programme/BlitzMax/lib/crtbegin.o(.text+0x0):crtstuff.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.text+0x240):crt1.c: multiple definition of `mainCRTStartup'
C:/Programme/BlitzMax/lib/crt2.o(.text+0x240):crt1.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.text+0x260):crt1.c: multiple definition of `WinMainCRTStartup'
C:/Programme/BlitzMax/lib/crt2.o(.text+0x260):crt1.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.text+0x280):crt1.c: multiple definition of `atexit'
C:/Programme/BlitzMax/lib/crt2.o(.text+0x280):crt1.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.text+0x2a0):crt1.c: multiple definition of `_onexit'
C:/Programme/BlitzMax/lib/crt2.o(.text+0x2a0):crt1.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.data+0x0):crt1.c: multiple definition of `_argc'
C:/Programme/BlitzMax/lib/crt2.o(.data+0x0):crt1.c: first defined here
C:/Programme/BlitzMax/lib/crt2.o(.data+0x4):crt1.c: multiple definition of `_argv'
C:/Programme/BlitzMax/lib/crt2.o(.data+0x4):crt1.c: first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/glcube.bmx.console.debug.win32.x86.o(code+0x0): multiple definition of `_bb_main'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/glcube.bmx.console.debug.win32.x86.o(code+0x0): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/glcube.bmx.console.debug.win32.x86.o(code+0x7fa): multiple definition of `bb_DrawSizeCube'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/glcube.bmx.console.debug.win32.x86.o(code+0x7fa): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/glcube.bmx.console.debug.win32.x86.o(data+0x10): multiple definition of `bb_ax'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/glcube.bmx.console.debug.win32.x86.o(data+0x10): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/glcube.bmx.console.debug.win32.x86.o(data+0x18): multiple definition of `bb_ay'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/glcube.bmx.console.debug.win32.x86.o(data+0x18): first defined here
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/glcube.bmx.console.debug.win32.x86.o(data+0x20): multiple definition of `bb_tim'
C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/.bmx/glcube.bmx.console.debug.win32.x86.o(data+0x20): first defined here
Build Error: Failed to link C:/Programme/BlitzMax/mod/bah.mod/qtmaxgui.mod/tests/glcube.debug.exe
Process complete



Could this be because of MinGW?


Brucey(Posted 2007) [#59]
Do you have GUI build enabled?
Not sure what those "crt" objects are, but you shouldn't get multiple definitions of those things unless the compile itself is going wrong somewhere...

Perhaps do a non-quick build of the app ?
Also, rebuilding of modules might help too...


#Reaper(Posted 2007) [#60]
Mm.. GUI-App was disabled, but also with it enabled and Quick-Build disabled, the same :(
Could it be because of Qt version 4.3.0? Or maybe I have done something wrong with the bmk(.exe)? Because with it I also can't start my own Code... :-/ :O It's more or less the same..
Maybe you could send me your bmk.exe then? *shameonme*


SebHoll(Posted 2007) [#61]
I know this a Linux discussion thread, but I'm trying to get your QT module to work on Windows. The modules build fine, and so does the project I import it to, however as soon as it executes, I get a message box saying...

Unable to locate component

This application failed to start because QtCore4.dll was not found. Re-installing the application may fix the problem.


Any ideas?


Ratchet(Posted 2007) [#62]
The QtCore4.dll is in the bin directory of QT (ie C:\Qt\4.2.2\bin). Add this path to your path environment variable or copy the dll to <Windows>\System32 (ie C:\Windows\System32) directory.


LAB[au](Posted 2007) [#63]
Didn't find QT 4.2.2 for win32, seems there is only the 4.3.0 available, obviously the module isn't compiling anymore.

So I just changed the name of the folder from 4.3.0 to 4.2.2 and guess what ... it works :)


Brucey(Posted 2007) [#64]
The module expects a certain folder structure.... perhaps it's easier to change the module rather than the folder name? :-)

Of course, it would be nicer not to have to expect a specific version... but I guess it's easier (for me at least) to say "I've only tested it with X version"...


#Reaper(Posted 2007) [#65]
Ok, I got it working now :)
(I put the Libs into the Lib-Folder of BMax... But now I have to use the DLL's of Qt, but no problem ;) )

Are you still working at this Qt-Module? :)


Nigel Brown(Posted 2011) [#66]
has this project come to an end Brucey?


Brucey(Posted 2011) [#67]
Better to use fltk for MaxGui, I'd imagine.