What's the best way to use QT4's QItemDelegate to show thumbnails for images in a view?
Specifically, how do you stop the item delegate from blocking when generating pixmaps from very large image files (> 500MB)?
Can anyone link to some example code that achieves this? Then again, perhaps this isn't the place to look for Qt-specific c...
QCombobox set Item delegate not painting for current Item..
I am trying to create a combo box showing different line types (Solid, Dotted, Dash etc). Currently i am setting item delegate for its content
so as to draw/paint line type instead of displaying names. All line types are drawing currectly but as soon as i am selecting any line ...
I've got a QTableView for which I want to display the last column always in edit mode. (It's a QComboBox where the user should be able to always change the value.)
I think I've seen the solution in the Qt documentation, but I can't find it anymore. Is there a simple way of doing it?
I think I could archive this effect by using openPers...
I'm subclassing QAbstractItemDelegate. This is my code. Suggestions are welcome:
QWidget *ParmDelegate::createWidget(Parm *p, const QModelIndex &index) const {
QWidget *w;
if (index.column() == 0) {
w = new QLabel(p->getName().c_str());
} else {
if (p->isSection())
return NULL;
w = p->createControl();
...
Hello,
I want to display a QListView where each item is a checkbox with some label. The checkboxes should be visible at all times. One way I can think of is using a custom delegate and QAbstractListModel. Are there simpler ways? Can you provide the simplest snippet that does this?
Thanks in advance
...
I'm writing my first Qt application with PyQt and am having some trouble creating a custom list view. I'd like the list to contain arbitrary widgets (one custom widget in particular). How would I go about this?
It seems that the alternative would be to create a table or grid view wrapped in a scrollbar. However, I'd like to be able t...
I'm trying to make the cells of a QTableView look like 3D clickable buttons. So that when you click on a cell, the button looks pushed. Everyone seems to think I merely want to change the colour, I need to show images of a normal button, and a pushed button, that look 3-dimensional.
I have done this already with calling QTableView::setI...
I understand more or less how does MPV works.
But I don't get what classes:
QAbstractItemModel
QAbstractItemView
QAbstractItemDelegate / QItemDelegate
Can do for me?
If that is relevant, I'm using
QGraphicsScene / QGraphicsView with some elements (visual representation of game board) that user can interact with while the interaction log...
All examples in Qt show that one should use delegate classes to provide editors that reside within QTreeView (QListView, etc). I want to have a separate non-modal dialog to edit item's attributes. Should I use delegate classes to do so?
That is, no editing or special behavior is required within QTreeView.
...
I am making a table using QItemDelegate. I use the paint(..) method to draw delegated items to look the same when they go out of edit mode but I also need to draw the items differently when they are selected or not and the paint method is also called during those events. My question is how do I know when to draw which?
thank you.
...
I have a QTableView connected with an QSqlTableModel.
In the first column, there are only dates at this format: 2010-01-02
I want this column to show the date at this format (but without changing the real data): 02.01.2010
I know that I have to create an QItemDelegate for this column, but I don't know how I can read the existing data and...
Hi, All!
I'm trying to write simple property editor. I have automatically generated pyqt class (WorkZone in the code below), and I need to view/edit some of it's properties with PropertyEditor, with the delegate PropertyEditorDelegate, that uses custom editors ColorEditor, LineEditor, etc.
Main idea is that WorkZone knows what propertie...
I have a QTableView which I am setting a custom QStyledItemDelegate on.
In addition to the custom item painting, I want to style the row's background color for the selection/hovered states. The look I am going for is something like this KGet screenshot:
Here is my code:
void MyDelegate::paint( QPainter* painter, const QStyleOptionVie...
Hi, all!
I have modified combobox to hold colors, using QtColorCombo (http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Widgets/qtcolorcombobox) as howto for the 'more...' button implementation details. It works fine in C++ and in PyQt on linux, but I get 'underlying C++ object was destroyed' when use this control in PyQt on ...
Hi,
I have a QTableView with QSqlTableModel and with 3 columns, now I need to have:
- second column: spinbox after clicked to edit
- third column: checkbox (displayed center)
My code:
class SpinBoxDelegate(QtGui.QItemDelegate):
def createEditor(self, parent, option, index):
editor = QtGui.QSpinBox(parent)
editor.setMinimum(0)
...
Hi there!
I have a QTableView defines in UI file. Here is the figure:
I'd like to make month change (where the red array points) with QComboBox widget, dealing with delegates, but for me, for my custom delegate and model it's a too complex problem, and I can't figure out what is wrong?!
Problem: on my opinion, QAbstractTableModel ca...
Hello everyone,
I'm using a custom delegate to display QDoubleSpinBoxes in a QTableView. Those spinboxes display their contents with two decimals.
My problem is that I would like the QTableView to also display those numbers with two decimals while they are not being edited (at which point they are not in a QDoubleSpinBox). Or, rather,...
Is there a way of doing this without using a QItemDelegate? I've been having a lot of trouble with it. For example, if I use a Delegate:
1) Won't have a native dialog.
2) I'll have to implement my own image preview,
2) For some reason I can't resize the window cause setGeometry doesn't work, etc etc.
QWidget *createEditor(
QWi...