Output I got
DEBUG:git.repo.base:Cmd(['git', 'clone', '-v', 'https://github.com/addddd123/Osdag', 'new_update'])'s unused stdout: <br><br>
QObject: Cannot create children for a parent that is in a different thread.<br><br>
(Parent is QTextDocument(0x55d03b8d0a70), parent's thread is QThread(0x55d0380e7b10), current thread is threadclass(0x7fb988009ab0)
QObject::connect: Cannot queue arguments of type 'QTextCursor'<br><b>
(Make sure 'QTextCursor' is registered using qRegisterMetaType().)
Whole gui works fine even download repo but genrate error
Cannot create children for a parent that is in a different thread, parent's thread is QThread
, current thread is threadclass
class mainwin():
def __init__(self):
super().__init__()
msgbox = QMessageBox()
msgbox.setText(msg)
update_btn=msgbox.addButton('Update', QMessageBox.YesRole)
update_btn.clicked.connect(self.thread_fxn)
def thread_fxn()
self.thread = threadclass()
self.thread.start()
class threadclass(QThread):
def run(self):
# QMessageBox.information(self,'Info',"Downloading... Started")
try:
git.Repo.clone_from('https://github.com/addddd123/Osdag', 'new_update')
QMessageBox.information(self,"info","Download repo successfully")
except:
QMessageBox.information(self,'Info',"No internet!!")
# QMessageBox.information(self,'Info',"Downloaded Successfully")
if platform == "linux" or platform == "linux2":
print("linux system")
os.system('./update.sh')
elif platform == "win32":
import subprocess
print("windows system")
subprocess.call([r'update.bat'])
else:
pass