◆ FileItemDelegate()
◆ createItemWidgets()
| QList< QWidget * > FileItemDelegate::createItemWidgets |
( |
const QModelIndex & | index | ) |
const |
|
inlineoverride |
Definition at line 52 of file KisAutoSaveRecoveryDialog.cpp.
53 {
54
55 QWidget *page = new QWidget;
56 QHBoxLayout *
layout =
new QHBoxLayout(page);
57
58 QCheckBox *checkBox = new QCheckBox;
59 checkBox->setProperty("fileitem", index.data());
60
61 connect(checkBox, SIGNAL(toggled(
bool)),
m_parent, SLOT(toggleFileItem(
bool)));
62 QLabel *thumbnail = new QLabel;
63 QLabel *filename = new QLabel;
64 QLabel *dateModified = new QLabel;
65
66 layout->addWidget(checkBox);
67 layout->addWidget(thumbnail);
68 layout->addWidget(filename);
69 layout->addWidget(dateModified);
70
71 page->setFixedSize(600, 200);
72
74 }
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
References connect(), and m_parent.
◆ paint()
| void FileItemDelegate::paint |
( |
QPainter * | painter, |
|
|
const QStyleOptionViewItem & | option, |
|
|
const QModelIndex & | ) const |
|
inlineoverride |
Definition at line 106 of file KisAutoSaveRecoveryDialog.cpp.
107 {
108
109 QStyleOptionViewItem opt = option;
110 itemView()->style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, 0);
111 }
◆ sizeHint()
| QSize FileItemDelegate::sizeHint |
( |
const QStyleOptionViewItem & | , |
|
|
const QModelIndex & | ) const |
|
inlineoverride |
◆ updateItemWidgets()
| void FileItemDelegate::updateItemWidgets |
( |
const QList< QWidget * > & | widgets, |
|
|
const QStyleOptionViewItem & | option, |
|
|
const QPersistentModelIndex & | index ) const |
|
inlineoverride |
Definition at line 81 of file KisAutoSaveRecoveryDialog.cpp.
87 {
89
90 QWidget* page= widgets[0];
91 QHBoxLayout*
layout = qobject_cast<QHBoxLayout*>(page->layout());
92 QCheckBox *checkBox = qobject_cast<QCheckBox*>(
layout->itemAt(0)->widget());
93 QLabel *thumbnail = qobject_cast<QLabel*>(
layout->itemAt(1)->widget());
94 QLabel *filename = qobject_cast<QLabel*>(
layout->itemAt(2)->widget());
95 QLabel *modified = qobject_cast<QLabel*>(
layout->itemAt(3)->widget());
96
97 checkBox->setChecked(fileItem->
checked);
98 thumbnail->setPixmap(QPixmap::fromImage(fileItem->
thumbnail));
99 filename->setText(fileItem->
name);
100 modified->setText(fileItem->
date);
101
102
103 page->setGeometry(option.rect.translated(0, -option.rect.y()));
104 }
References FileItem::checked, FileItem::date, FileItem::name, and FileItem::thumbnail.
◆ m_parent
The documentation for this class was generated from the following file: