All Questions
Tagged with pyqt5 qtablewidget
350 questions
1
vote
1
answer
36
views
Drag Items from QListWidget and drop it to the QTableWidget in pyQT
I have a QListWidget and a QTableWidget in my main window. I need to drag an element from the QListWidget and place it in the QTableWidget as a row or column (depends on whether the event will be ...
1
vote
1
answer
126
views
How to implement search bar in column filter for QTableWidget in Pyqt5 Python?
I have a created a QTableWidget using pyqt5 and managed to add filter option in each column of the table widget successfully with one of the answers available on stack overflow. filters works as ...
0
votes
0
answers
65
views
get updated value from comboBox in a QTableWidget
I need to get 3 values from a cell in a QTableWidget so I tried a comboBox. I also have checkboxes in the table. I'm able to get the value of the comboBox when it is clicked, but I need the value it ...
0
votes
0
answers
25
views
Problem when using pyqt tablewidget, float numbers are displayed with an apostrophe for all fractional parts [duplicate]
When using pyqt tablewidget, I find that when the data is a float number and there is only one integer digit, its fractional parts is incorrectly displayed as an ellipsis. This is strange, with or ...
0
votes
2
answers
233
views
How to do QtWidgets.QTableWidget.setHorizontalHeader() to maintain default behavior? [duplicate]
pyqt5. Regular table:
from PyQt5 import QtWidgets
app = QtWidgets.QApplication([])
table = QtWidgets.QTableWidget(3, 3)
table.setHorizontalHeaderLabels(['1', '2', '3'])
table.show()
app.exec_()
...
0
votes
0
answers
41
views
How to use Filter Option in QTableWidget - follow-up issue with PyQt5
I am trying to make use of eyllanesc's brilliant answer to this post using PyQt5. I had to adapt the code for PyQt5 (original was with PyQt4) but I am running into some issues with the function
self....
0
votes
1
answer
71
views
sub classing python pyqt5 QHeaderView [duplicate]
file: table.py
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.resize(400, 300)
self.verticalLayout = QtWidgets.QVBoxLayout(...
1
vote
1
answer
182
views
Merging cells in an Excel-like table with PyQt5 not working as intended
I'm trying to make an Excel-like table in a GUI application with PyQt5. I'm struggling to add a merge/unmerge feature.
After adding a few print statements, I noticed that merging a first group of ...
0
votes
0
answers
15
views
I am having an issue updating a table_widget in PYQT5 [duplicate]
using the following code the file is being created and then read by the code to update the table_widget. The table is not being updated in the gui. Print statements show that the data is being read ...
0
votes
1
answer
93
views
Setting QT_AUTO_SCREEN_SCALE_FACTOR cause QTableWidget gridline and headerView border line miss-alligned
Example:
File: table.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'table.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to ...
0
votes
0
answers
82
views
Display data in TableWidget Qt Designer
{import os
import sys
import pyodbc as odbc
import pandas as pd
from check import * # check is my ui file
class MainWindow(QMainWindow):
def __init__(self,parent=None):
QMainWindow....
1
vote
1
answer
174
views
Adding QTableWidget and QLabel with Pixmap side by side using PyQt6
I am trying to build a GUI with PyQt6 in python where I create a table and an image to the right inside a tab.
For some reason it creates the table occupying the entire screen and does not show the ...
0
votes
1
answer
81
views
How to reposition custom QHeaderview when QTableWidget is scrolled horizontally
I am using a custom header based on QHeaderView to create column labels that span multiple columns. The column labels are themselves QLabel objects. I can correctly resize the column labels when a ...
0
votes
2
answers
233
views
How to add a table in a QGroupBox, PyQt5
I'm pretty new to PyQt5 and still struggle. I tried the whole day adding rows and columns in a QGroupBox. The only solution I found was adding a QTableWidget, the problem with that is the widget size.
...
1
vote
1
answer
298
views
save a QWidget as an image
In pyqt5 i try:
fileName = "qtable_widget.png"
pixmap = QtGui.QPixmap(self.parent_self.main_self.ui_scheduled_transmitions_create_window.review_table.size())
self.parent_self.main_self....
1
vote
1
answer
74
views
why is there a white block on my QTableWidget
I am trying to add dark mode to my app, since I couldn't find anything on styling QTableWidgets I tried to do so from previous knowlage, but it seems that the top area stays the same no matter what do ...
0
votes
0
answers
54
views
QTableWidget doesn't refresh, after trying to import data from csv file with QFileDialog
I am working with PyQt5 and trying to import csv data to my QTableWidget, using QFileDialog which i open with a QPushButton. The issue is, after choosing the file, my QTableWidget won't refresh and ...
1
vote
1
answer
110
views
How to get an old_value from handleItemChanged on QTableWidget in PyQt5
I have a question related to QTableWidget and handleItemChanged.
Is there a way to get the before change and after the change values for comparison?
import sys
from PyQt5.QtCore import *
from PyQt5 ...
0
votes
0
answers
16
views
Trying to get cellEntered connection to work with QTableWidget (I want to trigger one or more callbacks) [duplicate]
I am trying to get a callback when a cell is entered either by clicking or navigating into with arrow or tab keys (basically when it gets focus.) I have tried many of the different connections to no ...
0
votes
0
answers
49
views
Python PyQt5 - how to set corectly size of table
I'm trying to create a small application in python3.8 and PyQt5 and i have a problem with setting size of the tableWidget .
Here is the code :
class MyWindow(QMainWindow):
def __init__(self):
...
0
votes
1
answer
40
views
How do I load a dataset into other cells based on the values in the first cell of the table QTableWidget?
The user drives data into the first cell of the table, which is pulled up from the database by autocomplete. But how do I know that he has finished editing?
Is it necessary for me to take the data ...
-1
votes
1
answer
173
views
Print Selected data from qtable pyqt5 python
I HAVE TRIED MANY BUILT FUNCTION LIKE :
currentItem()
selectedItems()
TO PRINT SELECTED DATA IN QTABLE OF PYQT5 IN PYTHON
WHEN EVER I USE THESE FUNCTION THEY ONLY PRINT THESE
import sys
from PyQt5....
-2
votes
1
answer
304
views
Selecting a table row, coloring a combobox based on item selection
I have this table, and what I want is a few things:
When I click on a cell, I want the entire row from that cell's location to be highlighted,something white-ish, and for some function to be able to ...
1
vote
1
answer
403
views
PyQt How do I implement a delete button to delete selected cells of a table?
So i have my main code here
class MainWindow(QWidget):
def __init__(self):
super().__init__()
self.table_luni_anul_1 = TableWidget(anul_1, "Luni")
self.ani_tab = ...
0
votes
1
answer
196
views
How to print row values from their corresponding buttons in a QTableWidget?
Apologies if the title is not clear.
Brief: I'm using PYQT5 to create a table using QTableWidget. To pull data from my server and populate it on the table, I'm using a JSON API. Along with that, I'm ...
0
votes
1
answer
258
views
Pyqt5 QTableWidget not emitting currentCellChanged signal when a cell containing a QComboBox is entered
I've subclassed QTableWidget to achieve a specific behavior. The first column of my table (idx=0) will contain QComboBoxes, and the second column (idx=1) will contain QLineEdits. This table will be ...
-1
votes
1
answer
463
views
How can I sum up entire columns in a QTableWidget?
I'm trying to do a GUI that can calculate multiple vectors operations (sum, rest, multiplication, division). I'm using the "QTableWidget" from "Qt Designer" and doing the code in ...
1
vote
1
answer
148
views
How to disable the size limit of the QPushButton in the QTableWidget in PyQt5?
I am trying to find solution by some time but nothing works so far..
I made a simple QTableWidget in PyQt5 and while casual QTableWidgetItems and QLabel resizes well using the option ....
-1
votes
1
answer
72
views
PyQt5 Keyboard shortcut for QTableWidget stops working when table is cleared [closed]
I have a QTableWidget that I want to attach a shortcut to to advance to the next cell when the Enter/Return key is pressed using the code I found below. I reuse the table a couple of times so I call ...
1
vote
1
answer
565
views
QTableWidget return current item but return previous value when clicked
Im trying to write function: when click to one value in QtableWidget, this value will show up on lineEdit. But i have a problem: the return value is previous value and i must click one more time,...
0
votes
1
answer
2k
views
PyQt5, QTablewidget.setItem() not working like documented
when I try to write to a specific cell in an QTablewidget I only got an TypeError, although I follow the documentation.
The documentation instructs me:
self.tblLieferboxen.setItem(0,0,'foo')
which ...
0
votes
1
answer
309
views
I'm trying to print QTableWidget as pdf in PyQt5, but i'm getting this glitch
While trying to print QTableWidget I'm getting this glitch where last row is inserted into last column of the 2nd last row, I don't know why is this happening.
I tried a lot of solutions but nothing ...
1
vote
1
answer
790
views
PyQt5: fill QTableWidget from sqlite3 database
I am coding a program being about the management of the products in a grocery. I use PyQt5 in order to make a GUI for my program, and I have a button which is responsible for listing all of the data ...
0
votes
1
answer
135
views
How to do AND instead of OR in if statement comparing columns in PyQt5
I have sample data structure like below:
1
2
3
4
5
6
7
8
9
10
11
12
name_x
14
15
16
name_y
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
Brak
CD
CD
CD
Brak
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
CD
...
1
vote
1
answer
63
views
New signal connects to old slot instead of separate slot
I am trying to tag x-spans of a data trace and populate a table with tagNames, starting x value, and the ending x value. I am using a dictionary of 'highlight' objects to keep track of the x-spans in ...
1
vote
1
answer
600
views
Remove unwanted padding/spacing in QTableWidget cells
I've created a QTableWidget and populated its last column with QPushButtons added inside a QButtonGroup (given in the code below):
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5....
1
vote
2
answers
990
views
PyQt5: fill all columns of QTableWidget
I am trying to solve the sorting issue and found this answer:
QTableWidget Integer
So I borrowed the code, and tried to test and fill multiple columns. However, the second column doesn't get filled ...
1
vote
0
answers
262
views
PyQt sort indicators are not completely visible
I am working with PyQt5. I want to show a sort indicator for my QTableWidget, so I did:
table = QTableWidget()
table.setSortingEnabled(True)
table.horizontalHeader().setSortIndicatorShown(True)
I ...
1
vote
1
answer
128
views
Close and Open QDialog from QDialog 2
So, I have two QDialogs in 2 different classes, in one Qdialog I have a QTableWidget with some data from a MYSQL db, I want to close and re-open it when I close the second Qdialog, so this is what I ...
1
vote
1
answer
616
views
Refresh/Re-open Qdialog with QTableWidget inside
I have a program that is "divided" in 6 classes, the first class is the Main Window where I can choose where I'd like to go (I have 4 choices, a page to visualize all the data, one to modify ...
1
vote
1
answer
774
views
How to switch off selection when QTableWidget loses focus
I'm making a GUI in PyQt5 which has a QTableWidget. Is there some way to get rid of the gray selection of the previous selected cell after moving focus from this QTableWidget to another widget in the ...
1
vote
0
answers
967
views
How to freeze a column of a QTableWidget, not a QTableView
I'd like to freeze a chosen column so it keeps beeing seen when scrolling horizontally using a QTableWidget. Similar to what MSAccess or Excel do. You can see an example of a solution here (but using ...
0
votes
0
answers
18
views
Resize column to text QT Table Widget Python PyQt5 [duplicate]
I have a QT Table Widget in Python where I have N columns, for each columns I set a width, but this is not permorming since I could have some text that is bigger than the width I gave them, how can I ...
0
votes
0
answers
1k
views
QTableWidget set row height adjust to contents [duplicate]
File: untitled.py
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(400, 300)
...
0
votes
1
answer
374
views
How to change row indexes on QTableWidget on PyQt5
So i have a Table which looks something like this:
and I want to change the indexes circled in red.
How do I do that?
2
votes
1
answer
2k
views
How to export QTableWidget data to Excel using Pandas?
I'm trying to pass data from a QTableWidget to Excel. Why in Excel is only the last row of the table written? (In print, the complete table is shown).
rowCount = self.QTableWidget.rowCount()
...
0
votes
0
answers
18
views
PyQt5 QTableWidget | Detect Empty Cell - Disable Specific Columns and Rows [duplicate]
I have been looking for solutions to these two problems for over a week now. There are several similar questions regarding QTableWidget that I found on stack overflow as well as on other sites, ...
0
votes
1
answer
2k
views
display data from MySQL database to qtableview python pyqt5
i faced problem in CRUD methods, i'm using pyqt5 and python 3.9, i want to display data from database and present it into a qtableview, i have tow problem the first one the method did no work ,...
0
votes
1
answer
416
views
Move items and read values from QTableWidget with spinbox widget (PyQt5)
I have a software tool that has a table filled with two columns: parameter and precision. Some parameters in the "Precision" column have spinbox widget and some parameters have just text &...
-1
votes
1
answer
412
views
Argument must be str not tuple
i need to load only the data from database by todays date.
date column in database is in TEXT...
''code to load all the data from database''
def load_database(self):
today_date = ...