Posts

Showing posts with the label pyqt5

PyQt 5 QTableWidget.cellClicked Signal Not Working

PyQt 5 QTableWidget.cellClicked Signal Not Working I am trying to make a simple files app (or, file explorer app) and I am using the QTableWidget to Display the files and directories. When the user clicks an directory, I want the program to jump to that directory. I have used the QTableWidget.cellClicked signal, and it does not currently work. The signal part: self.filesTable.connect(print)#self.updateUiCellClick) Added print instead of self.updateUiCellClick for debugging purposes. Code (probably you do not need this): #!/usr/bin/python3 print('i Import Modules') print(' | Import sys') import sys print(' | Import PyQt5.QtCore') from PyQt5.QtCore import * print(' | Import PyQt5.QtGui') from PyQt5.QtGui import * print(' | Import PyQt5.QtWidgets') from PyQt5.QtWidgets import * # PyQt5 Support print(' | Import os') import os print(' | Import subprocess.Popen') # For backward-compatibility from subprocess import Popen, PIPE print(...

Disable enterkey for next button pyqt5 QWizard

Disable enterkey for next button pyqt5 QWizard I am making a Wizard in QWizard QWizard I have QLineEdit and QPushButton QLineEdit QPushButton # Enter token self.enter_token_box = QLineEdit() # Enter token button self.btn = QPushButton('OK') # connect button to function, checks the token.. self.btn.clicked.connect(self._EnterToken) I have put in this line which accepts an enter key press and runs the function the same as clicking the "OK" button. # Enter key press connection self.enter_token_box.returnPressed.connect(self._EnterToken) The problem is that it will trigger BOTH the OK button AND the Next button of the wizard. OK Next MVCE: import sys from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * class Wizard(QWizard): def __init__(self, parent=None): super(Wizard, self).__init__(parent) self.addPage(EnterToken(self)) self.addPage(ProcessData(self)) class EnterToken(QWizardPage): def __init__(self, p...