python - PyQt4: how to make undercorated window with reserved space -


i'd make panel-like application using pyqt4 linux. need window created:

  • to undecorated
  • to have reserved space
  • to appear on workspaces

from reading the documentation i've got idea should use qtwindowflags. have no clue how that. believe there should qt.windowtype hint somewhere telling wm window's "dock" application. have made pygtk following this thread, here qt don't know how handle this. (i need qt ability theme/skin application more easily.)

below current code made (nothing extraordinary).

import sys pyqt4 import qtgui  class panel(qtgui.qwidget): def __init__(self, parent=none): ## should qtwindowflag here?     qtgui.qwidget.__init__(self, parent) ## should qtwindowflag there well?      self.setwindowtitle('qtpanel')     self.resize(qtgui.qdesktopwidget().screengeometry().width(), 25)     self.move(0,0)  def main():     app = qtgui.qapplication(sys.argv)     panel = panel()     panel.show()     sys.exit(app.exec_())     return 0  if __name__ == '__main__':     main() 

can me this? :)

read qwidget.windowflags property: http://doc.qt.nokia.com/4.7/qwidget.html#windowflags-prop

example:

>>> pyqt4 import qtgui, qtcore >>> app = qtgui.qapplication([]) >>> win = qtgui.qmainwindow() >>> win.setwindowflags(win.windowflags() | qtcore.qt.framelesswindowhint) >>> win.show() 

Comments