Ich habe eine QMidare in der soll noch ein zweites Fenster geöffnet werden
es wird beim Start eins geöffnet allerdings nicht beim Klicken auf den Button in der Toolbar
Code: Alles auswählen
from PySide.QtCore import *
from PySide.QtGui import *
from Start_window import *
class main_window(QMainWindow):
def __init__(self):
super(main_window, self).__init__()
self.resize(1200,900)
self.move(0,0)
self.setWindowTitle(' - Schaltanlagenkalkulationstool')
self.setWindowIcon(QIcon('gfx\icon.png'))
self.mdiArea = QMdiArea()
self.mdiArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.mdiArea.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.setCentralWidget(self.mdiArea)
self.windowMapper = QSignalMapper(self)
self.createToolBars()
def home_(self):
homechild=start_window()
self.mdiArea.addSubWindow(homechild)
self.mdiArea.activeSubWindow()
def createToolBars(self):
'EXIT'
self.exitToolBar = self.addToolBar("Exit")
self.exit = QAction(QIcon('gfx\exit.png'), 'Exit', self)
self.connect(self.exit, SIGNAL('triggered()'), SLOT('close()'))
self.exitToolBar.addAction(self.exit)
'EXIT END'
homeToolBar = self.addToolBar('Home')
home = QAction(QIcon('gfx\new.png'), 'HOME', self)
homeToolBar.connect(home, SIGNAL("triggered()"), self.home_())
homeToolBar.addAction(home)
Code: Alles auswählen
import sys, os
from PySide.QtCore import *
from PySide.QtGui import *
class start_window(QDialog):
def __init__(self, parent=None):
QDialog.__init__(self, parent)
'Window Anpassung'
self.resize(1000,800)
self.setMinimumSize(1000,800)
self.setMaximumSize(1000,800)
self.setStyleSheet('background: white')
self.setWindowTitle('Schaltanlagenkalkulationstool')
self.setWindowIcon(QIcon('gfx\icon.png'))
self.creategfx()
self.createbuttons()
label = QLabel(self)
label.setGeometry(0,150,self.width(), 150)
label.setFont(QFont('Times',30, QFont.Bold))
label.setStyleSheet('background: #87CEFA') #0188CC
label.setText('Kalkulationstool - Schaltanlage')
label.setAlignment(Qt.AlignHCenter| Qt.AlignCenter)