PDA

View Full Version : qdialog and taskbar



Michael_Levin
3rd May 2010, 14:21
hello!
i have some question that as i see appears many times, but nevertheless i can't find the solution for me.

i have some widget, and the button in it, and when i press this button i want to appear some other widget, frameless and not
showing in the taskbar.

i can achieve two results - frameless or 'taskbarless' =)

1 -frameless - everything is ok, but it of course appears in the taskbar

(code in PyQt4)

self.add_new_light_widget = QWidget()
self.add_new_light_widget.setWindowFlags(Qt.Window Flags(Qt.FramelessWindowHint))

2 - 'taskbarless' - now it is the dialog with the parent of main widget, so it doesbn't appears in the taskbar


self.add_new_light_widget = QDialog(self)
self.add_new_light_widget.setWindowTitle("About")
self.add_new_light_widget.setWindowFlags(Qt.Window Flags(Qt.Dialog))

but if i use
self.add_new_light_widget.setWindowFlags(Qt.Window Flags(Qt.CustomizeWindowHint)) (or frameless hint) my new widget will not show!

please help me - where am i wrong?
thank you!

Talei
3rd May 2010, 16:08
I don't use pyQt, but maybe this will help You. In Qt I do:


infoDialog* info = new infoDialog( this ); //parent here is important, that way qdialog don't show on task-bar
info->setWindowFlags( Qt::Dialog | Qt::WindowCloseButtonHint );//reset flags, to remove [?] icon, only [x] icon on window

Michael_Levin
5th May 2010, 12:46
thank you)
yes, parenting dialog helps avoiding the taskbar appearance, but in this case the title line with the close button is shown - and i want frameless widget =)
the solution i found is

self.add_new_light_widget.setWindowFlags(Qt.Window Flags(Qt.Tool)|Qt.WindowFlags(Qt.SplashScreen))