Example #1
0
 def on_action_about_qt_triggered(self):
     """
     Displays About Qt dialog.
     """
     QApplication.aboutQt()
Example #2
0
 def about_qt(self) -> None:
     """Forward to QApplication.aboutQt, but keep here for sake of tests"""
     QApplication.aboutQt()
Example #3
0
if __name__ == "__main__":
    app = QApplication(sys.argv)
    if len(sys.argv) == 1:
        mainWindow = Window()
        mainWindow.show()
        for x in QApplication.topLevelWidgets():
            print(x.title())

    elif len(sys.argv) == 2:
        opt = int(sys.argv[1])
        if opt == 1:
            loader = QUiLoader()
            file = QFile("dialog.ui")
            file.open(QFile.ReadOnly)
            myWidget = loader.load(file)
            file.close()
            myWidget.show()
        if opt == 2:
            table = QTableWidget(12, 10)
            for i in range(0, 10):
                item = QTableWidgetItem()
                item.setText(chr(ord('A') + i))
                table.setHorizontalHeaderItem(i, item)
            table.setShowGrid(Trued)
            table.show()
            table.cellChanged.connect(cellName)
        else:
            app.aboutQt()
            sys.exit()
    sys.exit(app.exec_())