View Single Post
Old 08-22-2017, 03:48 PM   #33
SirBlurton
High School Varsity
 
Join Date: Feb 2007
I really like the direction you're taking with this project...very cool!
I've always struggled with coming up with clear mechanics, so I think the fact you have a sense for how you want the central gameplay to work sets you up for success.

To some extent, I find the coding "just happens", especially the GUI part. There are so many resources out there that you can usually find a way to implement what you need.

I've only played with tabs a little bit...I ended up creating a QStackedWidget as my "central widget", then use the menu system to flip between screens.

I think I probably pack too much game logic into my screens though, I've been working a lot on keeping them separated in my new projects.

Anyway, if it's helpful at all, here's an edited example of how I've set up my multi_screen apps.

Code:
class MyMainWindow(QtGui.QMainWindow,Ui_MainWindow): def __init__(self, parent=None): super(MyMainWindow,self).__init__(parent) self.setupUi(self) self.centralwidget = QtGui.QStackedWidget() self.setWindowState(QtCore.Qt.WindowMaximized) self.setCentralWidget(self.centralwidget) self.actionHiring.triggered.connect(self.showHiring) def showHiring(self): self.centralwidget.addWidget(self.pilot_hiring_screen) self.centralwidget.setCurrentWidget(self.pilot_hiring_screen) self.pilot_hiring_screen.update_pilot_roster()
SirBlurton is offline   Reply With Quote