PDA

View Full Version : QDialog as Qt::Tool on Mac



olidem
28th November 2009, 09:22
Hi!
At some point, my app opens a Dialog which contains controls to configure a tool. Ok. On wiondws this works just fine:


class MyToolDialog : public QDialog
{
//...
}

// in the main app:

MyToolDialog * d = new MyToolDialog(this, Qt::Tool);
d->setAttribute(Qt::WA_DeleteOnClose)
d->show();
d->raise();
d->activateWindow();

Now this makes the dialog stay on top, and the main widget is still accessible. As it should.


BUT
On my Mac, 10.5.something with Qt 4.5.3, the dialog does not stay on top.

Same code, same everything.

I also used this Qt::WA_MacAlwaysShowToolWindow, and I also tried to set Qt::WindowStaysOnTopHint explicitly, but still the dialog goes behind the main app as soon as I use the tool.

Thanks for yourhelp in advance
Olli

olidem
1st December 2009, 12:23
Hi, its me again.

I altered the MyToolDialog class to be a subclass of QWidget instead of QDialog now, but it does not change anything.

On Windows everything works fine, on Mac not.

Maybe this is a bug?

Thanks in advance,
Olli