12 August 2023
file1 = "..."
file2 = "..."
import sys
from PyQt6.QtWidgets import QDialog, QApplication
from PyQt6 import uic
class Parent(QDialog):
def __init__(self, parent=None):
super().__init__()
uic.loadUi(file1, self)
self._parent = parent
self.__prepare()
def __prepare(self):
print('test')
class Child(Parent):
def __init__(self):
super().__init__()
self.__prepare()
def __prepare(self):
self.action_comboBox.currentIndexChanged.connect(self.load_ui)
def load_ui(self):
print('changed')
uic.loadUi(file2, self)
if __name__ == '__main__':
app = QApplication(sys.argv)
window = Child()
window.show()
sys.exit(app.exec())
Tell please why ui not change, but function called. I did little MEW for you
Hi everyone. Just getting started with QT. I am running on Linux PopOS (Ubuntu 22.04). The code with PyQT6 works great.
When I try the same, with the small compatibility changes needed, I get errors with PySide6. I get qt.qpa.plugin: Could not load the QT platform plugin "xcb" even though it was found.
I've seen solutions around and tried a few with no luck. I'd rather use PySide because of licensing.
Any suggestions? Hoping it's an easy solution since PyQt works fine.