Categories
Mastering Development

PyQt5 treeview with multiple columns how to get info into other columns

I am trying to create a tree view in nPyQt5 and I would like to have have the list item as well as the data type and length in the tree, the parent of the tree will not have this information. I have the tree working but everything is in one column in the tree […]

Categories
Mastering Development

PyQT5 Signals connect method not actually binding the method

I am creating a python application. Link to ui.py and app.py: https://gist.github.com/tbhaxor/f68387d49bc59b2bdd025512c17a2534 ui.py # -*- coding: utf-8 -*- # Form implementation generated from reading ui file ‘recent.ui’ # # Created by: PyQt5 UI code generator 5.14.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class […]

Categories
Mastering Development

QWidget becomes invisible on layout assignment

I’m making a custom window using QGridLayout to place window elements: like title bar, size grip, etc. When I set any layout to my widget it doesn’t show up on a start. If I set .setVisible(True) it works nice. So the question is: why does it happen, why widget becomes invisible on layout assignment? Is […]

Categories
Mastering Development

Python novice! I need a button to change text in PyQt5. :(

Absolute beginner here, have no idea what I am doing wrong. All I want to do here is have the pushButton in PyQt5 to change to “Working…” and Red when clicked… which it currently does. Thing is I need it to also change back to the default “SCAN” and Green color when done running that […]

Categories
Mastering Development

Column header is empty when using setHorizontalHeaderLabels in tableWidget

I am new to QtDesigner, i am trying to learn and code, however I am not understanding why below simple code will not set column header name in tableWidget. according to documentation if i want to set column name it should be like this ui.tableWidget.setHorizontalHeaderLabels((‘Col 1’, ‘Col 2’, ‘Col 3’)) but when program load, it […]

Categories
Mastering Development

I want to make a distinct textbox(from a list of textboxes) appear with every circle created on clicking the text button

I have defined a private method in circle class named circlelabel in which I want to show the particular textbox in a list of textboxes (named label here)when a circle is drawn. I have hidden the textboxes and then want to show it as soon as circle is drawn, I don’t know why this is […]

Categories
Development

PyQt5 Adding QCompleter to Existing QTextEdit

I am currently creating a SQL Editor and Query Wizard with PyQt5 and am running into an issue when trying to add a QCompleter to all my QPlainTextEdits in the wizard. All the UI is created with Qt Designer and is stored in a QStackedWidget. I have read into Promoting the widget in Designer to […]

Categories
Development

Recovering Latex Compilation Errors

I have a program to write a text and when I click on the ‘compile’ button, it compiles to latex, converts to pdf and displays it on my application. The problem is that when I have a compilation error, the application bugs and that’s it. I’d like to know if it’s possible to recover compilation […]

Categories
Development

PyQt5: adding a checkbox-column to a custom QSortFilterProxyModel

I have a code to represent a pandas dataframe in a table and provides the filtering functionality as shown in the below: I would like to insert a check box column before the first column, so that the user can select rows. The code uses a PandasModel(QtCore.QAbstractTableModel) model to read pandas data and a CustomProxyModel(QtCore.QSortFilterProxyModel) […]

Categories
Development

PyQT5 and Filtering a Table using multiple columns

I am trying to make a PyQt5 GUI to show a Pandas dataframe in the form of a table and provide column filtering options, similar to the Microsoft Excel filters. So far I managed to adopt a similar SO answer. Here is the picture of my table in the GUI: As shown in the figure […]