PDA

View Full Version : How can I use QX11Info to make a custom dock bar. (like KDE)



TheBigOnion
21st March 2012, 15:35
Hello,
I am programming on RHEL 6, using C++ and QT. I have created a custom dock bar with my own start button on the left and a clock on the right. My dock bar is created with a QWidget control.

So I have the basic application running. What I need to do now is figure out how to identify which applications are open so I can put some icons in the dock bar. And identify which one is active so I can make it's icon a "focus' icon. I also may need to know when an app is minimized.

Can someone please tell me a simple way of doing this? It seems to me that I should be able to get that info when my dock bar launches from the QX11Info class. Then I think I should be able to set up some type of event listener to capture "focus" events from the windows.

Any help would be greatly appreciated.

ChrisW67
22nd March 2012, 01:41
QX11Info tells you about the X11 environment that your application is running in. It tells you nothing about the processes running on the system and which, if any, have visible windows. AFAIK there are no Qt supplied methods to identify processes running on the system or to interrogate for other objects managed by the window manager. For this you will need to revert to native APIs. On Linux you may be able to get process information from the /proc file system, or by parsing the output of a well-crafted 'ps' command.