Category : pyqt5

I created a GUI where the user can open tabs with button. When he does, it adds the following tab: class data_tab(QtWidgets.QWidget, data_tab_lib.Ui_data_tab): #========================================================================================= # Constructor #========================================================================================= def __init__(self, parent, title): QtWidgets.QWidget.__init__(self, parent) self.setupUi(self) # initialize save data button icon icon = _createIcon("dataname_save") self.dataname_save.setIcon(icon) self.canvas = Canvas(data_tab) self.axe = self.canvas.figure.add_subplot(111) self.canvas.figure.subplots_adjust(left=0.025, top=0.965, bottom=0.040, right=0.975) # ..

Read more

A new member has been registered in the database, but when entering the profile modification page and adding other information, it is registered in a new row and not in the same information as the registered member. register new member : def add_users(self): add_fullname = self.line_fullname.text() add_username = self.line_username.text() add_Email = self.line_email.text() add_password = self.line_password.text() ..

Read more

I am trying to set the width height of a QWidget percentage wise. But since we cannot do something like min-height:20% using QSS. I tried to use setGeometry function and recall this function on window resize event, but somehow it don’t work, below is my code: class mainwindow(QMainWindow): def __init__(self): super().__init__() stylesheet = """ #mainwindow{ ..

Read more

I have two program,When two program work separately it work well.But when main program call sub-program, the UI freeze.the detail is in bellow. main.py import sys from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtCore import QObject, pyqtSignal, QProcess import subprocess from numpy import datetime64 import zmq class DataReceiver(QObject): def __init__(self): super().__init__() self.sock = zmq.Context.instance().socket(zmq.ROUTER) self.sock.bind("tcp://*:9000") self.poller ..

Read more

If I press any key, nothing will happen. How to implement it? And I notice if I pressed some key, (at first time/Very Beggning/first character), it take some more time to display that pressed Character in textbox.How to resolve it? from PyQt5 import QtWidgets,QtCore,QtGui class MyKey(QtWidgets.QWidget): def __init__(self): super(). __init__() self.setWindowTitle(" My Key Board") self.ui() ..

Read more

I have added a widget in my mainwindows and I would like to give it a show something like box-shadow: 3px 3px 25px #111; I tried above by going to widget change stylesheet option and adding the code as below: background-color:#fff; border:4px solid blue; box-shadow: 0px -3px 5px #a6a6a6; The first two attribute give the ..

Read more

I’m trying to do an application including 3 pages. I try to do it in this way: def moveToForm2(self): self.window = QtWidgets.QMainWindow() self.ui = Ui_Form2() self.ui.setupUi(self.window) self.window.show() Form.hide() I do not encounter with a problem in the main page while hiding the first Form since it is opened as main so that the objects I ..

Read more

Using Python and Pyqt5 Currently working on a monitoring system. When I launch the project, it only grabs the RPM value 1 time, I am having trouble having it loop so it continuously display the output. RPM = rpmValue table = [{"Monitor": "Engine Speed", "RPM": RPM}] row = 0 self.table.setRowCount(len(people)) for person in people: self.table.setItem(row, ..

Read more