View Full Version : Cross Application Programming in QT

21st October 2008, 03:07

I've been weeding through the documentation for a while now, and I noticed that QT supports what they call UCOM, which is basically an adherence to the COM protocol for allowing inter-process communication, but I wanted to know from actual QT developers what they thought would be the best way to approach my problem is.

Basically what I have to develop is an application that keeps a track of the types of video that you play on your computer.

So like if you're watching DVD's, or downloading some season of some TV shows, it'll store it in a history tracker.

So the model I wanted to follow was this:

A) Have a listener application that exposes an interface for logging when you watch video content on your computer

B) Create plugins for every major media player - Windows Media Player, Winamp, VLC, QuickTime, ZoomPlayer, etc., and then use those media players' API's to notify the listener application that you're watching something

Being that VLC and WMPlayer can be on different OS's, I figured QT would be the best route to go.

But what's the best way to let the plugin on VLC notify the listener application that you're watching something? My gut instinct is COM, but I don't want to develop Windows-specific software.

Also - I'm not sure if QT allows you to do Windows COM in the open source edition.

Thanks in advance for your input!

21st October 2008, 08:24
Have a look into QtDBus
(There is (was?) work ongoing to bring DBus to windows as well. Don't know about its state, though.)

21st October 2008, 09:31
Qt allows you to use everything you want. You simply won't get ActiveX support directly in Qt but you can still make COM calls. Anyway I'd suggest to use a solution based on shared memory.

22nd October 2008, 03:17
It looks like the best cross platform route would be sockets (I just noticed that great example after installing the binary version instead of building the source only) To my knowledge, I should be able to set a listener on the socket, and then any type of application can send information to that socket, regardless of language or platform, right?

22nd October 2008, 10:23
Yes, although this is both advantage and disadvantage. It depends what you want really... If you want to provide some service for other application, a more high-level approach such as xml-rpc could be better.

22nd October 2008, 14:38
I'd look into what the last.fm scrobbler (http://www.audioscrobbler.net/development/client/)uses. It is open source, based on Qt and has the exact functionality you describe(for music, not videos).