【发布时间】:2011-04-29 08:07:33
【问题描述】:
我想使用 PyQt4 for Linux 制作一个类似面板的应用程序。为此我需要我创建的窗口:
- 未装饰
- 预留空间
- 出现在所有工作区
通过阅读the documentation,我知道我应该使用 QtWindowFlags。但我不知道如何做到这一点。另外我相信应该有一个 Qt.WindowType 提示告诉 WM 窗口是一个“停靠”应用程序。我在this thread 之后用pygtk 做了这个,但是用Qt 我真的不知道如何处理这个。 (我需要 Qt,因为它能够更轻松地主题/皮肤应用程序。)
下面是我当前编写的代码(没什么特别的)。
import sys
from PyQt4 import QtGui
class Panel(QtGui.QWidget):
def __init__(self, parent=None): ## should the QtWindowFlag be here?
QtGui.QWidget.__init__(self, parent) ## should the QtWindowFlag be there as 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()
谁能帮我解决这个问题?谢谢:)
【问题讨论】:
标签: python pyqt4 flags overlap borderless