[PyQt] Fwd: Qt.SplashScreen

Sabroso Rico charolastra at outlook.com
Thu Sep 15 02:02:26 BST 2016


Greetings all, I am trying to implement maximize and minimize with a single button (my window has no title bar) but ovbiamente not know how to do this is what led until now. Please help


# -*- coding: utf-8 -*-
#############################
import sys
#############################
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.uic import *
from sinergia import *

class Mast(QMainWindow):
    """docstring for Raiz"""
    def __init__(self):
        super(Mast, self).__init__()
        QMainWindow.__init__(self)

        loadUi('ui/principal.ui', self)
        self.setWindowFlags(Qt.SplashScreen)

        self.minx.setCursor(Qt.PointingHandCursor)
        self.minx.setScaledContents(True)
        self.minx.setPixmap(QPixmap("img/min.ico"))

        self.maxb.setCursor(Qt.PointingHandCursor)
        self.maxb.setScaledContents(True)
        self.maxb.setPixmap(QPixmap("img/maxx.ico"))

        self.clos.setCursor(Qt.PointingHandCursor)
        self.clos.setScaledContents(True)
        self.clos.setPixmap(QPixmap("img/cierre.ico"))


        self.minx.mouseReleaseEvent = self.mini
        self.maxb.mouseReleaseEvent = self.maxx
        self.clos.mouseReleaseEvent = self.salir
#.........................................................................................
    def salir(self, event):
        sys.exit()

    def mini(self, event):
        self.setWindowState(Qt.WindowMinimized)

    def maxx(self, event):
        band = False
        if band:
            self.setWindowState(Qt.WindowMaximized)
            band = True
        else:
            self.setMinimumSize(900, 569)

            band = False



if __name__ == '__main__':
    app = QApplication(sys.argv)
    ap = Mast()
    ap.show()
    sys.exit(app.exec_())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160915/0bbac1e3/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Parte del mensaje adjunto
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160915/0bbac1e3/attachment.ksh>


More information about the PyQt mailing list