Category : pyqt5

this my code: import socket, sys, time, res from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5 import uic SERVER = socket.gethostbyname(socket.gethostname()) class AThread(QThread): sign = pyqtSignal(str) def __init__(self): super().__init__() def run(self): self.aa = True while self.aa: a = "Hello World!!" self.sign.emit(a) time.sleep(0.5) def stop(self): self.aa = False class MainWindow(QWidget): ..

Read more

I tried to signal Qlabel so that I could draw quickly using multithreading. My ultimate goal is to replace Qlabel with an image drawn by Matplotlib.I’m sure the signal does pass, but it’s not added to the UI. class Work(QObject): count_signal = pyqtSignal(QtWidgets.QLabel) def __init__(self, parent=None): super(Work, self).__init__(parent) self.run = True def start(self): print(‘current id’, ..

Read more

There should be radiobuttons created for each row/column, and each radiobutton should give the label# and stg#. My example halfway works but currently its printing multiple print lines for each radiobutton clicked. Is there a better way to do this? from PyQt5 import QtCore, QtGui, QtWidgets import sys class Assign(QtWidgets.QMainWindow): def __init__(self, parent=None): super().__init__() self.parent ..

Read more

I have a table that’s being populated from a database. you can edit the table then update the database with the new data. I have this: def populate(self): tablerow = 0 rowcount = 0 self.ui.widget_unass_fights.clearContents() self.ui.widget_unass_fights.setRowCount(0) for row in x: rowcount += 1 self.ui.widget_unass_fights.setRowCount(rowcount) self.ui.widget_unass_fights.setItem(tablerow, 0, QtWidgets.QTableWidgetItem(str(row[0]))) self.ui.widget_unass_fights.setItem(tablerow, 2, QtWidgets.QTableWidgetItem(str(row[2]))) self.ui.widget_unass_fights.setItem(tablerow, 3, QtWidgets.QTableWidgetItem(str(row[3]))) self.ui.widget_unass_fights.setItem(tablerow, 4, ..

Read more

I’m new to Python and PyQt5 and I’ve been working on creating a simple door lock application using PyQt5. My aim is to display buttons and camera streaming on the same window but it’s separated. I’ve looked up but I couldn’t find much information about this issue. I’m sorry in advance if it’s duplicated. class ..

Read more

I am not Python programmer but I’m studying a web browser. I need to check or validate url from QLineEdit if is not valid url will search the text on google for example or another search engine … self.searchbar = QLineEdit() self.searchbar.returnPressed.connect(self.goToSearch) self.navigationbar.addWidget(self.searchbar) … def goToSearch(self): #text = QUrl.fromUserInput(self.searchbar.text()) text = QUrl(self.searchbar.text()) if not text.isValid(): ..

Read more