hey i heard that there is something called qt signals you can use it to change the GUI out side the main thread coz when i try to change it i get an error that i cant change the gui out of the main thread but i need it to edit the progressbar value so if anyone had a way to do it plz tell me
memomk 0 Newbie Poster
Recommended Answers
Jump to Post— Member #911467Hi,
Try something like this:
my_form.py:
# -*- coding: utf-8 -*- from PyQt4 import QtGui, QtCore from main_window import Ui_MainWindow from outside import Outside class MyForm(QtGui.QMainWindow): def __init__(self, parent=None): super(MyForm, self).__init__(parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) outside = Outside() self.connect(outside, QtCore.SIGNAL("progress(int, int)"), self.progress) def progress(self, value, max_value): self.ui.progressBar.setMinimum(0) …
Jump to Post— vegaseat 1,735This code is a simulation (hint) that drives your progress bar for testing purposes..
You have to replace it with code you want to move the progress bar with.
Jump to Post— Member #911467Badly copied piece of code. It should be:
def run(self): for i, item in enumerate(something_iterable): self.emit(QtCore.SIGNAL("progress(int, int)"), i + 1, len(something_iterable))
All 9 Replies
Member #911467
memomk 0 Newbie Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Member #911467
memomk 0 Newbie Poster
Member #911467
memomk 0 Newbie Poster
Member #911467
memomk 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.