[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] Loading a QMainWindow with uiloader
From: Angelo Compagnucci <angelo.compagnucci () gmail ! com>
Date: 2012-05-21 9:43:14
Message-ID: CA+TH9VnaGXnaLDSS4HQ_KKzbvkQp0gvqHSQMAM257aE8_dRF4Q () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi guys,
I have done this:
def setupUi(self, MainWindow):
loader = QUiLoader()
file = QFile("...")
file.open(QFile.ReadOnly)
centralwidget = loader.load(file, self)
centralwidget.setWindowFlags(Qt.Widget)
self.setCentralWidget(centralwidget)
It works, but the real centralWidget is nested into the main QMainWindow
centralWidget, so to set my own centralWidget, I have to do:
self.centralWidget().setCentralWidget(...)
There is a better way to load a QMainWindow from a ui file via QUiLoader?
Thank you!
--
Profile: http://it.linkedin.com/in/compagnucciangelo
[Attachment #5 (text/html)]
<div>Hi guys,</div><div><br></div><div>I have done \
this:</div><div><br></div><div><div>def setupUi(self, MainWindow):</div><div> \
loader = QUiLoader()</div><div> file = QFile("...")</div><div> \
file.open(QFile.ReadOnly)</div>
<div> centralwidget = loader.load(file, self)</div><div> \
centralwidget.setWindowFlags(Qt.Widget)</div><div> \
self.setCentralWidget(centralwidget)</div></div><div><br></div><div>It works, but the \
real centralWidget is nested into the main QMainWindow centralWidget, so to set my \
own centralWidget, I have to do:</div>
<div><br></div><div>self.centralWidget().setCentralWidget(...)</div><div><br></div><div>There \
is a better way to load a QMainWindow from a ui file via \
QUiLoader?</div><div><br></div><div>Thank you!</div><div><div><br></div>
-- <br>Profile: <a href="http://it.linkedin.com/in/compagnucciangelo" \
target="_blank">http://it.linkedin.com/in/compagnucciangelo</a><br> </div>
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic