PDA

View Full Version : Qt's power



VireX
14th January 2007, 19:04
Hey,
I was wondering about what exactly does Qt have power over. For example, can it interact with windows such as making system icons on the system tray? Can it change the desktop background? Basically all this is possible with win32 api, but is it possible with Qt? Or is it possible to integrate them, such as use a bit of win32 api while using Qt?

jpn
14th January 2007, 19:27
For example, can it interact with windows such as making system icons on the system tray?
Yes, QSystemTrayIcon was introduced in Qt 4.2.


Can it change the desktop background? Basically all this is possible with win32 api, but is it possible with Qt?
That's pretty much desktop environment specific. Qt does not help you with this.



Or is it possible to integrate them, such as use a bit of win32 api while using Qt?
Sure, you can use win32 api if you want to. Qt uses it too.

VireX
14th January 2007, 20:53
Thanks for finding the Systemtray one, I was going over the list of classes and didn't see it.
I know Qt uses it too, however, sometimes using both at same time may cause problems I thought.

wysota
14th January 2007, 23:33
I know Qt uses it too, however, sometimes using both at same time may cause problems I thought.

There is no "using both". When programming for Windows eventually WinAPI calls are always made. Qt does its job on Windows using WinAPI, like all other toolkits/frameworks/APIs/etc. do. WinAPI is the API presented by Windows to the outside world (MFC also uses WinAPI and AFAIK .NET uses WinAPI as well).

VireX
15th January 2007, 01:39
I know that, I've had many years of Win API experience, but I'm saying they might have special things in place, that might cause problems when using both at same time. Since I haven't read the source code of Qt, and I haven't seen any program that uses both at same time, I was just asking to be sure.

sunil.thaha
15th January 2007, 13:23
As wysota had mentioned Qt uses Win32 Api. Your statement sounds like, Using Win32 with Win32 can create problems ? Can you be a little more precise ? Where exactly are you facing problems ?

VireX
15th January 2007, 22:10
I told you, I understood that now. I thought BEFORE that there could be a possibility that because it has abstracted the win api layer, it might change things, redefine things, that could conflict with the program flow of Qt. As I said, I haven't read the source code of Qt, so I don't know what kind of programming and changes they have done. NOW I understand, that there is no conflict, and it makes sense, I was just asking to be sure.

wysota
15th January 2007, 23:23
Actually you may encounter conflicts, altough they are rare. But the conflicts are caused by the WinAPI itself (for example Qt calls some method internally, so you can't call it again with different parameters yourself as it may break something else), I remember there was such an issue brought up (about threading? I'm not sure...) on the forum some time ago and it was probably caused by a situation I described above. But as I said - these cases are really rare (I've encountered only this one issue since I started dealing with Qt questions), so you shouldn't worry upfront.

VireX
16th January 2007, 00:58
Yeah that's what i was afraid of. But anyway I understand that it isn't a very common problem.