0

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_())
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223

1 Answers1

2

I use something like this:

from PyQt4 import QtGui as qt
from PyQt4 import QtCore as qc

class MainWin(qt.QMainWindow):
    def setKeepAbove(self, above):
        if above:
            self.setWindowFlags(self.windowFlags() | qc.Qt.WindowStaysOnTopHint)
        else:
            self.setWindowFlags(self.windowFlags() & ~qc.Qt.WindowStaysOnTopHint)
saeedgnu
  • 4,110
  • 2
  • 31
  • 48
  • Thanks but I don't know how to modify my code (see the code in my new edit) despite of the many searchs on google or stackoverflow. – Gilles Quénot Nov 01 '11 at 14:24