Fix: Initialize status bar widgets in MainWindow constructor
This commit is contained in:
@@ -111,8 +111,25 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
self.layout.addLayout(center_layout, 1)
|
self.layout.addLayout(center_layout, 1)
|
||||||
|
|
||||||
|
# Status Bar
|
||||||
|
self.status_bar = QStatusBar()
|
||||||
|
self.setStatusBar(self.status_bar)
|
||||||
|
|
||||||
|
self.progress_bar = QProgressBar()
|
||||||
|
self.progress_bar.setFixedWidth(200)
|
||||||
|
self.progress_bar.setVisible(False)
|
||||||
|
self.status_bar.addPermanentWidget(self.progress_bar)
|
||||||
|
|
||||||
|
self.status_label = QLabel("Ready")
|
||||||
|
self.status_bar.addWidget(self.status_label)
|
||||||
|
|
||||||
# Menus
|
# Menus
|
||||||
self.create_menus()
|
self.create_menus()
|
||||||
|
|
||||||
|
def update_progress(self, current, total):
|
||||||
|
self.progress_bar.setMaximum(total)
|
||||||
|
self.progress_bar.setValue(current)
|
||||||
|
QApplication.processEvents() # Force UI update
|
||||||
|
|
||||||
def create_menus(self):
|
def create_menus(self):
|
||||||
menu_bar = self.menuBar()
|
menu_bar = self.menuBar()
|
||||||
|
|||||||
Reference in New Issue
Block a user