qtablewidget

Emiting QTableWidgetItem specific signal on being clicked

China☆狼群 提交于 2021-02-17 02:52:06
问题 I want to implement the functionality that multiple QTableWidgetItems inside of a QTableWidget can be selected and unselected so that the values and "positions" of those QTableWidgetItems is known for further use. Inside of the QTableWidget there are some empty cells, for aesthetics/spacing, which should be ignored by the functionality I'm trying to implement. But that could also easily be done afterwards by checking if a selected item does have content. self.table_widget.itemClicked.connect

Can't select entire row of data from QTableWidget

╄→гoц情女王★ 提交于 2021-02-13 17:34:47
问题 Problem Statement I'm trying to select rows of data from my QtableWidget and print them out to my console just so I can test some things, with the end goal being able to plot the data. However I can never grab the whole row of data. Background I have made a GUI that can embed several QTableWidgets by importing a specifically formatted CSV file. The goal is to be able to pull data from multiple rows from the same or different tables and then plot them in a side by side fashion. Where each row

Can't select entire row of data from QTableWidget

。_饼干妹妹 提交于 2021-02-13 17:32:10
问题 Problem Statement I'm trying to select rows of data from my QtableWidget and print them out to my console just so I can test some things, with the end goal being able to plot the data. However I can never grab the whole row of data. Background I have made a GUI that can embed several QTableWidgets by importing a specifically formatted CSV file. The goal is to be able to pull data from multiple rows from the same or different tables and then plot them in a side by side fashion. Where each row

Can't select entire row of data from QTableWidget

喜欢而已 提交于 2021-02-13 17:32:00
问题 Problem Statement I'm trying to select rows of data from my QtableWidget and print them out to my console just so I can test some things, with the end goal being able to plot the data. However I can never grab the whole row of data. Background I have made a GUI that can embed several QTableWidgets by importing a specifically formatted CSV file. The goal is to be able to pull data from multiple rows from the same or different tables and then plot them in a side by side fashion. Where each row

Copy/paste text from QClipboard freezes program

喜欢而已 提交于 2021-02-10 14:14:55
问题 I have a QTableWidget that when a row is clicked, it selects all cells in that row. I am trying to add a "copy" functionality so that I can ^ctrl-c when row(s) are selected and paste into a text editor. However, with my current code, once i ^ctrl-c a row, the line that I copied keeps getting copied. I have implemented a print statement in my method "read_clipboard" to see whether or not the line copied was read, and this is how I found out that the line keeps getting copied as if in an

How to display 2 SQLite tables with one to many relation into one QTableWidget

主宰稳场 提交于 2021-02-08 08:23:09
问题 I have following two tables in Db, with one to many relationship: self.c.execute("CREATE TABLE IF NOT EXISTS dispatch(" "id_dispatch INTEGER PRIMARY KEY AUTOINCREMENT," "d_date TEXT," "d_mill TEXT," "d_buyer TEXT," "d_addFreight INTEGER," "d_subFreight INTEGER," "d_amount INTEGER," "d_cd INTEGER," "d_comm INTEGER," "d_netAmount INTEGER)") self.c.execute("CREATE TABLE IF NOT EXISTS dispatch_products(" "dispatch_id INTEGER NOT NULL REFERENCES DISPATCH(id_dispatch)," "product INTEGER," "quantity

How to display 2 SQLite tables with one to many relation into one QTableWidget

左心房为你撑大大i 提交于 2021-02-08 08:22:48
问题 I have following two tables in Db, with one to many relationship: self.c.execute("CREATE TABLE IF NOT EXISTS dispatch(" "id_dispatch INTEGER PRIMARY KEY AUTOINCREMENT," "d_date TEXT," "d_mill TEXT," "d_buyer TEXT," "d_addFreight INTEGER," "d_subFreight INTEGER," "d_amount INTEGER," "d_cd INTEGER," "d_comm INTEGER," "d_netAmount INTEGER)") self.c.execute("CREATE TABLE IF NOT EXISTS dispatch_products(" "dispatch_id INTEGER NOT NULL REFERENCES DISPATCH(id_dispatch)," "product INTEGER," "quantity

How to convert QTableWidget data to PDF using PyQt5 Python

荒凉一梦 提交于 2021-02-05 12:13:29
问题 I am working on a python project where I have data stored in QTableWidget . I have to export this data into excel sheet and PDF . I have been able to export data to excel sheet using below code. But unable to understand how can I convert it to PDF . filename, _ = QFileDialog.getSaveFileName(self, 'Save File', '', ".xls(*.xls)") wbk = xlwt.Workbook() sheet = wbk.add_sheet("sheet", cell_overwrite_ok=True) style = xlwt.XFStyle() font = xlwt.Font() font.bold = True style.font = font model = self

Create a QTableWidgetItem with flags()

拈花ヽ惹草 提交于 2021-02-05 05:58:37
问题 I dont understand the Qt5 Documentation in the TableWidgetItem-Chapter. I cant get the right parameters to set my freshly created TableCell as editable. I've got this piece of code for i, item in enumerate(event_desc, start=0): print(i, item) key = QTableWidgetItem(list(event_desc)[i]) value = QTableWidgetItem(event_desc[item]) value.setFlags( * what's to insert here? * ) tw.insertRow(i) tw.setItem(i, 0, key) tw.setItem(i, 1, value) The first param should be *self, the 2nd one is named 'Union

Making a specified table using pyqt5 designer

半腔热情 提交于 2021-01-29 03:57:34
问题 I want to make a specific table like shown in the picture below using pyqt designer and I coulnd't make a good result. I want to make this table in a window and contains the same elements and same dimensions. I tried to use layouts using LineEdits and Qlabels but I couldnt make it too . Thank you. 回答1: Premise: your question didn't show lots of research efforts, and from what was said it's quite clear that you're still a bit inexperienced; this will probably make this answer very complicated,