GTK set_keep_above(True) 方法的 PyQt4 等效项是什么?
我想将 PyQt4 窗口保留在上方,就像使用 GTK 那样使用 set_keep_above(True) 。
这可能吗?
编辑 20111101:这是我的代码,我不知道如何强制窗口位于“上方”:
#!/usr/bin/python2
# -*- coding: utf8 -*-
import os, sys, signal
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
from PyQt4.QtScript import *
from PyQt4.QtNetwork import *
if os.path.exists(".forum_smileys_cache"):
pass
else:
os.mkdir(".forum_smileys_cache")
app = QApplication(sys.argv)
signal.signal(signal.SIGINT, signal.SIG_DFL)
webpage = QWebView()
webpage.setWindowTitle("forums smileys code")
manager = webpage.page().networkAccessManager()
diskCache = QNetworkDiskCache(webpage)
diskCache.setCacheDirectory(".forum_smileys_cache")
manager.setCache(diskCache)
webpage.show()
webpage.setGeometry(0,0, 300, 550)
webpage.resize(250,800)
webpage.load(QUrl("http://www.sputnick-area.net/smileys.html"))
sys.exit(app.exec_())
I would like to keep the PyQt4 window above like I do with GTK with set_keep_above(True).
Is that possible ?
Edit 20111101 : this is my code, I don't know how to force the window "above" :
#!/usr/bin/python2
# -*- coding: utf8 -*-
import os, sys, signal
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
from PyQt4.QtScript import *
from PyQt4.QtNetwork import *
if os.path.exists(".forum_smileys_cache"):
pass
else:
os.mkdir(".forum_smileys_cache")
app = QApplication(sys.argv)
signal.signal(signal.SIGINT, signal.SIG_DFL)
webpage = QWebView()
webpage.setWindowTitle("forums smileys code")
manager = webpage.page().networkAccessManager()
diskCache = QNetworkDiskCache(webpage)
diskCache.setCacheDirectory(".forum_smileys_cache")
manager.setCache(diskCache)
webpage.show()
webpage.setGeometry(0,0, 300, 550)
webpage.resize(250,800)
webpage.load(QUrl("http://www.sputnick-area.net/smileys.html"))
sys.exit(app.exec_())
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我用这样的东西:
I use something like this: