qtablewidget

QtDesigner & PySide: QTableWidget don't get accessible

人盡茶涼 提交于 2019-12-01 07:34:20
I made a form in QtDesigner. This form gets loaded from PySide with help of the function widget = loader.load(file, parent) However, the QTableWidget (with objectNname buffer_table) don't get accessible with widget.buffer_table If I use a QPushButton instead it works. How can I get this working. I'd like to fill up the table in Python. This is the ui-file i'd like to use: http://pastebin.com/6PZFrvmr EDIT: When I create a new table and try to load it, it seems to work. However, if I put it in a QTabWidget I can't access it. EDIT2: widget.findChild(QWidget, "buffer_table") : Search & find is

Qt/C++ QTableWidget: Doing something when a header is doubleclicked

牧云@^-^@ 提交于 2019-12-01 05:47:05
问题 I have a QTableWidget in my form and I want to do something when a user doubleclicks on the header of a row or column. I am using the following connect statement: connect(ui->tblResults->horizontalHeader(),SIGNAL(doubleClicked(QModelIndex)),this,SLOT(tableDoubleClicked(QModelIndex))); Where this is the window class and ui->tblResults is the QTableWidget on the window's form. When I try doubleclicking the header, nothing happens. The slot I'm connecting to is: void wndSearch:

Align checkable items in qTableWidget

天涯浪子 提交于 2019-12-01 03:11:45
问题 In tableWidget I have one column entirely made up of checkable items. I can't figure out how to center the checkbox or at least remove the text-box next to it. As you can see on this picture text-box has that ugly outline when I click on cell, I would like that turned off in entire table if it's possible. I've read that I need to use a delegates to control the positioning of items/icons, but for nooby like me it would take too long to understand that right, so if there is some simple solution

Reading selected Items from QTableWidget

Deadly 提交于 2019-11-30 15:45:55
问题 How can read selected items from QTableWidget? Thanks 回答1: Some options (there are also others out there too): # selectedRanges(), would give you the second cell from each selected row, for example: indexes = [] for selectionRange in myTable.selectedRanges(): indexes.extend(range(selectionRange.topRow(), selectionRange.bottomRow()+1)) print "indexes", indexes # indexes is a list like [0, 2] of selected rows for i in indexes: print "specific item", myTable.item(i, 1).text() results.append( str

Qt widget for displaying large amount of data rows

左心房为你撑大大i 提交于 2019-11-30 15:24:23
I am trying to display a large amount of columnar records in a scrollable view using Qt (5.1). The number of rows I would like to be able to browse can vary from 100 million to 1 Billion, say. The QTableWidget with a custom model works a few million rows, but the QTableWidget allocates data for each row because you can re-size the rows height, and so it must store data for this, which can use megabytes or even gigabytes of memory with 100M rows. I do not require the re-sizeable rows functionality just a multi-column list would be ideal, but QTreeCtrl doesnt seem to work with many rows, and

Reading selected Items from QTableWidget

这一生的挚爱 提交于 2019-11-30 14:44:21
How can read selected items from QTableWidget? Thanks Some options (there are also others out there too): # selectedRanges(), would give you the second cell from each selected row, for example: indexes = [] for selectionRange in myTable.selectedRanges(): indexes.extend(range(selectionRange.topRow(), selectionRange.bottomRow()+1)) print "indexes", indexes # indexes is a list like [0, 2] of selected rows for i in indexes: print "specific item", myTable.item(i, 1).text() results.append( str(myTable.item(i, 1).text()) ) # selectedItems() for item in myTable.selectedItems(): print "selectedItems",

pyqt QTablewidget remove scrollbar to show full table

纵然是瞬间 提交于 2019-11-30 14:43:36
I have a scrollview to which I dynamically add QTableWidgets. However, the QTables themselves also have scrollbars and therefore dont show the full table. Is there a way to disable the scroll bar so that the table always gets shown in full? EDIT: I added self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) as suggested. The scroll bar does disappear, but it still only shows the partial tables (Ican scroll with hovering iverthe table and using the mouse wheel, still). The code for the Widget is below from PySide.QtGui import * from

PyQt : Checkbox in QTableWidget

﹥>﹥吖頭↗ 提交于 2019-11-30 10:23:52
I use following code to put a checkbox in the 9th column of my QTableWidget chkBoxItem = QtGui.QTableWidgetItem() chkBoxItem.setFlags(QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled) chkBoxItem.setCheckState(QtCore.Qt.Unchecked) table.setItem(rowNo,9,chkBoxItem) Where table is my QtTableWidget . I need to add the row where the checkbox is clicked to a list.. how on earth do I achieve this? Kind regards, One way to do it would be: connect the itemClicked signal of the table to a handler test the checkedState of the clicked item in the handler if the item is checked, add its row to the

How can I add a checkbox/radio button to QTableWidget

亡梦爱人 提交于 2019-11-30 02:59:46
How can I add a checkbox/radiobutton/combobox to a QTableWidget or a QListWidget? serge_gubenko For a checkbox using the item's setCheckState method should do what you need both for list and table widgets. See if code below would work for you: List widget: QListWidgetItem *item0 = new QListWidgetItem(tr("First"), listWidget); QListWidgetItem *item1 = new QListWidgetItem(tr("Second"), listWidget); item0->setCheckState(Qt::Unchecked); item1->setCheckState(Qt::Checked); Table widget: QTableWidgetItem *item2 = new QTableWidgetItem("Item2"); item2->setCheckState(Qt::Checked); tableWidget->setItem(0

Qt widget for displaying large amount of data rows

前提是你 提交于 2019-11-29 22:19:55
问题 I am trying to display a large amount of columnar records in a scrollable view using Qt (5.1). The number of rows I would like to be able to browse can vary from 100 million to 1 Billion, say. The QTableWidget with a custom model works a few million rows, but the QTableWidget allocates data for each row because you can re-size the rows height, and so it must store data for this, which can use megabytes or even gigabytes of memory with 100M rows. I do not require the re-sizeable rows