Questions tagged [qstyleditemdelegate]

The QStyledItemDelegate class, part of the Qt framework, provides display and editing facilities for data items from a model.

When displaying data from models in Qt item views, e.g., a QTableView, the individual items are drawn by a delegate. Also, when an item is edited, it provides an editor widget, which is placed on top of the item view while editing takes place. QStyledItemDelegate is the default delegate for all Qt item views, and is installed upon them when they are created.

The QStyledItemDelegate class is one of the Model/View Classes and is part of Qt's model/view framework. The delegate allows the display and editing of items to be developed independently from the model and view.

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

143 questions
0
votes
1 answer

How do I draw a styled focus rectangle in a QStyledItemDelegate?

The following question from Benno Dielmann on the PyQt mailing list has gone unanswered since 2008: [..] I've got a QStyledItemDelegate subclass which implements paint() to draw the contents of some QTableView cells. How do I make it paint a focus…
Mark Visser
  • 2,469
  • 1
  • 22
  • 16
0
votes
0 answers

How to draw custom widgets in qStyledItemDelegate

I want to draw custom widgets in my QListView. But dont have any clue how to do this. In all threads until now I read weak suggestions like "Use QListWidget", which is not an option, because I tried. It is horribly slow. I need to use QListView for…
ManuelSchneid3r
  • 15,850
  • 12
  • 65
  • 103
0
votes
2 answers

Make item delegate in QTableView not transparent

I issued in problem with custom item delegate for QTableView. That problem is completely illustrated by that screenshoot: We can see item content behind item delegate editor. What is the best way to hide that content or make item delegate not…
Yurij
  • 1,530
  • 16
  • 30
0
votes
1 answer

Qt5 C++: Set Spinbox Delegate For Specific Table Column

I'm trying to add a spinbox item delegate to a specific column in my table. After looking though the example in Qt I copied most of that code and implemented it but when I call setItemDelegateForColumn() my application crashes. The column index is…
Jarrod Cabalzar
  • 408
  • 1
  • 5
  • 24
0
votes
1 answer

QTextEdit And QPushButton in one QAbstractModelItem

I use a QTreeView to visualize my objects properties. Its something like the Property Editor in the Qt Designer. I have every kind of values, bool, text, color values, enum, float, int, filenames etc. I use a coustom model for holding all the…
norca
  • 138
  • 1
  • 14
0
votes
1 answer

pyqt : set Item Boundary Line with QStyledItemDelegate

I try to set Item Boundary Line in QListView. When the mouse over the item, the line shows up and when the mouse leave the item, the line back to normal. That's the what I want. So, I use QStyledItemDelegate and it seems do that, it is not…
Hyun-geun Kim
  • 919
  • 3
  • 22
  • 37
-1
votes
1 answer

Setting the Highlight color within a QStyledItemDelegate on a QTableWidget

I am referencing code as written by eyllanesc here: https://stackoverflow.com/a/53357083/3950707 When a cell on my QTableWidget is selected I want the default select colour displayed: However, after setting the initStyleOption, this lighter colour…
-3
votes
1 answer

Delegate is not displayed properly in the QTableView

I am trying to implement a sample code listed in the PySide2 documentation. https://doc.qt.io/qtforpython-5.12/PySide2/QtWidgets/QAbstractItemDelegate.html#PySide2.QtWidgets.QAbstractItemDelegate import sys import os from PySide2.QtWidgets import…
1 2 3
9
10