PDA

View Full Version : appBar: allocated space problem



mito
21st February 2008, 15:22
Hi, I created a program (for windows) that docks a bar just over the windows bar (task bar). The problem is when I allocate the space to put the bar, it appears in the space that was reserved and then moves (by itself) to the middle of the screen.

The weird thing is if i put a QMessageBox in the code before the "move" statement, it works, I mean the bar stays in the place that was reserved.

Obviously i need the bar stays in the allocated space without any QMessageBox.

I attach here an example code.

PS: Mostly of this problem belong to windows API, may be this is not the correct forum, in that case, please tell me where can I post this topic.

mchara
27th February 2008, 06:30
Hi,
this problem occurs quite often,
try move your bar in showEvent - even if it won't help the movement woll be less visible.

mito
28th February 2008, 15:05
To resolve this problem, the following line is needed in widget constructor:
SetWindowLong(winId(), GWL_EXSTYLE, WS_EX_TOOLWINDOW);

Thanks.

jpn
28th February 2008, 18:18
To resolve this problem, the following line is needed in widget constructor:
SetWindowLong(winId(), GWL_EXSTYLE, WS_EX_TOOLWINDOW);
I guess passing Qt::Tool to QWidget constructor would do the same...

mito
29th February 2008, 12:17
I guess passing Qt::Tool to QWidget constructor would do the same...

Thanks, i tested this on MS Windows but didn't work.
This problem only happen on MS Windows, in Linux works great (with X11 API)