Questions tagged [qitemdelegate]

QItemDelegate is a Qt class which provides display and editing facilities for data items from a model.

The QItemDelegate class is one of the Model/View Classes and is part of Qt's model/view framework.

QItemDelegate can be used to provide custom display features and editor widgets for item views based on QAbstractItemView subclasses. Using a delegate for this purpose allows the display and editing mechanisms to be customized and developed independently from the model and view.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

145 questions
0
votes
1 answer

PyQt live editing/drawing of Delegate

So I currently have a list of video clips being displayed in a QListView and have created a custom Delegate to paint preview thumbnails for them using data from a QStandardItemModel. Ultimately I want to be able to animate the thumbnails as you…
0
votes
1 answer

QItemDelegate CheckBox

So, I'm using python and PySide2 in Maya for custom tools. I have a model (QTableModel), and a QTableView. every row in the model will have a bunch of information and a checkbox. I got to do a QItemDelegate and use it as a check box. That is…
Mendel Reis
  • 55
  • 2
  • 14
0
votes
1 answer

Qt: Checkbox & QItemDelegate- not painting checkbox when selection occurs

I am using a QItemDelegate combined with the QTableView's IsUserCheckable flag to draw a centered checkbox column. All has been working fine until I have enabled row selection for the table. When selection occurs, the blue selection background is…
cweston
  • 11,297
  • 19
  • 82
  • 107
0
votes
1 answer

C++ Qt: QStyledItemDelegate's createEditor is never called, although paint() is called

I have a QListView where I'd like to display a simple widget with a progress bar and some other fields (and some context menu, maybe, but currently I just want to display the widget). The list has a model under it, and the model successfully…
Sam Markus
  • 320
  • 3
  • 9
0
votes
1 answer

Wrong rich text height (QTextDocument) in item rendered by custom item delegate [Qt]

I have a problem with the text height of a QTextDocument in my tree views item delegate. My paint() and sizeHint() methods are almost exactly the same, but calculate different height of the text (the same text). The difference of height varies…
Szpaqn
  • 545
  • 5
  • 17
0
votes
1 answer

Size of editor in QItemDelegate

I have a custom Delegate, subclassed from QItemDelegate, that provides a QComboBox in the very first column and a QLineEdit in all other columns. SensorDisplayDelegate::SensorDisplayDelegate(QObject *parent) : QItemDelegate(parent) {} QWidget…
user2522981
  • 163
  • 3
  • 18
0
votes
2 answers

Crash when calling getOpenFileName from QItemDelegate's custom editor

Prerequisites: I have a custom QItemDelegate which creates custom editor for treeview items. The editor consists of a QLineEdit and QToolButton. The button is used to open the file dialog for selecting the file and placing it's path into line…
Artyom Chirkov
  • 233
  • 1
  • 10
0
votes
1 answer

paint clears the data in qtableview

I have to display data in a QTableView, I have a model which has data but I subclassed QAbstractProxyModel to Transpose the data in my model, Further I need only one button in the QTableView which can be achieved by subclassing QItemDelegate, Now…
0
votes
0 answers

how to present a user-defined widget in QTableview's cell (without using qml)

These days I encounter a problem about qt. There is a batch data which I want to show in my qt application with QTableview(not qml gridview, since my application use widgets). Each data item include a image and a image name. I need to let the image…
0
votes
1 answer

How to connect QItemDelegate (QLineEdit) change to QSortFilterProxyModel PyQt4?

I tried to set a QlineEdit by subclassing QItemDelegate in first row of my QtableView: class ExampleDelegate(QItemDelegate): def createEditor(self, parent, option, index): self.line_edit = QLineEdit(parent) return…
IMAN4K
  • 1,265
  • 3
  • 24
  • 42
0
votes
1 answer

QItemDelegate: rotate text 90 degrees

I have a span of cells (1 column, 5 rows) where I would like display text on a 90 degree angle. I know I'll need to resize the geometry, but for now I can't even get the text to show up. In the middle row, I'm doing this within my subclassed…
kiss-o-matic
  • 1,111
  • 16
  • 32
0
votes
1 answer

Paint a collapsed QTreeView item differently via a QAbstractItemDelegate

I have a scenario where I want to paint an item in a QTreeView differently when it is collapsed, but I see no way of doing so as neither the model, nor the delegate have any knowledge of the collapsed/expanded state of the item in the view. Note…
Parker Coates
  • 8,520
  • 3
  • 31
  • 37
0
votes
1 answer

Pyside QItemDelegates in QListView

I've been searching the internet far and wide for a tutorial on creating custom items for QListView using PySide. I find some usage using PyQt but I find them really strange to me. I would like to recreate using PySide the appearance of the items of…
0
votes
1 answer

ItemDelegate vs ProxyModel Subclass

I'm have to create a form where some questions will be taken from the db. Each question will have two radioButtons (Yes / No), a label "Explain..." and a textEdit. Firstly I created this in a QScrollArea, where for every question in the db (taken…
0
votes
1 answer

Pyside - delegate readonly checkbox

I want to delegate a readonly Checkbox into a QTableWidget I have the following class for the a checkbox which is shown enabled (editable) from PySide import QtCore, QtGui class CheckBoxDelegate(QtGui.QStyledItemDelegate): """ A delegate…
Elteroooo
  • 2,913
  • 3
  • 33
  • 40
1 2 3
9
10