You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, June 22nd 2007, 10:10pm

Widget on Desktop

Hi, I programmed my own widget (inherits from QWidget) but I can't get it to display as I want. This widget has no parent.

Here is what I want:
- It should be displayed on the desktop (always if possible). This is the opposite of the "Always Stays On top" Property
- It shouldn't have an entry in the taskbar
- It shouldn't have a window frame (this is OK using self.setWindowFlags(QtCore.Qt.FramelessWindowHint))

I tried to tweak the widget properties and the window properties, here are my tests:
- self.setWindowFlags(Qt.FramelessWindowHint|Qt.Tool)
This has a taskbar entry...
- self.setWindowFlags(Qt.FramelessWindowHint|Qt.Tool|Qt.X11BypassWindowManagerHint)
This has not taskbar entry but it always displays on top... If I call "self.lower()" to put it at the background, it just disapears and calling "self.show()" doesn't help...
- self.setWindowFlags(Qt.FramelessWindowHint|Qt.ToolTip)
Same as the previous one... This has not taskbar entry but it always displays on top... If I call "self.lower()" to put it at the background, it just disapears and calling "self.show()" doesn't help...

I spent a lot of time trying to get the behaviour I want but I kinda stuck now... If anyone has an idea, please tell me :)

Note: I'm using Qt4 (pyQt4 in fact but it doesn't really matter).

n00b

Trainee

  • "n00b" is male

Posts: 118

Location: Germany

Occupation: Systemelektroniker

  • Send private message

2

Saturday, June 23rd 2007, 12:09pm

simply try
self.setWindowFlags(Qt.FramelessWindowHint|Qt.SubWidget)
and everything should be ok.
one question, do you want to draw your window frame by yourself?
if yes please tell me how you want to do this

3

Saturday, June 23rd 2007, 1:08pm

I'm pretty sure I already try it and it still had a taskbar entry. I'll try it again this afternoon just to be sure.

I'm painting the widget myself by redefining "paintEvent()". I'm creating a painter like this:
painter = QPainter(self)
then I paint my stuff.

But I'm not painting any window frame, this is a transparent widget and I don't want any window frame.

This post has been edited 1 times, last edit by "hydr0g3n" (Jun 23rd 2007, 2:21pm)


4

Saturday, June 23rd 2007, 2:52pm

not working

Well, I couldn't find any flag called "Qt.SubWidget" but there is a "Qt.SubWindow" one. I tried it but there is still a taskbar entry :(

I did this:
self.setWindowFlags(Qt.FramelessWindowHint|Qt.SubWindow)

Did you try it?

5

Sunday, June 24th 2007, 1:29am

Xlib?

I found some info on internet about Xlib. Apparently, it should be possible to disable the taskbar entry thanks to "_NET_WM_STATE_SKIP_TASKBAR".

I tried the following code:

from Xlib import display, xobject, X, Xatom

class myWidget(QtGui.QWidget):
def __init__(self, qApp, parent=None):
QtGui.QWidget.__init__(self, parent)
self.display = display.Display("0.0")
self.net_wm_state_skip_taskbar = self.display.intern_atom("_NET_WM_STATE_SKIP_TASKBAR")
self.net_wm_state = self.display.intern_atom("_NET_WM_STATE")
self.display.screen().root.change_property(self.net_wm_state, Xatom.ATOM, 32, [self.net_wm_state_skip_taskbar,], X.PropModeAppend)

However, I don't see any change with this code. Anyone knows what I'm doing wrong here?

GuS

Beginner

  • "GuS" is male

Posts: 9

Location: Argentina

  • Send private message

6

Thursday, August 16th 2007, 10:08pm

Hi there!!

I just wanted to reply this post cause is related to what i want to do in my Widget app.

What i want (and i think you've done it for what you said) is to eliminate QT background of my app and use as background a semi-transparent pixmaps, lets say, .png format.

Can you help me with this?

Thanks in advance!!
Gustavo A. Díaz
GDNet Projects
www.gdnet.com.ar

n00b

Trainee

  • "n00b" is male

Posts: 118

Location: Germany

Occupation: Systemelektroniker

  • Send private message

GuS

Beginner

  • "GuS" is male

Posts: 9

Location: Argentina

  • Send private message

8

Friday, August 17th 2007, 1:48pm

I know about those examples... but is CLEAR that i don't want to use composite.
Do you know about Superkaramba applets? it seems they use a kind of fake transparency or so but using semi-transparent pixmaps as background of the application, which is what i want to do.

if you have more tips i will be glad.

Thanks...
Gustavo A. Díaz
GDNet Projects
www.gdnet.com.ar

n00b

Trainee

  • "n00b" is male

Posts: 118

Location: Germany

Occupation: Systemelektroniker

  • Send private message

9

Friday, August 17th 2007, 1:57pm

superkaramba has to use compositing, i think. How should they fake it? why don't you look in the sourcecode?
for showing semi-transparent pixmaps semi-transparent you need compositing. i tried it without. doesn't work, whatever i do.

This post has been edited 1 times, last edit by "n00b" (Aug 17th 2007, 1:59pm)


GuS

Beginner

  • "GuS" is male

Posts: 9

Location: Argentina

  • Send private message

10

Friday, August 17th 2007, 2:32pm

Well my friend.. superkaramaba never use compositing...

So, the only way to not have the grey background and having a semi-transparent pixmap as app. background is using compositing? mmm...

By the way, I've asked to superkaramba developers too... so i am waiting...

Superkaramba applet example screenshot: http://opencoffee.lnxteam.org/downloads/…pletExample.png

Cheers...
Gustavo A. Díaz
GDNet Projects
www.gdnet.com.ar

This post has been edited 1 times, last edit by "GuS" (Aug 17th 2007, 2:33pm)


n00b

Trainee

  • "n00b" is male

Posts: 118

Location: Germany

Occupation: Systemelektroniker

  • Send private message

11

Friday, August 17th 2007, 3:12pm

hm, why are you sure karambe doesn't use compositing?

GuS

Beginner

  • "GuS" is male

Posts: 9

Location: Argentina

  • Send private message

12

Friday, August 17th 2007, 3:17pm

Are you kidding? i use KDE since its borns almost... and Superkaramba as well...
Superkaramba DOES NOT USE compositing.
Please search for info before asking me :)

Or install superkaramba (if you have linux....) and make sure you don't have anabled compositing on your desktop.... ;)


Cheers...
Gustavo A. Díaz
GDNet Projects
www.gdnet.com.ar