Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, May 2007
torn-off menu always hides beneath parent


Message 1 in thread

Hi,
	I have enabled tear-off menus in an application, but when the user 
clicks on the tear-off item at the top of the menu, the resulting menu 
window is behind the parent. Is there some way of forcing the torn-off 
menu window to stay on top of the parent?
Thanks

--
 [ signature omitted ] 

Message 2 in thread

John McClurkin wrote:
> Hi,
>     I have enabled tear-off menus in an application, but when the user 
> clicks on the tear-off item at the top of the menu, the resulting menu 
> window is behind the parent. Is there some way of forcing the torn-off 
> menu window to stay on top of the parent?
> Thanks

I should add that this occurs under Linux, kernel version 2.6.9-55. 
Under Windows XP, the torn off menus do stay on top of the parent. I'm 
using Qt V 4.2.3.

--
 [ signature omitted ] 

Message 3 in thread

On Thursday 17 May 2007, John McClurkin wrote:
> I should add that this occurs under Linux, kernel version 2.6.9-55.

Works for me (tested with 4.2.2). If you execute the attached code - does it 
work for you or same effect?

The kernel has (almost) nothing to do with GUI effects.

What version of X11 are you using? XFree or xorg? What does "X -version" 
output?

What window-manager do you use? twm, fvwm, kwm, xfce, etc.pp.? What version 
of it?

Does the same effect still occur if you (temporarily) use another window 
manager?

Does it always happen? (Eg. very old versions of kwm showed this problem 
after they've run for several weeks.)


	Konrad

PS.: please switch off your reply-to -- it is unnecessary since it is 
identical to your from. Plus it disrupts the reply function of many mail 
clients by preempting the list address.
#include <QMenu>
#include <QMenu>
#include <QMenuBar>
#include <QMainWindow>
#include <QApplication>

class MyWin:public QMainWindow
{
	public:
		MyWin();
};

MyWin::MyWin()
{
	QMenuBar *mb=menuBar();
	QMenu *m=mb->addMenu("&Blah");
	m->setTearOffEnabled(true);
	m->setTitle("BlahMenu");
	m->addAction("&Seier");
	m->addAction("&Exit",QApplication::instance(),SLOT(quit()));
}

int main(int argc,char**argv)
{
	QApplication app(argc,argv);
	MyWin w;
	w.show();
	return app.exec();
}
TEMPLATE = app
TEMPLATE = app
TARGET = menu
SOURCES = menu.cpp

Attachment:

Attachment: pgpH1iolMrCZn.pgp
Description: PGP signature


Message 4 in thread

Konrad Rosenbaum wrote:
> On Thursday 17 May 2007, John McClurkin wrote:
>> I should add that this occurs under Linux, kernel version 2.6.9-55.
> 
> Works for me (tested with 4.2.2). If you execute the attached code - does it 
> work for you or same effect?
> 
> The kernel has (almost) nothing to do with GUI effects.
> 
> What version of X11 are you using? XFree or xorg? What does "X -version" 
> output?
> 
> What window-manager do you use? twm, fvwm, kwm, xfce, etc.pp.? What version 
> of it?
> 
> Does the same effect still occur if you (temporarily) use another window 
> manager?
> 
> Does it always happen? (Eg. very old versions of kwm showed this problem 
> after they've run for several weeks.)
> 
> 
> 	Konrad
Hi Konrad,
	Thanks for the help. The problem was the window manager. It occurs with 
the metacity V 2.8.6 window manager. With kwin V 3.0, everything works 
as I expected. I haven't tried other window managers.
> 
> PS.: please switch off your reply-to -- it is unnecessary since it is 
> identical to your from. Plus it disrupts the reply function of many mail 
> clients by preempting the list address.
No problem.

> 
> 
> ------------------------------------------------------------------------
> 
> #include <QMenu>
> #include <QMenuBar>
> #include <QMainWindow>
> #include <QApplication>
> 
> class MyWin:public QMainWindow
> {
> 	public:
> 		MyWin();
> };
> 
> MyWin::MyWin()
> {
> 	QMenuBar *mb=menuBar();
> 	QMenu *m=mb->addMenu("&Blah");
> 	m->setTearOffEnabled(true);
> 	m->setTitle("BlahMenu");
> 	m->addAction("&Seier");
> 	m->addAction("&Exit",QApplication::instance(),SLOT(quit()));
> }
> 
> int main(int argc,char**argv)
> {
> 	QApplication app(argc,argv);
> 	MyWin w;
> 	w.show();
> 	return app.exec();
> }
> 
> 
> ------------------------------------------------------------------------
> 
> TEMPLATE = app
> TARGET = menu
> SOURCES = menu.cpp

--
 [ signature omitted ]