Posts by S. Nick • 236 points
5 posts
-
1
votes1
answer59
viewsA: How to replace one layout with another in Qhboxlayout?
Try import sys from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QGridLayout, QHBoxLayout from PyQt5.QtCore import Qt class App(QWidget): def __init__(self): super().__init__()…
-
1
votes1
answer183
viewsA: Qwidget class inside Qmainwindow class
Try this: import sys from PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QPushButton from PyQt5.QtWidgets import QSpacerItem, QLabel, QComboBox from PyQt5.QtWidgets import QSizePolicy,…
-
1
votes1
answer87
viewsA: Multiple ui’s on the same Qmainwindow
In Pyqt5, this can be: import sys #from PySide2.QtUiTools import * from PyQt5 import uic from PyQt5.QtWidgets import * from PyQt5.QtCore import * def tela(ui): # arquivo = QFile(ui) #…
-
2
votes3
answers665
viewsA: How to turn content from a file into a dictionary in Python?
value = """ NAME=Maquina01 ID="MAQ 15478" version=08 """ dict([ i.split('=') for i in value.strip().split('\n')]) {'NAME': 'Maquina01', 'version': '08', 'ID': '"MAQ…
-
1
votes1
answer466
viewsA: Pyqt5 how can I make a button select a stacked Qt widget
In your example, this could be: import os import sys from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow")…