Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSnapshotView Class Reference

#include <KisSnapshotView.h>

+ Inheritance diagram for KisSnapshotView:

Classes

struct  Private
 

Public Slots

void slotRemoveSelectedSnapshot ()
 
void slotSwitchToSelectedSnapshot ()
 

Public Member Functions

 KisSnapshotView ()
 
void setModel (QAbstractItemModel *model) override
 
 ~KisSnapshotView () override
 

Private Attributes

QScopedPointer< Privatem_d
 

Detailed Description

Definition at line 12 of file KisSnapshotView.h.

Constructor & Destructor Documentation

◆ KisSnapshotView()

KisSnapshotView::KisSnapshotView ( )

Definition at line 17 of file KisSnapshotView.cpp.

18 : QListView()
19 , m_d(new Private)
20{
21 setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::SelectedClicked);
22}
QScopedPointer< Private > m_d

◆ ~KisSnapshotView()

KisSnapshotView::~KisSnapshotView ( )
override

Definition at line 24 of file KisSnapshotView.cpp.

25{
26}

Member Function Documentation

◆ setModel()

void KisSnapshotView::setModel ( QAbstractItemModel * model)
override

Definition at line 28 of file KisSnapshotView.cpp.

29{
30 KisSnapshotModel *snapshotModel = dynamic_cast<KisSnapshotModel *>(model);
31 if (snapshotModel) {
32 QListView::setModel(model);
33 m_d->model = snapshotModel;
34 }
35}

References m_d.

◆ slotRemoveSelectedSnapshot

void KisSnapshotView::slotRemoveSelectedSnapshot ( )
slot

Definition at line 47 of file KisSnapshotView.cpp.

48{
50 QModelIndexList indexes = selectedIndexes();
51 Q_FOREACH (QModelIndex index, indexes) {
52 m_d->model->slotRemoveSnapshot(index);
53 }
54}
#define KIS_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:75

References KIS_ASSERT_RECOVER_RETURN, and m_d.

◆ slotSwitchToSelectedSnapshot

void KisSnapshotView::slotSwitchToSelectedSnapshot ( )
slot

Definition at line 37 of file KisSnapshotView.cpp.

38{
40 QModelIndexList indexes = selectedIndexes();
41 if (indexes.size() != 1) {
42 return;
43 }
44 m_d->model->slotSwitchToSnapshot(indexes[0]);
45}

References KIS_ASSERT_RECOVER_RETURN, and m_d.

Member Data Documentation

◆ m_d

QScopedPointer<Private> KisSnapshotView::m_d
private

Definition at line 25 of file KisSnapshotView.h.


The documentation for this class was generated from the following files: