def __init__(self, parent=None): super(Window, self).__init__(parent) self.createTrayIcon() self.createProgramsList() self.createCodeEditPage() self.logsPage = QTextBrowser() self.documentation = QTextBrowser() self.tabWidget = QTabWidget() self.tabWidget.setIconSize(QSize(64, 64)) self.tabWidget.addTab(self.programsListPage, QIcon(":/images/Adventure-Map-icon.png"), "Programs") self.tabWidget.addTab(self.codeEditPage, QIcon(":/images/Sword-icon.png"), "Edit Program") self.tabWidget.addTab(self.logsPage, QIcon(":/images/Spell-Scroll-icon.png"), "Logs") self.tabWidget.addTab(self.documentation, QIcon(":/images/Spell-Book-icon.png"), "Documentation") self.mainLayout = QVBoxLayout() self.mainLayout.addWidget(self.tabWidget) self.setLayout(self.mainLayout) self.setWindowTitle(APP_NAME) self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.Dialog) self.resize(800, 600) self.systrayHintMsgShowed = False self.firstShow = True self.fromQuit = False
def __init__(self, parent=None): super().__init__(parent=parent) layout = QtWidgets.QVBoxLayout(self) label1 = QLabel('입력', self) label1.setAlignment(Qt.AlignVCenter) label1.move(200, 30) label2 = QLabel('결과', self) label2.setAlignment(Qt.AlignVCenter) label2.move(710, 30) self.text_box1 = QTextEdit(self) self.text_box1.resize(350, 350) self.text_box1.move(50, 60) self.text_box2 = QTextBrowser(self) self.text_box2.append('') self.text_box2.setGeometry(550, 60, 350, 350) self.ok_base64 = QPushButton("OK", self) self.ok_base64.setGeometry(50, 420, 850, 45) self.ok_base64.clicked.connect(self.base64_conversion) self.back = QPushButton(self) self.back.setStyleSheet( ''' QPushButton{image:url(./img/back_img.png); border:0px;} QPushButton:hover{image:url(./img/back_img_ev_1.png); border:0px;} ''') self.back.setGeometry(0, 0, 50, 50) self.back.clicked.connect(self.change_stack1)
def __init__(self, parent: QWidget, editor: JMarkdownEditor): QTextBrowser.__init__(self, parent) self.editor = editor self.editor.textChanged.connect(self.on_editor_text_changed) self.setOpenLinks(True) self.setOpenExternalLinks(True)
class SecondWidget4(QtWidgets.QWidget): def __init__(self, parent=None): super().__init__(parent=parent) layout = QtWidgets.QVBoxLayout(self) label1 = QLabel('입력', self) label1.setAlignment(Qt.AlignVCenter) label1.move(200, 30) label2 = QLabel('결과', self) label2.setAlignment(Qt.AlignVCenter) label2.move(710, 30) self.text_dox1 = QTextEdit(self) self.text_dox1.resize(350, 350) self.text_dox1.move(50, 60) self.text_dox2 = QTextBrowser(self) self.text_dox2.append('') self.text_dox2.setGeometry(550, 60, 350, 350) self.dk_base64 = QPushButton("OK", self) self.dk_base64.setGeometry(50, 420, 850, 45) self.dk_base64.clicked.connect(self.base64_conversion) self.back = QPushButton(self) self.back.setStyleSheet( ''' QPushButton{image:url(./img/back_img.png); border:0px;} QPushButton:hover{image:url(./img/back_img_ev_1.png); border:0px;} ''') self.back.setGeometry(0, 0, 50, 50) self.back.clicked.connect(self.change_stack1) def change_stack1(self): self.parent().stack.setCurrentIndex(4) def base64_conversion(self): # print(self.text_dox1.toPlainText()) sitename_bytes = base64.b64decode(self.text_dox1.toPlainText()) sitename = sitename_bytes.decode('utf-8') print(sitename) # 내용 초기화 self.text_dox2.clear() self.text_dox2.repaint() self.text_dox2.append(str(sitename))
def __init__(self): super().__init__() # 设置属性 self.resize(400, 300) self.setWindowTitle("测试Qt进度条和aria2的联合") # 注册组件 self.labelUrl = QLabel("下载链接") self.lineEditorUrl = QLineEdit( "https://download.cnki.net/CAJViewer-x86_64-buildubuntu1604-210401.AppImage" ) self.labelProgress = QLabel("下载进度") self.downloadProgress = QProgressBar() self.textResult = QTextBrowser() self.buttonStart = QPushButton("开始") self.buttonPause = QPushButton("暂停") self.buttonUnpause = QPushButton("继续") self.buttonRemove = QPushButton("移除") self.buttonDebug = QPushButton("Debug") # 设置组件 self.lineEditorUrl.setClearButtonEnabled(True) self.buttonStart.setIcon(self.style().standardIcon( QStyle.SP_MediaPlay)) self.buttonPause.setIcon(self.style().standardIcon( QStyle.SP_MediaPause)) self.buttonUnpause.setIcon(self.style().standardIcon( QStyle.SP_MediaPlay)) self.buttonRemove.setIcon(self.style().standardIcon( QStyle.SP_MediaStop)) # self.buttonPause.setDisabled(True) # self.buttonStop.setDisabled(True) # 添加组件 self.layout = QGridLayout(self) self.layout.addWidget(self.labelUrl, 0, 0, 1, 1) self.layout.addWidget(self.lineEditorUrl, 0, 1, 1, 5) self.layout.addWidget(self.labelProgress, 1, 0, 1, 1) self.layout.addWidget(self.downloadProgress, 1, 1, 1, 5) self.layout.addWidget(self.textResult, 2, 0, 2, 5) self.layout.addWidget(self.buttonStart, 4, 0, 1, 1) self.layout.addWidget(self.buttonPause, 4, 1, 1, 1) self.layout.addWidget(self.buttonUnpause, 4, 2, 1, 1) self.layout.addWidget(self.buttonRemove, 4, 3, 1, 1) self.layout.addWidget(self.buttonDebug, 4, 4, 1, 1)
class SecondWidget1(QtWidgets.QWidget): def __init__(self, parent=None): super().__init__(parent=parent) layout = QtWidgets.QVBoxLayout(self) label1 = QLabel('입력', self) label1.setAlignment(Qt.AlignVCenter) label1.move(200, 30) label2 = QLabel('결과', self) label2.setAlignment(Qt.AlignVCenter) label2.move(710, 30) self.text_box1 = QTextEdit(self) self.text_box1.resize(350, 350) self.text_box1.move(50, 60) self.text_box2 = QTextBrowser(self) self.text_box2.append('') self.text_box2.setGeometry(550, 60, 350, 350) self.ok_base64 = QPushButton("OK", self) self.ok_base64.setGeometry(50, 420, 850, 45) self.ok_base64.clicked.connect(self.base64_conversion) self.back = QPushButton(self) self.back.setStyleSheet( ''' QPushButton{image:url(./img/back_img.png); border:0px;} QPushButton:hover{image:url(./img/back_img_ev_1.png); border:0px;} ''') self.back.setGeometry(0, 0, 50, 50) self.back.clicked.connect(self.change_stack1) def base64_conversion(self): ''' QTextEdit 사용 경우 .toPlainText() 사용 바람 https://doc.qt.io/qt-5/qplaintextedit.html#plainText-prop 참조 ''' # print(self.text_box1.toPlainText()) # Base64 변환 과정 inpututf = self.text_box1.toPlainText().encode('utf-8') # ascii 사용시 오류발생 utf-8으로 사용하세요 finalvalue = base64.b64encode(inpututf) print(finalvalue) ''' 내용 수정또는 추가시 내용 초기화 https://study-code.gitbook.io/python-basic/qtpy/pyqt-widget/application-make/widget-2#undefined-1 참조 ''' self.text_box2.clear() self.text_box2.repaint() ''' "b"와 따옴표없이 출력 .decode("utf-8") https://stackoverflow.com/a/45151048 참조 ''' self.text_box2.append(str(finalvalue.decode("utf-8"))) def change_stack(self): self.parent().stack.setCurrentIndex(0) def change_stack1(self): self.parent().stack.setCurrentIndex(1)
def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(1020, 588) self.actionSave = QAction(MainWindow) self.actionSave.setObjectName(u"actionSave") self.actionExit = QAction(MainWindow) self.actionExit.setObjectName(u"actionExit") self.actionExit_2 = QAction(MainWindow) self.actionExit_2.setObjectName(u"actionExit_2") self.openini = QAction(MainWindow) self.openini.setObjectName(u"openini") self.openjson = QAction(MainWindow) self.openjson.setObjectName(u"openjson") self.main_widget = QWidget(MainWindow) self.main_widget.setObjectName(u"main_widget") self.ini_widget = QWidget(self.main_widget) self.ini_widget.setObjectName(u"ini_widget") self.ini_widget.setGeometry(QRect(670, 10, 341, 551)) self.initable = QTableWidget(self.ini_widget) if (self.initable.columnCount() < 2): self.initable.setColumnCount(2) self.initable.setObjectName(u"initable") self.initable.setEnabled(True) self.initable.setGeometry(QRect(10, 60, 321, 451)) font = QFont() self.initable.setFont(font) self.initable.setEditTriggers(QAbstractItemView.DoubleClicked) self.initable.setDragEnabled(False) self.initable.setSelectionMode(QAbstractItemView.ExtendedSelection) self.initable.setSelectionBehavior(QAbstractItemView.SelectRows) self.initable.setWordWrap(False) self.initable.setRowCount(0) self.initable.setColumnCount(2) self.initable.horizontalHeader().setDefaultSectionSize(110) self.initable.horizontalHeader().setProperty("showSortIndicator", False) self.initable.horizontalHeader().setStretchLastSection(True) self.initable.verticalHeader().setDefaultSectionSize(21) self.inilabel = QLabel(self.ini_widget) self.inilabel.setObjectName(u"inilabel") self.inilabel.setGeometry(QRect(10, 10, 181, 16)) self.inipath = QTextBrowser(self.ini_widget) self.inipath.setObjectName(u"inipath") self.inipath.setEnabled(True) self.inipath.setGeometry(QRect(10, 30, 321, 22)) self.inipath.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.iniapply = QPushButton(self.ini_widget) self.iniapply.setObjectName(u"iniapply") self.iniapply.setEnabled(True) self.iniapply.setGeometry(QRect(250, 520, 80, 21)) self.inidel = QPushButton(self.ini_widget) self.inidel.setObjectName(u"inidel") self.inidel.setEnabled(False) self.inidel.setGeometry(QRect(10, 520, 80, 21)) self.iniadd = QPushButton(self.ini_widget) self.iniadd.setObjectName(u"iniadd") self.iniadd.setEnabled(False) self.iniadd.setGeometry(QRect(100, 520, 80, 21)) self.json_widget = QWidget(self.main_widget) self.json_widget.setObjectName(u"json_widget") self.json_widget.setGeometry(QRect(0, 10, 661, 551)) self.checkBox = QCheckBox(self.json_widget) self.checkBox.setObjectName(u"checkBox") self.checkBox.setEnabled(True) self.checkBox.setGeometry(QRect(20, 100, 131, 20)) self.checkBox.setChecked(True) self.delentry = QPushButton(self.json_widget) self.delentry.setObjectName(u"delentry") self.delentry.setEnabled(False) self.delentry.setGeometry(QRect(10, 520, 80, 21)) self.remote = QLineEdit(self.json_widget) self.remote.setObjectName(u"remote") self.remote.setEnabled(True) self.remote.setGeometry(QRect(20, 130, 601, 22)) self.textBrowser = QTextBrowser(self.json_widget) self.textBrowser.setObjectName(u"textBrowser") self.textBrowser.setEnabled(True) self.textBrowser.setGeometry(QRect(20, 30, 601, 22)) self.textBrowser.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.addButton = QPushButton(self.json_widget) self.addButton.setObjectName(u"addButton") self.addButton.setEnabled(True) self.addButton.setGeometry(QRect(280, 160, 61, 22)) self.table = QTableWidget(self.json_widget) if (self.table.columnCount() < 2): self.table.setColumnCount(2) self.table.setObjectName(u"table") self.table.setEnabled(True) self.table.setGeometry(QRect(10, 200, 641, 311)) self.table.setFont(font) self.table.setEditTriggers(QAbstractItemView.DoubleClicked) self.table.setDragEnabled(False) self.table.setSelectionMode(QAbstractItemView.ExtendedSelection) self.table.setSelectionBehavior(QAbstractItemView.SelectRows) self.table.setWordWrap(False) self.table.setRowCount(0) self.table.setColumnCount(2) self.table.horizontalHeader().setDefaultSectionSize(80) self.table.horizontalHeader().setProperty("showSortIndicator", False) self.table.horizontalHeader().setStretchLastSection(True) self.table.verticalHeader().setDefaultSectionSize(21) self.path = QLineEdit(self.json_widget) self.path.setObjectName(u"path") self.path.setEnabled(True) self.path.setGeometry(QRect(20, 70, 531, 22)) self.apply = QPushButton(self.json_widget) self.apply.setObjectName(u"apply") self.apply.setEnabled(True) self.apply.setGeometry(QRect(570, 520, 80, 21)) self.label = QLabel(self.json_widget) self.label.setObjectName(u"label") self.label.setGeometry(QRect(20, 10, 181, 16)) self.browse = QPushButton(self.json_widget) self.browse.setObjectName(u"browse") self.browse.setGeometry(QRect(560, 70, 61, 22)) MainWindow.setCentralWidget(self.main_widget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 1020, 19)) self.File = QMenu(self.menubar) self.File.setObjectName(u"File") self.menuOpen = QMenu(self.File) self.menuOpen.setObjectName(u"menuOpen") MainWindow.setMenuBar(self.menubar) self.menubar.addAction(self.File.menuAction()) self.File.addAction(self.menuOpen.menuAction()) self.File.addAction(self.actionSave) self.File.addSeparator() self.File.addAction(self.actionExit_2) self.menuOpen.addAction(self.openini) self.menuOpen.addAction(self.openjson) self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(911, 607) self.action_open = QAction(MainWindow) self.action_open.setObjectName(u"action_open") self.action_open.setVisible(False) self.action_comparison = QAction(MainWindow) self.action_comparison.setObjectName(u"action_comparison") self.action_comparison.setVisible(False) self.action_plot = QAction(MainWindow) self.action_plot.setObjectName(u"action_plot") self.action_training_session = QAction(MainWindow) self.action_training_session.setObjectName(u"action_training_session") self.action_training_session.setVisible(False) self.action_game = QAction(MainWindow) self.action_game.setObjectName(u"action_game") self.action_save = QAction(MainWindow) self.action_save.setObjectName(u"action_save") self.action_save.setVisible(False) self.action_save_log = QAction(MainWindow) self.action_save_log.setObjectName(u"action_save_log") self.action_save_log.setVisible(False) self.action_coordinates = QAction(MainWindow) self.action_coordinates.setObjectName(u"action_coordinates") self.action_coordinates.setCheckable(True) self.action_about = QAction(MainWindow) self.action_about.setObjectName(u"action_about") self.action_new_db = QAction(MainWindow) self.action_new_db.setObjectName(u"action_new_db") self.action_open_db = QAction(MainWindow) self.action_open_db.setObjectName(u"action_open_db") self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.verticalLayout_2 = QVBoxLayout(self.centralwidget) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.stacked_widget = QStackedWidget(self.centralwidget) self.stacked_widget.setObjectName(u"stacked_widget") self.game_page = QWidget() self.game_page.setObjectName(u"game_page") self.gridLayout_3 = QGridLayout(self.game_page) self.gridLayout_3.setObjectName(u"gridLayout_3") self.connect4 = QPushButton(self.game_page) self.connect4.setObjectName(u"connect4") sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.connect4.sizePolicy().hasHeightForWidth()) self.connect4.setSizePolicy(sizePolicy) self.gridLayout_3.addWidget(self.connect4, 0, 1, 1, 1) self.tic_tac_toe = QPushButton(self.game_page) self.tic_tac_toe.setObjectName(u"tic_tac_toe") sizePolicy1 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.tic_tac_toe.sizePolicy().hasHeightForWidth()) self.tic_tac_toe.setSizePolicy(sizePolicy1) self.gridLayout_3.addWidget(self.tic_tac_toe, 0, 0, 1, 1) self.othello = QPushButton(self.game_page) self.othello.setObjectName(u"othello") sizePolicy.setHeightForWidth( self.othello.sizePolicy().hasHeightForWidth()) self.othello.setSizePolicy(sizePolicy) self.gridLayout_3.addWidget(self.othello, 1, 0, 1, 1) self.stacked_widget.addWidget(self.game_page) self.players_page = QWidget() self.players_page.setObjectName(u"players_page") self.verticalLayout = QVBoxLayout(self.players_page) self.verticalLayout.setObjectName(u"verticalLayout") self.player_layout = QGridLayout() self.player_layout.setObjectName(u"player_layout") self.searches_lock2 = QCheckBox(self.players_page) self.searches_lock2.setObjectName(u"searches_lock2") self.player_layout.addWidget(self.searches_lock2, 2, 4, 1, 1) self.player1 = QComboBox(self.players_page) self.player1.setObjectName(u"player1") sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.player1.sizePolicy().hasHeightForWidth()) self.player1.setSizePolicy(sizePolicy2) self.player_layout.addWidget(self.player1, 1, 1, 1, 1) self.cancel = QPushButton(self.players_page) self.cancel.setObjectName(u"cancel") self.player_layout.addWidget(self.cancel, 4, 0, 1, 1) self.searches_label1 = QLabel(self.players_page) self.searches_label1.setObjectName(u"searches_label1") sizePolicy3 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) sizePolicy3.setHorizontalStretch(0) sizePolicy3.setVerticalStretch(0) sizePolicy3.setHeightForWidth( self.searches_label1.sizePolicy().hasHeightForWidth()) self.searches_label1.setSizePolicy(sizePolicy3) self.player_layout.addWidget(self.searches_label1, 1, 3, 1, 1) self.player2 = QComboBox(self.players_page) self.player2.setObjectName(u"player2") sizePolicy2.setHeightForWidth( self.player2.sizePolicy().hasHeightForWidth()) self.player2.setSizePolicy(sizePolicy2) self.player_layout.addWidget(self.player2, 2, 1, 1, 1) self.searches_lock1 = QCheckBox(self.players_page) self.searches_lock1.setObjectName(u"searches_lock1") self.player_layout.addWidget(self.searches_lock1, 1, 4, 1, 1) self.game_label = QLabel(self.players_page) self.game_label.setObjectName(u"game_label") sizePolicy4 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy4.setHorizontalStretch(0) sizePolicy4.setVerticalStretch(0) sizePolicy4.setHeightForWidth( self.game_label.sizePolicy().hasHeightForWidth()) self.game_label.setSizePolicy(sizePolicy4) self.player_layout.addWidget(self.game_label, 0, 0, 1, 1) self.game_name = QLabel(self.players_page) self.game_name.setObjectName(u"game_name") self.player_layout.addWidget(self.game_name, 0, 1, 1, 4) self.searches_label2 = QLabel(self.players_page) self.searches_label2.setObjectName(u"searches_label2") self.player_layout.addWidget(self.searches_label2, 2, 3, 1, 1) self.player_label1 = QLabel(self.players_page) self.player_label1.setObjectName(u"player_label1") sizePolicy4.setHeightForWidth( self.player_label1.sizePolicy().hasHeightForWidth()) self.player_label1.setSizePolicy(sizePolicy4) self.player_layout.addWidget(self.player_label1, 1, 0, 1, 1) self.searches1 = QSpinBox(self.players_page) self.searches1.setObjectName(u"searches1") sizePolicy5 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) sizePolicy5.setHorizontalStretch(0) sizePolicy5.setVerticalStretch(0) sizePolicy5.setHeightForWidth( self.searches1.sizePolicy().hasHeightForWidth()) self.searches1.setSizePolicy(sizePolicy5) self.searches1.setMaximum(1000000) self.player_layout.addWidget(self.searches1, 1, 2, 1, 1) self.player_label2 = QLabel(self.players_page) self.player_label2.setObjectName(u"player_label2") self.player_layout.addWidget(self.player_label2, 2, 0, 1, 1) self.shuffle_players = QCheckBox(self.players_page) self.shuffle_players.setObjectName(u"shuffle_players") self.player_layout.addWidget(self.shuffle_players, 3, 1, 1, 4) self.searches2 = QSpinBox(self.players_page) self.searches2.setObjectName(u"searches2") sizePolicy5.setHeightForWidth( self.searches2.sizePolicy().hasHeightForWidth()) self.searches2.setSizePolicy(sizePolicy5) self.searches2.setMaximum(1000000) self.player_layout.addWidget(self.searches2, 2, 2, 1, 1) self.start = QPushButton(self.players_page) self.start.setObjectName(u"start") self.player_layout.addWidget(self.start, 4, 1, 1, 4) self.player_layout.setColumnStretch(1, 10) self.player_layout.setColumnStretch(2, 1) self.verticalLayout.addLayout(self.player_layout) self.stacked_widget.addWidget(self.players_page) self.humans_page = QWidget() self.humans_page.setObjectName(u"humans_page") self.gridLayout = QGridLayout(self.humans_page) self.gridLayout.setObjectName(u"gridLayout") self.close_humans = QPushButton(self.humans_page) self.close_humans.setObjectName(u"close_humans") sizePolicy4.setHeightForWidth( self.close_humans.sizePolicy().hasHeightForWidth()) self.close_humans.setSizePolicy(sizePolicy4) self.gridLayout.addWidget(self.close_humans, 1, 1, 1, 1) self.players_label = QLabel(self.humans_page) self.players_label.setObjectName(u"players_label") self.gridLayout.addWidget(self.players_label, 0, 0, 1, 1) self.new_human = QPushButton(self.humans_page) self.new_human.setObjectName(u"new_human") sizePolicy4.setHeightForWidth( self.new_human.sizePolicy().hasHeightForWidth()) self.new_human.setSizePolicy(sizePolicy4) self.gridLayout.addWidget(self.new_human, 1, 3, 1, 1) self.players_table = QTableWidget(self.humans_page) self.players_table.setObjectName(u"players_table") self.gridLayout.addWidget(self.players_table, 0, 1, 1, 3) self.spacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout.addItem(self.spacer, 1, 2, 1, 1) self.stacked_widget.addWidget(self.humans_page) self.rules_page = QWidget() self.rules_page.setObjectName(u"rules_page") self.gridLayout_4 = QGridLayout(self.rules_page) self.gridLayout_4.setObjectName(u"gridLayout_4") self.rules_text = QTextBrowser(self.rules_page) self.rules_text.setObjectName(u"rules_text") self.gridLayout_4.addWidget(self.rules_text, 0, 0, 1, 1) self.rules_close = QPushButton(self.rules_page) self.rules_close.setObjectName(u"rules_close") sizePolicy4.setHeightForWidth( self.rules_close.sizePolicy().hasHeightForWidth()) self.rules_close.setSizePolicy(sizePolicy4) self.gridLayout_4.addWidget(self.rules_close, 1, 0, 1, 1) self.stacked_widget.addWidget(self.rules_page) self.display_page = QWidget() self.display_page.setObjectName(u"display_page") self.gridLayout_2 = QGridLayout(self.display_page) self.gridLayout_2.setObjectName(u"gridLayout_2") self.toggle_review = QPushButton(self.display_page) self.toggle_review.setObjectName(u"toggle_review") sizePolicy4.setHeightForWidth( self.toggle_review.sizePolicy().hasHeightForWidth()) self.toggle_review.setSizePolicy(sizePolicy4) self.gridLayout_2.addWidget(self.toggle_review, 3, 2, 1, 1) self.move_history = QComboBox(self.display_page) self.move_history.setObjectName(u"move_history") sizePolicy6 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy6.setHorizontalStretch(1) sizePolicy6.setVerticalStretch(0) sizePolicy6.setHeightForWidth( self.move_history.sizePolicy().hasHeightForWidth()) self.move_history.setSizePolicy(sizePolicy6) self.gridLayout_2.addWidget(self.move_history, 3, 1, 1, 1) self.choices = QTableWidget(self.display_page) self.choices.setObjectName(u"choices") sizePolicy7 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) sizePolicy7.setHorizontalStretch(0) sizePolicy7.setVerticalStretch(0) sizePolicy7.setHeightForWidth( self.choices.sizePolicy().hasHeightForWidth()) self.choices.setSizePolicy(sizePolicy7) self.gridLayout_2.addWidget(self.choices, 1, 0, 1, 3) self.resume_here = QPushButton(self.display_page) self.resume_here.setObjectName(u"resume_here") sizePolicy5.setHeightForWidth( self.resume_here.sizePolicy().hasHeightForWidth()) self.resume_here.setSizePolicy(sizePolicy5) self.gridLayout_2.addWidget(self.resume_here, 3, 0, 1, 1) self.game_display = QLabel(self.display_page) self.game_display.setObjectName(u"game_display") self.gridLayout_2.addWidget(self.game_display, 0, 0, 1, 3) self.stacked_widget.addWidget(self.display_page) self.plot_strength_page = QWidget() self.plot_strength_page.setObjectName(u"plot_strength_page") self.gridLayout_5 = QGridLayout(self.plot_strength_page) self.gridLayout_5.setObjectName(u"gridLayout_5") self.label = QLabel(self.plot_strength_page) self.label.setObjectName(u"label") self.gridLayout_5.addWidget(self.label, 0, 0, 1, 1) self.plot_game = QComboBox(self.plot_strength_page) self.plot_game.setObjectName(u"plot_game") self.gridLayout_5.addWidget(self.plot_game, 0, 1, 1, 2) self.lineEdit = QLineEdit(self.plot_strength_page) self.lineEdit.setObjectName(u"lineEdit") self.gridLayout_5.addWidget(self.lineEdit, 2, 1, 1, 2) self.label_2 = QLabel(self.plot_strength_page) self.label_2.setObjectName(u"label_2") self.gridLayout_5.addWidget(self.label_2, 3, 0, 1, 1) self.lineEdit_2 = QLineEdit(self.plot_strength_page) self.lineEdit_2.setObjectName(u"lineEdit_2") self.gridLayout_5.addWidget(self.lineEdit_2, 3, 1, 1, 2) self.reset_plot = QPushButton(self.plot_strength_page) self.reset_plot.setObjectName(u"reset_plot") self.gridLayout_5.addWidget(self.reset_plot, 6, 2, 1, 1) self.start_stop_plot = QPushButton(self.plot_strength_page) self.start_stop_plot.setObjectName(u"start_stop_plot") self.gridLayout_5.addWidget(self.start_stop_plot, 6, 1, 1, 1) self.strengths_label = QLabel(self.plot_strength_page) self.strengths_label.setObjectName(u"strengths_label") self.gridLayout_5.addWidget(self.strengths_label, 2, 0, 1, 1) self.label_3 = QLabel(self.plot_strength_page) self.label_3.setObjectName(u"label_3") self.gridLayout_5.addWidget(self.label_3, 4, 0, 1, 1) self.lineEdit_3 = QLineEdit(self.plot_strength_page) self.lineEdit_3.setObjectName(u"lineEdit_3") self.gridLayout_5.addWidget(self.lineEdit_3, 4, 1, 1, 2) self.stacked_widget.addWidget(self.plot_strength_page) self.plot_history_page = QWidget() self.plot_history_page.setObjectName(u"plot_history_page") self.gridLayout_6 = QGridLayout(self.plot_history_page) self.gridLayout_6.setObjectName(u"gridLayout_6") self.label_4 = QLabel(self.plot_history_page) self.label_4.setObjectName(u"label_4") self.gridLayout_6.addWidget(self.label_4, 0, 0, 1, 1) self.history_game = QComboBox(self.plot_history_page) self.history_game.setObjectName(u"history_game") self.gridLayout_6.addWidget(self.history_game, 0, 1, 1, 1) self.gridLayout_6.setColumnStretch(0, 1) self.gridLayout_6.setColumnStretch(1, 8) self.stacked_widget.addWidget(self.plot_history_page) self.verticalLayout_2.addWidget(self.stacked_widget) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 911, 22)) self.menu_file = QMenu(self.menubar) self.menu_file.setObjectName(u"menu_file") self.menu_new = QMenu(self.menu_file) self.menu_new.setObjectName(u"menu_new") self.menu_view = QMenu(self.menubar) self.menu_view.setObjectName(u"menu_view") self.menu_help = QMenu(self.menubar) self.menu_help.setObjectName(u"menu_help") self.menu_rules = QMenu(self.menu_help) self.menu_rules.setObjectName(u"menu_rules") MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menu_file.menuAction()) self.menubar.addAction(self.menu_view.menuAction()) self.menubar.addAction(self.menu_help.menuAction()) self.menu_file.addAction(self.menu_new.menuAction()) self.menu_file.addAction(self.action_open) self.menu_file.addAction(self.action_save) self.menu_file.addAction(self.action_save_log) self.menu_file.addAction(self.action_new_db) self.menu_file.addAction(self.action_open_db) self.menu_new.addAction(self.action_game) self.menu_new.addAction(self.action_comparison) self.menu_new.addAction(self.action_plot) self.menu_new.addAction(self.action_training_session) self.menu_view.addAction(self.action_coordinates) self.menu_help.addAction(self.action_about) self.menu_help.addAction(self.menu_rules.menuAction()) self.retranslateUi(MainWindow) self.stacked_widget.setCurrentIndex(2) QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(983, 807) MainWindow.setWindowOpacity(0.000000000000000) self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.groupBox = QGroupBox(self.centralwidget) self.groupBox.setObjectName(u"groupBox") self.groupBox.setGeometry(QRect(10, 10, 961, 191)) self.horizontalLayoutWidget = QWidget(self.groupBox) self.horizontalLayoutWidget.setObjectName(u"horizontalLayoutWidget") self.horizontalLayoutWidget.setGeometry(QRect(10, 30, 211, 41)) self.horizontalLayout = QHBoxLayout(self.horizontalLayoutWidget) self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.label = QLabel(self.horizontalLayoutWidget) self.label.setObjectName(u"label") self.horizontalLayout.addWidget(self.label) self.lineEdit = QLineEdit(self.horizontalLayoutWidget) self.lineEdit.setObjectName(u"lineEdit") sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.lineEdit.sizePolicy().hasHeightForWidth()) self.lineEdit.setSizePolicy(sizePolicy) self.horizontalLayout.addWidget(self.lineEdit) self.horizontalLayoutWidget_2 = QWidget(self.groupBox) self.horizontalLayoutWidget_2.setObjectName( u"horizontalLayoutWidget_2") self.horizontalLayoutWidget_2.setGeometry(QRect(10, 70, 211, 41)) self.horizontalLayout_2 = QHBoxLayout(self.horizontalLayoutWidget_2) self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) self.label_2 = QLabel(self.horizontalLayoutWidget_2) self.label_2.setObjectName(u"label_2") self.horizontalLayout_2.addWidget(self.label_2) self.lineEdit_2 = QLineEdit(self.horizontalLayoutWidget_2) self.lineEdit_2.setObjectName(u"lineEdit_2") sizePolicy.setHeightForWidth( self.lineEdit_2.sizePolicy().hasHeightForWidth()) self.lineEdit_2.setSizePolicy(sizePolicy) self.horizontalLayout_2.addWidget(self.lineEdit_2) self.horizontalLayoutWidget_3 = QWidget(self.groupBox) self.horizontalLayoutWidget_3.setObjectName( u"horizontalLayoutWidget_3") self.horizontalLayoutWidget_3.setGeometry(QRect(10, 110, 211, 41)) self.horizontalLayout_3 = QHBoxLayout(self.horizontalLayoutWidget_3) self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) self.label_3 = QLabel(self.horizontalLayoutWidget_3) self.label_3.setObjectName(u"label_3") self.horizontalLayout_3.addWidget(self.label_3) self.lineEdit_3 = QLineEdit(self.horizontalLayoutWidget_3) self.lineEdit_3.setObjectName(u"lineEdit_3") sizePolicy.setHeightForWidth( self.lineEdit_3.sizePolicy().hasHeightForWidth()) self.lineEdit_3.setSizePolicy(sizePolicy) self.horizontalLayout_3.addWidget(self.lineEdit_3) self.horizontalLayoutWidget_4 = QWidget(self.groupBox) self.horizontalLayoutWidget_4.setObjectName( u"horizontalLayoutWidget_4") self.horizontalLayoutWidget_4.setGeometry(QRect(230, 30, 238, 41)) self.horizontalLayout_4 = QHBoxLayout(self.horizontalLayoutWidget_4) self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0) self.label_4 = QLabel(self.horizontalLayoutWidget_4) self.label_4.setObjectName(u"label_4") self.horizontalLayout_4.addWidget(self.label_4) self.lineEdit_4 = QLineEdit(self.horizontalLayoutWidget_4) self.lineEdit_4.setObjectName(u"lineEdit_4") sizePolicy.setHeightForWidth( self.lineEdit_4.sizePolicy().hasHeightForWidth()) self.lineEdit_4.setSizePolicy(sizePolicy) self.horizontalLayout_4.addWidget(self.lineEdit_4) self.horizontalLayoutWidget_5 = QWidget(self.groupBox) self.horizontalLayoutWidget_5.setObjectName( u"horizontalLayoutWidget_5") self.horizontalLayoutWidget_5.setGeometry(QRect(230, 70, 240, 41)) self.horizontalLayout_5 = QHBoxLayout(self.horizontalLayoutWidget_5) self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0) self.label_5 = QLabel(self.horizontalLayoutWidget_5) self.label_5.setObjectName(u"label_5") self.horizontalLayout_5.addWidget(self.label_5) self.lineEdit_5 = QLineEdit(self.horizontalLayoutWidget_5) self.lineEdit_5.setObjectName(u"lineEdit_5") sizePolicy.setHeightForWidth( self.lineEdit_5.sizePolicy().hasHeightForWidth()) self.lineEdit_5.setSizePolicy(sizePolicy) self.horizontalLayout_5.addWidget(self.lineEdit_5) self.groupBox_2 = QGroupBox(self.centralwidget) self.groupBox_2.setObjectName(u"groupBox_2") self.groupBox_2.setGeometry(QRect(10, 210, 961, 171)) self.textBrowser = QTextBrowser(self.centralwidget) self.textBrowser.setObjectName(u"textBrowser") self.textBrowser.setGeometry(QRect(10, 440, 961, 311)) self.pushButton = QPushButton(self.centralwidget) self.pushButton.setObjectName(u"pushButton") self.pushButton.setGeometry(QRect(858, 400, 111, 25)) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 983, 22)) MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow)
class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(983, 807) MainWindow.setWindowOpacity(0.000000000000000) self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.groupBox = QGroupBox(self.centralwidget) self.groupBox.setObjectName(u"groupBox") self.groupBox.setGeometry(QRect(10, 10, 961, 191)) self.horizontalLayoutWidget = QWidget(self.groupBox) self.horizontalLayoutWidget.setObjectName(u"horizontalLayoutWidget") self.horizontalLayoutWidget.setGeometry(QRect(10, 30, 211, 41)) self.horizontalLayout = QHBoxLayout(self.horizontalLayoutWidget) self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.label = QLabel(self.horizontalLayoutWidget) self.label.setObjectName(u"label") self.horizontalLayout.addWidget(self.label) self.lineEdit = QLineEdit(self.horizontalLayoutWidget) self.lineEdit.setObjectName(u"lineEdit") sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.lineEdit.sizePolicy().hasHeightForWidth()) self.lineEdit.setSizePolicy(sizePolicy) self.horizontalLayout.addWidget(self.lineEdit) self.horizontalLayoutWidget_2 = QWidget(self.groupBox) self.horizontalLayoutWidget_2.setObjectName( u"horizontalLayoutWidget_2") self.horizontalLayoutWidget_2.setGeometry(QRect(10, 70, 211, 41)) self.horizontalLayout_2 = QHBoxLayout(self.horizontalLayoutWidget_2) self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) self.label_2 = QLabel(self.horizontalLayoutWidget_2) self.label_2.setObjectName(u"label_2") self.horizontalLayout_2.addWidget(self.label_2) self.lineEdit_2 = QLineEdit(self.horizontalLayoutWidget_2) self.lineEdit_2.setObjectName(u"lineEdit_2") sizePolicy.setHeightForWidth( self.lineEdit_2.sizePolicy().hasHeightForWidth()) self.lineEdit_2.setSizePolicy(sizePolicy) self.horizontalLayout_2.addWidget(self.lineEdit_2) self.horizontalLayoutWidget_3 = QWidget(self.groupBox) self.horizontalLayoutWidget_3.setObjectName( u"horizontalLayoutWidget_3") self.horizontalLayoutWidget_3.setGeometry(QRect(10, 110, 211, 41)) self.horizontalLayout_3 = QHBoxLayout(self.horizontalLayoutWidget_3) self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) self.label_3 = QLabel(self.horizontalLayoutWidget_3) self.label_3.setObjectName(u"label_3") self.horizontalLayout_3.addWidget(self.label_3) self.lineEdit_3 = QLineEdit(self.horizontalLayoutWidget_3) self.lineEdit_3.setObjectName(u"lineEdit_3") sizePolicy.setHeightForWidth( self.lineEdit_3.sizePolicy().hasHeightForWidth()) self.lineEdit_3.setSizePolicy(sizePolicy) self.horizontalLayout_3.addWidget(self.lineEdit_3) self.horizontalLayoutWidget_4 = QWidget(self.groupBox) self.horizontalLayoutWidget_4.setObjectName( u"horizontalLayoutWidget_4") self.horizontalLayoutWidget_4.setGeometry(QRect(230, 30, 238, 41)) self.horizontalLayout_4 = QHBoxLayout(self.horizontalLayoutWidget_4) self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0) self.label_4 = QLabel(self.horizontalLayoutWidget_4) self.label_4.setObjectName(u"label_4") self.horizontalLayout_4.addWidget(self.label_4) self.lineEdit_4 = QLineEdit(self.horizontalLayoutWidget_4) self.lineEdit_4.setObjectName(u"lineEdit_4") sizePolicy.setHeightForWidth( self.lineEdit_4.sizePolicy().hasHeightForWidth()) self.lineEdit_4.setSizePolicy(sizePolicy) self.horizontalLayout_4.addWidget(self.lineEdit_4) self.horizontalLayoutWidget_5 = QWidget(self.groupBox) self.horizontalLayoutWidget_5.setObjectName( u"horizontalLayoutWidget_5") self.horizontalLayoutWidget_5.setGeometry(QRect(230, 70, 240, 41)) self.horizontalLayout_5 = QHBoxLayout(self.horizontalLayoutWidget_5) self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0) self.label_5 = QLabel(self.horizontalLayoutWidget_5) self.label_5.setObjectName(u"label_5") self.horizontalLayout_5.addWidget(self.label_5) self.lineEdit_5 = QLineEdit(self.horizontalLayoutWidget_5) self.lineEdit_5.setObjectName(u"lineEdit_5") sizePolicy.setHeightForWidth( self.lineEdit_5.sizePolicy().hasHeightForWidth()) self.lineEdit_5.setSizePolicy(sizePolicy) self.horizontalLayout_5.addWidget(self.lineEdit_5) self.groupBox_2 = QGroupBox(self.centralwidget) self.groupBox_2.setObjectName(u"groupBox_2") self.groupBox_2.setGeometry(QRect(10, 210, 961, 171)) self.textBrowser = QTextBrowser(self.centralwidget) self.textBrowser.setObjectName(u"textBrowser") self.textBrowser.setGeometry(QRect(10, 440, 961, 311)) self.pushButton = QPushButton(self.centralwidget) self.pushButton.setObjectName(u"pushButton") self.pushButton.setGeometry(QRect(858, 400, 111, 25)) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 983, 22)) MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow) # setupUi def retranslateUi(self, MainWindow): MainWindow.setWindowTitle( QCoreApplication.translate( "MainWindow", u"\u0418\u043c\u043f\u043e\u0440\u0442 \u0413\u0410\u0420", None)) self.groupBox.setTitle( QCoreApplication.translate( "MainWindow", u"\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b", None)) self.label.setText( QCoreApplication.translate("MainWindow", u"URL", None)) self.label_2.setText( QCoreApplication.translate("MainWindow", u"\u041f\u043e\u0440\u0442", None)) self.label_3.setText( QCoreApplication.translate("MainWindow", u"\u0418\u043c\u044f \u0411\u0414", None)) self.label_4.setText( QCoreApplication.translate( "MainWindow", u"\u0418\u043c\u044f \u0440\u043e\u043b\u0438", None)) self.label_5.setText( QCoreApplication.translate( "MainWindow", u"\u041f\u0430\u0440\u043e\u043b\u044c", None)) self.groupBox_2.setTitle( QCoreApplication.translate( "MainWindow", u"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0430", None)) self.pushButton.setText( QCoreApplication.translate( "MainWindow", u"\u0418\u043c\u043f\u043e\u0440\u0442", None))