Posts

Showing posts with the label pyqt5

PYQT5 Qtablewidget.Qcombobox starting index from 1

Image
Clash Royale CLAN TAG #URR8PPP PYQT5 Qtablewidget.Qcombobox starting index from 1 I want to know how to start Qcombobox starting index from 1 not from 0. Arrays start at 0 silly – FrankerZ 2 mins ago By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

PyQt5. How to get cursor position in QTextEdit connected with ContextMenu?

Image
Clash Royale CLAN TAG #URR8PPP PyQt5. How to get cursor position in QTextEdit connected with ContextMenu? I try to get cursor position in QTextEdit : QTextEdit class CustomEdit(QTextEdit): self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.cursor = self.textCursor() self.menu = None self.customContextMenuRequested.connect(self.create_menu) def create_menu(self, pos): self.menu = QMenu() self.menu.addSeparator() func = self.menu.addAction(u'function') action = self.menu.exec_(self.viewport().mapToGlobal(pos)) if action == func: self.func() def func(self) print(self.cursor.positionInBlock()) but it doesn't work. What does it mean that it does not work? – eyllanesc 21 mins ago It returns wrong number that not...

How to use the Qt Designer individually and Ooffline doc for PyQt5 in Eric6?

Image
Clash Royale CLAN TAG #URR8PPP How to use the Qt Designer individually and Ooffline doc for PyQt5 in Eric6? pip install pyqt5 and then install eric6. pip install pyqt5 Now, when i open *.ui , tip could not found designer.I know I can install the entire Qt Creator to get support, but can I install only the Designer? *.ui Another question is how to open an offline PYQT5 help document in ERIC6? install pypi.org/project/pyqt5-tools – eyllanesc 8 mins ago This library has been abandoned. @eyllanesc – Martin Zhu 7 mins ago Where does it say that it has been abandoned ?, besides you want only the executable of Qt designer – eyllanesc 6 mi...

subprocess sometimes sends returns empty

Image
Clash Royale CLAN TAG #URR8PPP subprocess sometimes sends returns empty I have the following class that is used to run a third party command line tool which I have no control over. I run this ina Qthread in a PyQt Gui. Qthread PyQt I turn the gui into an EXE using Pyinstaller gui EXE Pyinstaller Problems are more prevalent when it is an EXE EXE class CLI_Interface: def process_f(self, command, bsize=4096): self.kill_process(CLI_TOOL) startupinfo = STARTUPINFO() startupinfo.dwFlags |= STARTF_USESHOWWINDOW startupinfo.wShowWindow = SW_HIDE p = Popen(command, stdout=PIPE, stderr=PIPE, startupinfo=startupinfo, bufsize=bsize, universal_newlines=True) try: out, err = p.communicate(timeout=120) except TimeoutExpired: p.kill() out, err = p.communicate() return out.split(), err.split() def kill_process(self, proc): # Check process is ru...