![]() |
2010-02-21
, 22:30
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#2
|
![]() |
2010-02-22
, 00:12
|
Posts: 50 |
Thanked: 45 times |
Joined on Dec 2009
@ France
|
#3
|
![]() |
2010-02-26
, 10:46
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#4
|
![]() |
2010-03-22
, 12:45
|
|
Posts: 1,366 |
Thanked: 1,185 times |
Joined on Jan 2006
|
#5
|
if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) ui = MainWindow() ui.show() stackedwindow=MainWindow(ui) stackedwindow.show() app.exec_() sys.exit()
![]() |
2010-03-22
, 12:48
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#6
|
![]() |
2010-03-22
, 12:59
|
|
Posts: 1,366 |
Thanked: 1,185 times |
Joined on Jan 2006
|
#7
|
I work with C++ not python so I may BS here.
Can you not have your stacked window objects created inside your MainWindow or with some sort of Factory.
![]() |
2010-03-22
, 13:29
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#8
|
The Following User Says Thank You to attila77 For This Useful Post: | ||
![]() |
2010-03-22
, 15:51
|
|
Posts: 1,366 |
Thanked: 1,185 times |
Joined on Jan 2006
|
#9
|
class StackedWindow(QtGui.QMainWindow): def __init__(self, *args): apply(QMainWindow.__init__, (self, ) + args) self.setWindowTitle("Stacked Window") centralwidget = QtGui.QWidget(self) frame = QtGui.QFrame(centralwidget) verticalLayout = QtGui.QVBoxLayout(frame) pushButton = QtGui.QPushButton("Push Button 1", frame) verticalLayout.addWidget(pushButton) pushButton_2 = QtGui.QPushButton("Push Button 2", frame) verticalLayout.addWidget(pushButton_2) lineEdit = QtGui.QLineEdit(frame) verticalLayout.addWidget(lineEdit) lineEdit_2 = QtGui.QLineEdit(frame) verticalLayout.addWidget(lineEdit_2) self.setCentralWidget(centralwidget)
def on_actionPop_triggered(self): stackwindow =StackedWindow(self) stackwindow.show()
![]() |
2010-03-22
, 15:54
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#10
|
The Following User Says Thank You to noobmonkey For This Useful Post: | ||
somebody could post code example to do Qt Stacked Windows with python ?
I try to do a main window with 4 buttons. Each button must open a new window with 4 more buttons and a back arrow on top right to back to the first windows.