61
62
/** How many pixels around the thumbnail are shadowed */
62
63
const int SHADOW_SIZE = 4;
65
65
struct ThumbnailBarItemDelegatePrivate {
66
// Key is height * 1000 + width
67
typedef QMap<int, QPixmap> ShadowCache;
68
mutable ShadowCache mShadowCache;
70
ThumbnailBarItemDelegate* mDelegate;
72
ContextBarButton* mToggleSelectionButton;
75
QModelIndex mIndexUnderCursor;
77
void setupToggleSelectionButton() {
78
mToggleSelectionButton = new ContextBarButton("list-add", mView->viewport());
79
mToggleSelectionButton->hide();
80
QObject::connect(mToggleSelectionButton, SIGNAL(clicked(bool)), mDelegate, SLOT(toggleSelection()));
83
void showToolTip(QHelpEvent* helpEvent) {
84
QModelIndex index = mView->indexAt(helpEvent->pos());
85
if (!index.isValid()) {
88
QString fullText = index.data().toString();
89
QPoint pos = QCursor::pos();
90
QToolTip::showText(pos, fullText, mView);
93
void drawShadow(QPainter* painter, const QRect& rect) const {
94
const QPoint shadowOffset(-SHADOW_SIZE, -SHADOW_SIZE + 1);
96
int key = rect.height() * 1000 + rect.width();
98
ShadowCache::Iterator it = mShadowCache.find(key);
99
if (it == mShadowCache.end()) {
100
QSize size = QSize(rect.width() + 2*SHADOW_SIZE, rect.height() + 2*SHADOW_SIZE);
101
QColor color(0, 0, 0, SHADOW_STRENGTH);
102
QPixmap shadow = PaintUtils::generateFuzzyRect(size, color, SHADOW_SIZE);
103
it = mShadowCache.insert(key, shadow);
105
painter->drawPixmap(rect.topLeft() + shadowOffset, it.value());
108
bool hoverEventFilter(QHoverEvent* event) {
109
QModelIndex index = mView->indexAt(event->pos());
110
if (index != mIndexUnderCursor) {
111
updateHoverUi(index);
116
void updateHoverUi(const QModelIndex& index) {
117
QModelIndex oldIndex = mIndexUnderCursor;
118
mIndexUnderCursor = index;
120
if (mIndexUnderCursor.isValid()) {
121
updateToggleSelectionButton();
123
const QRect rect = mView->visualRect(mIndexUnderCursor);
124
mToggleSelectionButton->move(rect.topLeft() + QPoint(2, 2));
125
mToggleSelectionButton->show();
127
mToggleSelectionButton->hide();
131
void updateToggleSelectionButton() {
132
bool isSelected = mView->selectionModel()->isSelected(mIndexUnderCursor);
133
mToggleSelectionButton->setIcon(SmallIcon(isSelected ? "list-remove" : "list-add"));
66
// Key is height * 1000 + width
67
typedef QMap<int, QPixmap> ShadowCache;
68
mutable ShadowCache mShadowCache;
70
ThumbnailBarItemDelegate* q;
72
ContextBarButton* mToggleSelectionButton;
75
QModelIndex mIndexUnderCursor;
77
void setupToggleSelectionButton()
79
mToggleSelectionButton = new ContextBarButton("list-add", mView->viewport());
80
mToggleSelectionButton->hide();
81
QObject::connect(mToggleSelectionButton, SIGNAL(clicked(bool)), q, SLOT(toggleSelection()));
84
void showToolTip(QHelpEvent* helpEvent)
86
QModelIndex index = mView->indexAt(helpEvent->pos());
87
if (!index.isValid()) {
90
QString fullText = index.data().toString();
91
QPoint pos = QCursor::pos();
92
QToolTip::showText(pos, fullText, mView);
95
void drawShadow(QPainter* painter, const QRect& rect) const
97
const QPoint shadowOffset(-SHADOW_SIZE, -SHADOW_SIZE + 1);
99
int key = rect.height() * 1000 + rect.width();
101
ShadowCache::Iterator it = mShadowCache.find(key);
102
if (it == mShadowCache.end()) {
103
QSize size = QSize(rect.width() + 2 * SHADOW_SIZE, rect.height() + 2 * SHADOW_SIZE);
104
QColor color(0, 0, 0, SHADOW_STRENGTH);
105
QPixmap shadow = PaintUtils::generateFuzzyRect(size, color, SHADOW_SIZE);
106
it = mShadowCache.insert(key, shadow);
108
painter->drawPixmap(rect.topLeft() + shadowOffset, it.value());
111
bool hoverEventFilter(QHoverEvent* event)
113
QModelIndex index = mView->indexAt(event->pos());
114
if (index != mIndexUnderCursor) {
115
updateHoverUi(index);
120
void updateHoverUi(const QModelIndex& index)
122
QModelIndex oldIndex = mIndexUnderCursor;
123
mIndexUnderCursor = index;
125
if (mIndexUnderCursor.isValid()) {
126
updateToggleSelectionButton();
128
const QRect rect = mView->visualRect(mIndexUnderCursor);
129
mToggleSelectionButton->move(rect.topLeft() + QPoint(2, 2));
130
mToggleSelectionButton->show();
132
mToggleSelectionButton->hide();
136
void updateToggleSelectionButton()
138
bool isSelected = mView->selectionModel()->isSelected(mIndexUnderCursor);
139
mToggleSelectionButton->setIcon(SmallIcon(isSelected ? "list-remove" : "list-add"));
138
143
ThumbnailBarItemDelegate::ThumbnailBarItemDelegate(ThumbnailView* view)
139
144
: QAbstractItemDelegate(view)
140
, d(new ThumbnailBarItemDelegatePrivate) {
143
d->setupToggleSelectionButton();
144
view->viewport()->installEventFilter(this);
146
d->mBorderColor = PaintUtils::alphaAdjustedF(QColor(Qt::white), 0.65);
150
QSize ThumbnailBarItemDelegate::sizeHint( const QStyleOptionViewItem & /*option*/, const QModelIndex & /*index*/) const {
151
return d->mView->gridSize();
155
bool ThumbnailBarItemDelegate::eventFilter(QObject*, QEvent* event) {
156
switch (event->type()) {
157
case QEvent::ToolTip:
158
d->showToolTip(static_cast<QHelpEvent*>(event));
160
case QEvent::HoverMove:
161
case QEvent::HoverLeave:
162
return d->hoverEventFilter(static_cast<QHoverEvent*>(event));
171
void ThumbnailBarItemDelegate::paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const {
172
bool isSelected = option.state & QStyle::State_Selected;
173
bool isCurrent = d->mView->selectionModel()->currentIndex() == index;
174
QPixmap thumbnailPix = d->mView->thumbnailForIndex(index);
175
QRect rect = option.rect;
177
QStyleOptionViewItemV4 opt = option;
178
const QWidget* widget = opt.widget;
179
QStyle* style = widget ? widget->style() : QApplication::style();
180
if (isSelected && !isCurrent) {
181
// Draw selected but not current item backgrounds with some transparency
182
// so that the current item stands out.
183
painter->setOpacity(.33);
185
style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, widget);
186
painter->setOpacity(1);
189
if (!thumbnailPix.isNull()) {
190
QRect thumbnailRect = QRect(
191
rect.left() + (rect.width() - thumbnailPix.width())/2,
192
rect.top() + (rect.height() - thumbnailPix.height())/2 - 1,
193
thumbnailPix.width(),
194
thumbnailPix.height());
196
if (!thumbnailPix.hasAlphaChannel()) {
197
d->drawShadow(painter, thumbnailRect);
198
painter->setPen(d->mBorderColor);
199
painter->setRenderHint(QPainter::Antialiasing, false);
200
QRect borderRect = thumbnailRect.adjusted(-1, -1, 0, 0);
201
painter->drawRect(borderRect);
203
painter->drawPixmap(thumbnailRect.left(), thumbnailRect.top(), thumbnailPix);
205
// Draw busy indicator
206
if (d->mView->isBusy(index)) {
207
QPixmap pix = d->mView->busySequenceCurrentPixmap();
209
thumbnailRect.left() + (thumbnailRect.width() - pix.width()) / 2,
210
thumbnailRect.top() + (thumbnailRect.height() - pix.height()) / 2,
217
void ThumbnailBarItemDelegate::toggleSelection() {
218
d->mView->selectionModel()->select(d->mIndexUnderCursor, QItemSelectionModel::Toggle);
219
d->updateToggleSelectionButton();
223
ThumbnailBarItemDelegate::~ThumbnailBarItemDelegate() {
145
, d(new ThumbnailBarItemDelegatePrivate)
149
d->setupToggleSelectionButton();
150
view->viewport()->installEventFilter(this);
152
d->mBorderColor = PaintUtils::alphaAdjustedF(QColor(Qt::white), 0.65);
155
QSize ThumbnailBarItemDelegate::sizeHint(const QStyleOptionViewItem & /*option*/, const QModelIndex & /*index*/) const
157
return d->mView->gridSize();
160
bool ThumbnailBarItemDelegate::eventFilter(QObject*, QEvent* event)
162
switch (event->type()) {
163
case QEvent::ToolTip:
164
d->showToolTip(static_cast<QHelpEvent*>(event));
166
case QEvent::HoverMove:
167
case QEvent::HoverLeave:
168
return d->hoverEventFilter(static_cast<QHoverEvent*>(event));
176
void ThumbnailBarItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
178
bool isSelected = option.state & QStyle::State_Selected;
179
bool isCurrent = d->mView->selectionModel()->currentIndex() == index;
180
QPixmap thumbnailPix = d->mView->thumbnailForIndex(index);
181
QRect rect = option.rect;
183
QStyleOptionViewItemV4 opt = option;
184
const QWidget* widget = opt.widget;
185
QStyle* style = widget ? widget->style() : QApplication::style();
186
if (isSelected && !isCurrent) {
187
// Draw selected but not current item backgrounds with some transparency
188
// so that the current item stands out.
189
painter->setOpacity(.33);
191
style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, widget);
192
painter->setOpacity(1);
195
if (!thumbnailPix.isNull()) {
196
QRect thumbnailRect = QRect(
197
rect.left() + (rect.width() - thumbnailPix.width()) / 2,
198
rect.top() + (rect.height() - thumbnailPix.height()) / 2 - 1,
199
thumbnailPix.width(),
200
thumbnailPix.height());
202
if (!thumbnailPix.hasAlphaChannel()) {
203
d->drawShadow(painter, thumbnailRect);
204
painter->setPen(d->mBorderColor);
205
painter->setRenderHint(QPainter::Antialiasing, false);
206
QRect borderRect = thumbnailRect.adjusted(-1, -1, 0, 0);
207
painter->drawRect(borderRect);
209
painter->drawPixmap(thumbnailRect.left(), thumbnailRect.top(), thumbnailPix);
211
// Draw busy indicator
212
if (d->mView->isBusy(index)) {
213
QPixmap pix = d->mView->busySequenceCurrentPixmap();
215
thumbnailRect.left() + (thumbnailRect.width() - pix.width()) / 2,
216
thumbnailRect.top() + (thumbnailRect.height() - pix.height()) / 2,
222
void ThumbnailBarItemDelegate::toggleSelection()
224
d->mView->selectionModel()->select(d->mIndexUnderCursor, QItemSelectionModel::Toggle);
225
d->updateToggleSelectionButton();
228
ThumbnailBarItemDelegate::~ThumbnailBarItemDelegate()
229
234
* This proxy style makes it possible to override the value returned by
230
235
* styleHint() which leads to not-so-nice results with some styles.
232
class ProxyStyle : public QWindowsStyle {
237
class ProxyStyle : public QWindowsStyle
234
ProxyStyle(QStyle* baseStyle) : QWindowsStyle() {
235
mBaseStyle = baseStyle;
238
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = 0) const {
239
mBaseStyle->drawPrimitive(pe, opt, p, w);
242
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = 0) const {
243
mBaseStyle->drawControl(element, opt, p, w);
246
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w = 0) const {
247
mBaseStyle->drawComplexControl(cc, opt, p, w);
250
int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0, QStyleHintReturn *shret = 0) const {
252
case SH_ItemView_ShowDecorationSelected:
254
case SH_ScrollView_FrameOnlyAroundContents:
257
return QWindowsStyle::styleHint(sh, opt, w, shret);
261
void polish(QApplication* application) {
262
mBaseStyle->polish(application);
265
void polish(QPalette& palette) {
266
mBaseStyle->polish(palette);
269
void polish(QWidget* widget) {
270
mBaseStyle->polish(widget);
273
void unpolish(QWidget* widget) {
274
mBaseStyle->unpolish(widget);
277
void unpolish(QApplication* application) {
278
mBaseStyle->unpolish(application);
281
int pixelMetric(PixelMetric pm, const QStyleOption* opt, const QWidget* widget) const {
283
case PM_MaximumDragDistance:
286
return QWindowsStyle::pixelMetric(pm, opt, widget);
240
ProxyStyle(QStyle* baseStyle) : QWindowsStyle() {
241
mBaseStyle = baseStyle;
244
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = 0) const
246
mBaseStyle->drawPrimitive(pe, opt, p, w);
249
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = 0) const
251
mBaseStyle->drawControl(element, opt, p, w);
254
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w = 0) const
256
mBaseStyle->drawComplexControl(cc, opt, p, w);
259
int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0, QStyleHintReturn *shret = 0) const {
261
case SH_ItemView_ShowDecorationSelected:
263
case SH_ScrollView_FrameOnlyAroundContents:
266
return QWindowsStyle::styleHint(sh, opt, w, shret);
270
void polish(QApplication* application)
272
mBaseStyle->polish(application);
275
void polish(QPalette& palette)
277
mBaseStyle->polish(palette);
280
void polish(QWidget* widget)
282
mBaseStyle->polish(widget);
285
void unpolish(QWidget* widget)
287
mBaseStyle->unpolish(widget);
290
void unpolish(QApplication* application)
292
mBaseStyle->unpolish(application);
295
int pixelMetric(PixelMetric pm, const QStyleOption* opt, const QWidget* widget) const {
297
case PM_MaximumDragDistance:
300
return QWindowsStyle::pixelMetric(pm, opt, widget);
296
308
typedef int (QSize::*QSizeDimension)() const;
298
310
struct ThumbnailBarViewPrivate {
301
QTimeLine* mTimeLine;
303
Qt::Orientation mOrientation;
307
QScrollBar* scrollBar() const {
308
return mOrientation == Qt::Horizontal ? q->horizontalScrollBar() : q->verticalScrollBar();
312
QSizeDimension mainDimension() const {
313
return mOrientation == Qt::Horizontal ? &QSize::width : &QSize::height;
317
QSizeDimension oppositeDimension() const {
318
return mOrientation == Qt::Horizontal ? &QSize::height : &QSize::width;
322
void smoothScrollTo(const QModelIndex& index) {
323
if (!index.isValid()) {
327
const QRect rect = q->visualRect(index);
329
int oldValue = scrollBar()->value();
330
int newValue = scrollToValue(rect);
331
if (mTimeLine->state() == QTimeLine::Running) {
334
mTimeLine->setFrameRange(oldValue, newValue);
339
int scrollToValue(const QRect& rect) {
340
// This code is a much simplified version of
341
// QListViewPrivate::horizontalScrollToValue()
342
const QRect area = q->viewport()->rect();
343
int value = scrollBar()->value();
345
if (mOrientation == Qt::Horizontal) {
346
if (q->isRightToLeft()) {
347
value += (area.width() - rect.width()) / 2 - rect.left();
349
value += rect.left() - (area.width()- rect.width()) / 2;
352
value += rect.top() - (area.height() - rect.height()) / 2;
358
void updateMinMaxSizes() {
359
QSizeDimension dimension = oppositeDimension();
360
int scrollBarSize = (scrollBar()->sizeHint().*dimension)();
361
QSize minSize(0, mRowCount * 48 + scrollBarSize);
362
QSize maxSize(QWIDGETSIZE_MAX, mRowCount * 256 + scrollBarSize);
363
if (mOrientation == Qt::Vertical) {
367
q->setMinimumSize(minSize);
368
q->setMaximumSize(maxSize);
372
void updateThumbnailSize() {
373
QSizeDimension dimension = oppositeDimension();
374
int scrollBarSize = (scrollBar()->sizeHint().*dimension)();
375
int widgetSize = (q->size().*dimension)();
378
// Decrease widgetSize because otherwise the view sometimes wraps at
379
// mRowCount-1 instead of mRowCount. Probably because gridSize *
380
// mRowCount is too close to widgetSize.
384
int gridSize = (widgetSize - scrollBarSize - 2 * q->frameWidth()) / mRowCount;
386
q->setGridSize(QSize(gridSize, gridSize));
387
q->setThumbnailSize(gridSize - ITEM_MARGIN * 2);
313
QTimeLine* mTimeLine;
315
Qt::Orientation mOrientation;
318
QScrollBar* scrollBar() const {
319
return mOrientation == Qt::Horizontal ? q->horizontalScrollBar() : q->verticalScrollBar();
322
QSizeDimension mainDimension() const {
323
return mOrientation == Qt::Horizontal ? &QSize::width : &QSize::height;
326
QSizeDimension oppositeDimension() const {
327
return mOrientation == Qt::Horizontal ? &QSize::height : &QSize::width;
330
void smoothScrollTo(const QModelIndex& index)
332
if (!index.isValid()) {
336
const QRect rect = q->visualRect(index);
338
int oldValue = scrollBar()->value();
339
int newValue = scrollToValue(rect);
340
if (mTimeLine->state() == QTimeLine::Running) {
343
mTimeLine->setFrameRange(oldValue, newValue);
347
int scrollToValue(const QRect& rect)
349
// This code is a much simplified version of
350
// QListViewPrivate::horizontalScrollToValue()
351
const QRect area = q->viewport()->rect();
352
int value = scrollBar()->value();
354
if (mOrientation == Qt::Horizontal) {
355
if (q->isRightToLeft()) {
356
value += (area.width() - rect.width()) / 2 - rect.left();
358
value += rect.left() - (area.width() - rect.width()) / 2;
361
value += rect.top() - (area.height() - rect.height()) / 2;
366
void updateMinMaxSizes()
368
QSizeDimension dimension = oppositeDimension();
369
int scrollBarSize = (scrollBar()->sizeHint().*dimension)();
370
QSize minSize(0, mRowCount * 48 + scrollBarSize);
371
QSize maxSize(QWIDGETSIZE_MAX, mRowCount * 256 + scrollBarSize);
372
if (mOrientation == Qt::Vertical) {
376
q->setMinimumSize(minSize);
377
q->setMaximumSize(maxSize);
380
void updateThumbnailSize()
382
QSizeDimension dimension = oppositeDimension();
383
int scrollBarSize = (scrollBar()->sizeHint().*dimension)();
384
int widgetSize = (q->size().*dimension)();
387
// Decrease widgetSize because otherwise the view sometimes wraps at
388
// mRowCount-1 instead of mRowCount. Probably because gridSize *
389
// mRowCount is too close to widgetSize.
393
int gridSize = (widgetSize - scrollBarSize - 2 * q->frameWidth()) / mRowCount;
395
q->setGridSize(QSize(gridSize, gridSize));
396
q->setThumbnailSize(gridSize - ITEM_MARGIN * 2);
393
400
ThumbnailBarView::ThumbnailBarView(QWidget* parent)
394
401
: ThumbnailView(parent)
395
, d(new ThumbnailBarViewPrivate) {
397
d->mTimeLine = new QTimeLine(SMOOTH_SCROLL_DURATION, this);
398
connect(d->mTimeLine, SIGNAL(frameChanged(int)),
399
SLOT(slotFrameChanged(int)));
402
d->mOrientation = Qt::Vertical; // To pass value-has-changed check in setOrientation()
403
setOrientation(Qt::Horizontal);
405
setObjectName( QLatin1String("thumbnailBarView" ));
406
setUniformItemSizes(true);
409
d->mStyle = new ProxyStyle(style());
414
ThumbnailBarView::~ThumbnailBarView() {
420
Qt::Orientation ThumbnailBarView::orientation() const {
421
return d->mOrientation;
425
void ThumbnailBarView::setOrientation(Qt::Orientation orientation) {
426
if (d->mOrientation == orientation) {
429
d->mOrientation = orientation;
431
if (d->mOrientation == Qt::Vertical) {
432
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
433
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
434
setFlow(LeftToRight);
436
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
437
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
438
setFlow(TopToBottom);
441
d->updateMinMaxSizes();
445
void ThumbnailBarView::slotFrameChanged(int value) {
446
d->scrollBar()->setValue(value);
450
void ThumbnailBarView::resizeEvent(QResizeEvent *event) {
451
ThumbnailView::resizeEvent(event);
452
d->updateThumbnailSize();
456
void ThumbnailBarView::selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) {
457
QListView::selectionChanged(selected, deselected);
459
QModelIndexList list = selected.indexes();
460
if (list.count() == 1 && isVisible()) {
461
d->smoothScrollTo(list.first());
466
void ThumbnailBarView::wheelEvent(QWheelEvent* event) {
467
d->scrollBar()->setValue(d->scrollBar()->value() - event->delta());
471
int ThumbnailBarView::rowCount() const {
476
void ThumbnailBarView::setRowCount(int rowCount) {
477
Q_ASSERT(rowCount > 0);
478
d->mRowCount = rowCount;
479
d->updateMinMaxSizes();
480
d->updateThumbnailSize();
402
, d(new ThumbnailBarViewPrivate)
405
d->mTimeLine = new QTimeLine(SMOOTH_SCROLL_DURATION, this);
406
connect(d->mTimeLine, SIGNAL(frameChanged(int)),
407
SLOT(slotFrameChanged(int)));
410
d->mOrientation = Qt::Vertical; // To pass value-has-changed check in setOrientation()
411
setOrientation(Qt::Horizontal);
413
setObjectName(QLatin1String("thumbnailBarView"));
414
setUniformItemSizes(true);
417
d->mStyle = new ProxyStyle(style());
421
ThumbnailBarView::~ThumbnailBarView()
427
Qt::Orientation ThumbnailBarView::orientation() const
429
return d->mOrientation;
432
void ThumbnailBarView::setOrientation(Qt::Orientation orientation)
434
if (d->mOrientation == orientation) {
437
d->mOrientation = orientation;
439
if (d->mOrientation == Qt::Vertical) {
440
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
441
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
442
setFlow(LeftToRight);
444
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
445
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
446
setFlow(TopToBottom);
449
d->updateMinMaxSizes();
452
void ThumbnailBarView::slotFrameChanged(int value)
454
d->scrollBar()->setValue(value);
457
void ThumbnailBarView::resizeEvent(QResizeEvent *event)
459
ThumbnailView::resizeEvent(event);
460
d->updateThumbnailSize();
463
void ThumbnailBarView::selectionChanged(const QItemSelection& selected, const QItemSelection& deselected)
465
QListView::selectionChanged(selected, deselected);
467
QModelIndexList list = selected.indexes();
468
if (list.count() == 1 && isVisible()) {
469
d->smoothScrollTo(list.first());
473
void ThumbnailBarView::wheelEvent(QWheelEvent* event)
475
d->scrollBar()->setValue(d->scrollBar()->value() - event->delta());
478
int ThumbnailBarView::rowCount() const
483
void ThumbnailBarView::setRowCount(int rowCount)
485
Q_ASSERT(rowCount > 0);
486
d->mRowCount = rowCount;
487
d->updateMinMaxSizes();
488
d->updateThumbnailSize();