Changeset View
Changeset View
Standalone View
Standalone View
karbon/ui/dockers/KarbonLayerModel.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 52 | if (layer) | |||
---|---|---|---|---|---|
53 | return layer; | 53 | return layer; | ||
54 | 54 | | |||
55 | return 0; | 55 | return 0; | ||
56 | } | 56 | } | ||
57 | 57 | | |||
58 | KarbonLayerModel::KarbonLayerModel(QObject * parent) | 58 | KarbonLayerModel::KarbonLayerModel(QObject * parent) | ||
59 | : KoDocumentSectionModel(parent), m_document(0) | 59 | : KoDocumentSectionModel(parent), m_document(0) | ||
60 | { | 60 | { | ||
61 | setSupportedDragActions(Qt::MoveAction); | 61 | } | ||
62 | | ||||
63 | Qt::DropActions KarbonLayerModel::supportedDragActions() const | ||||
64 | { | ||||
65 | return Qt::MoveAction; | ||||
62 | } | 66 | } | ||
63 | 67 | | |||
64 | void KarbonLayerModel::update() | 68 | void KarbonLayerModel::update() | ||
65 | { | 69 | { | ||
66 | emit layoutAboutToBeChanged(); | 70 | emit layoutAboutToBeChanged(); | ||
67 | emit layoutChanged(); | 71 | emit layoutChanged(); | ||
68 | } | 72 | } | ||
69 | 73 | | |||
70 | void KarbonLayerModel::setDocument(KarbonDocument * newDocument) | 74 | void KarbonLayerModel::setDocument(KarbonDocument * newDocument) | ||
71 | { | 75 | { | ||
76 | beginResetModel(); | ||||
72 | m_document = newDocument; | 77 | m_document = newDocument; | ||
73 | reset(); | 78 | endResetModel(); | ||
74 | } | 79 | } | ||
75 | 80 | | |||
76 | int KarbonLayerModel::rowCount(const QModelIndex &parent) const | 81 | int KarbonLayerModel::rowCount(const QModelIndex &parent) const | ||
77 | { | 82 | { | ||
78 | if (! m_document) | 83 | if (! m_document) | ||
79 | return 0; | 84 | return 0; | ||
80 | 85 | | |||
81 | // check if parent is root node | 86 | // check if parent is root node | ||
▲ Show 20 Lines • Show All 449 Lines • Show Last 20 Lines |