<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Dmitry,<br><br>> FEATURE: Isolated Mode for Krita nodes<br><br>Quite Interesting feature indeed :-)<br><br>My best regards,<br><br>Silvio Grosso<br><br>--- <b>Gio 23/5/13, Dmitry Kazakov <i><dimula73@gmail.com></i></b> ha scritto:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>Da: Dmitry Kazakov <dimula73@gmail.com><br>Oggetto: [calligra] /: FEATURE: Isolated Mode for Krita nodes<br>A: kde-commits@kde.org<br>Cc: kimageshop@kde.org<br>Data: Giovedì 23 maggio 2013, 18:07<br><br><div class="plainMail">Git commit e1e85dea054bf7718a05a6e63cec83b59ffe0315 by Dmitry Kazakov.<br>Committed on 23/05/2013 at 18:06.<br>Pushed by dkazakov into branch 'master'.<br><br>FEATURE: Isolated Mode for Krita nodes<br><br>Implemented a mode, which allow a user to limit visible layers by<br>a subtree of a
graph. It means you can look at a layer or mask or<br>a group in isolated environment, without other nodes seen.<br><br>To switch on the mode, you can select a context menu item in the<br>Layers Docker. To switch off, just select another layer or just use<br>the same context menu.<br><br>CCMAIL:<a ymailto="mailto:kimageshop@kde.org" href="/mc/compose?to=kimageshop@kde.org">kimageshop@kde.org</a><br><br>M +52 -9 krita/image/kis_image.cc<br>M +15 -16 krita/image/kis_image.h<br>M +10 -0 krita/image/kis_mask.cc<br>M +10 -0 krita/image/kis_mask.h<br>M +8 -6 krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp<br>M +1 -1 krita/plugins/paintops/libpaintop/kis_custom_brush_widget.cpp<br>M +56 -0
krita/ui/kis_node_manager.cpp<br>M +4 -0 krita/ui/kis_node_manager.h<br>M +45 -2 krita/ui/kis_node_model.cpp<br>M +6 -0 krita/ui/kis_node_model.h<br>M +2 -2 libs/main/KoDocumentSectionDelegate.cpp<br>M +1 -1 libs/main/KoDocumentSectionDelegate.h<br><br><a href="http://commits.kde.org/calligra/e1e85dea054bf7718a05a6e63cec83b59ffe0315" target="_blank">http://commits.kde.org/calligra/e1e85dea054bf7718a05a6e63cec83b59ffe0315</a><br><br>diff --git a/krita/image/kis_image.cc b/krita/image/kis_image.cc<br>index 0c5fc22..ad6cceb 100644<br>--- a/krita/image/kis_image.cc<br>+++ b/krita/image/kis_image.cc<br>@@ -112,6 +112,7 @@ public:<br> KisGroupLayerSP rootLayer; // The layers are contained in here<br> QList<KisLayer*> dirtyLayers; // for
thumbnails<br> QList<KisLayerComposition*> compositions;<br>+ KisNodeSP isolatedRootNode;<br> <br> KisNameServer *nserver;<br> <br>@@ -177,6 +178,13 @@ KisImage::~KisImage()<br> disconnect(); // in case Qt gets confused<br> }<br> <br>+void KisImage::aboutToAddANode(KisNode *parent, int index)<br>+{<br>+ KisNodeGraphListener::aboutToAddANode(parent, index);<br>+ SANITY_CHECK_LOCKED("aboutToAddANode");<br>+ stopIsolatedMode();<br>+}<br>+<br> void KisImage::nodeHasBeenAdded(KisNode *parent, int index)<br> {<br> KisNodeGraphListener::nodeHasBeenAdded(parent, index);<br>@@ -187,6 +195,7 @@ void KisImage::nodeHasBeenAdded(KisNode *parent, int index)<br> <br> void KisImage::aboutToRemoveANode(KisNode *parent, int index)<br> {<br>+ stopIsolatedMode();<br>
KisNodeGraphListener::aboutToRemoveANode(parent, index);<br> <br> SANITY_CHECK_LOCKED("aboutToRemoveANode");<br>@@ -807,6 +816,11 @@ KisGroupLayerSP KisImage::rootLayer() const<br> <br> KisPaintDeviceSP KisImage::projection()<br> {<br>+ if (m_d->isolatedRootNode) {<br>+ return m_d->isolatedRootNode->projection();<br>+ }<br>+<br>+<br> Q_ASSERT(m_d->rootLayer);<br> KisPaintDeviceSP projection = m_d->rootLayer->projection();<br> Q_ASSERT(projection);<br>@@ -1059,7 +1073,7 @@ QImage KisImage::convertToQImage(qint32 x,<br> qint32 h,<br> const
KoColorProfile * profile)<br> {<br>- KisPaintDeviceSP dev = m_d->rootLayer->projection();<br>+ KisPaintDeviceSP dev = projection();<br> if (!dev) return QImage();<br> QImage image = dev->convertToQImage(const_cast<KoColorProfile*>(profile), x, y, w, h,<br> KoColorConversionTransformation::InternalRenderingIntent,<br>@@ -1114,7 +1128,7 @@ QImage KisImage::convertToQImage(const QRect& scaledRect, const QSize& scaledIma<br> srcRect.setTop(static_cast<int>(scaledRect.top() * yScale));<br> srcRect.setBottom(static_cast<int>(ceil((scaledRect.bottom() + 1) * yScale)) - 1);<br> <br>- KisPaintDeviceSP mergedImage =
m_d->rootLayer->projection();<br>+ KisPaintDeviceSP mergedImage = projection();<br> quint8 *scaledImageData = new quint8[scaledRect.width() * scaledRect.height() * pixelSize];<br> <br> quint8 *imageRow = new quint8[srcRect.width() * pixelSize];<br>@@ -1173,13 +1187,6 @@ QImage KisImage::convertToQImage(const QRect& scaledRect, const QSize& scaledIma<br> return image;<br> }<br> <br>-<br>-KisPaintDeviceSP KisImage::mergedImage()<br>-{<br>- refreshGraph();<br>- return m_d->rootLayer->projection();<br>-}<br>-<br> void KisImage::notifyLayersChanged()<br> {<br> m_d->signalRouter->emitNotification(LayersChangedSignal);<br>@@ -1221,6 +1228,8 @@ KisActionRecorder* KisImage::actionRecorder() const<br> <br> void KisImage::setRootLayer(KisGroupLayerSP rootLayer)<br> {<br>+
stopIsolatedMode();<br>+<br> if (m_d->rootLayer) {<br> m_d->rootLayer->setGraphListener(0);<br> m_d->rootLayer->disconnect();<br>@@ -1348,6 +1357,40 @@ KisStrokeId KisImage::startStroke(KisStrokeStrategy *strokeStrategy)<br> return id;<br> }<br> <br>+void KisImage::startIsolatedMode(KisNodeSP node)<br>+{<br>+ barrierLock();<br>+ unlock();<br>+<br>+ m_d->isolatedRootNode = node;<br>+ emit sigIsolatedModeChanged();<br>+<br>+ notifyProjectionUpdated(bounds());<br>+}<br>+<br>+void KisImage::stopIsolatedMode()<br>+{<br>+ if (!m_d->isolatedRootNode) return;<br>+<br>+ KisNodeSP oldRootNode = m_d->isolatedRootNode;<br>+ m_d->isolatedRootNode = 0;<br>+<br>+ emit
sigIsolatedModeChanged();<br>+<br>+ notifyProjectionUpdated(bounds());<br>+<br>+ // TODO: Substitute notifyProjectionUpdated() with this code<br>+ // when update optimization is implemented<br>+ // <br>+ // QRect updateRect = bounds() | oldRootNode->extent();<br>+ // oldRootNode->setDirty(updateRect);<br>+}<br>+<br>+KisNodeSP KisImage::isolatedModeRoot() const<br>+{<br>+ return m_d->isolatedRootNode;<br>+}<br>+<br> void KisImage::addJob(KisStrokeId id, KisStrokeJobData *data)<br> {<br> if (m_d->scheduler) {<br>diff --git a/krita/image/kis_image.h b/krita/image/kis_image.h<br>index 11e17ca..7988df5 100644<br>--- a/krita/image/kis_image.h<br>+++ b/krita/image/kis_image.h<br>@@ -84,6 +84,7 @@ public:<br> <br> public: // KisNodeGraphListener implementation<br> <br>+ void aboutToAddANode(KisNode *parent, int
index);<br> void nodeHasBeenAdded(KisNode *parent, int index);<br> void aboutToRemoveANode(KisNode *parent, int index);<br> void nodeChanged(KisNode * node);<br>@@ -387,22 +388,6 @@ public:<br> }<br> <br> /**<br>- * Starting form 2.3 mergedImage() is declared deprecated.<br>- * If you want to get a projection of the image, please use<br>- * something like:<br>- *<br>- * image->lock();<br>- * read_something_from_the_image(image->projection());<br>- * image->unlock();<br>- *<br>- * or if you want to get a full refresh of the image graph<br>- * performed beforehand (do you really want it?)
(sure?) then<br>- * you can add a call to image->refreshGraph() before locking<br>- * the image.<br>- */<br>- KDE_DEPRECATED KisPaintDeviceSP mergedImage();<br>-<br>- /**<br> * @return the root node of the image node graph<br> */<br> KisGroupLayerSP rootLayer() const;<br>@@ -503,6 +488,11 @@ public:<br> */<br> void removeComposition(KisLayerComposition* composition);<br> <br>+public:<br>+ void startIsolatedMode(KisNodeSP node);<br>+ void stopIsolatedMode();<br>+ KisNodeSP isolatedModeRoot() const;<br>+<br> signals:<br> <br> /**<br>@@ -622,6 +612,15 @@ signals:<br> */<br> void sigStrokeEndRequested();<br> <br>+ /**<br>+
* Emitted when the isolated mode status has changed.<br>+ *<br>+ * Can be used by the recievers to catch a fact of forcefully<br>+ * stopping the isolated mode by the image when some complex<br>+ * action was requested<br>+ */<br>+ void sigIsolatedModeChanged();<br>+<br> public slots:<br> KisCompositeProgressProxy* compositeProgressProxy();<br> <br>diff --git a/krita/image/kis_mask.cc b/krita/image/kis_mask.cc<br>index d4ba755..c3953a6 100644<br>--- a/krita/image/kis_mask.cc<br>+++ b/krita/image/kis_mask.cc<br>@@ -179,6 +179,16 @@ KisPaintDeviceSP KisMask::paintDevice() const<br> return selection()->getOrCreatePixelSelection();<br> }<br> <br>+KisPaintDeviceSP KisMask::original() const<br>+{<br>+ return
paintDevice();<br>+}<br>+<br>+KisPaintDeviceSP KisMask::projection() const<br>+{<br>+ return paintDevice();<br>+}<br>+<br> void KisMask::setSelection(KisSelectionSP selection)<br> {<br> m_d->selection = selection;<br>diff --git a/krita/image/kis_mask.h b/krita/image/kis_mask.h<br>index 056ec68..92c2eaf 100644<br>--- a/krita/image/kis_mask.h<br>+++ b/krita/image/kis_mask.h<br>@@ -119,6 +119,16 @@ public:<br> KisPaintDeviceSP paintDevice() const;<br> <br> /**<br>+ * @return the same as paintDevice()<br>+ */<br>+ KisPaintDeviceSP original() const;<br>+<br>+ /**<br>+ * @return the same as paintDevice()<br>+ */<br>+ KisPaintDeviceSP projection() const;<br>+<br>+ /**<br> * Change the selection to the
specified selection object. The<br> * selection is deep copied.<br> */<br>diff --git a/krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp b/krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp<br>index 00755a3..81e1b78 100644<br>--- a/krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp<br>+++ b/krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp<br>@@ -454,14 +454,16 @@ void KisLayerBox::slotContextMenuRequested(const QPoint &pos, const QModelIndex<br> QAction* mergeLayerDown = menu.addAction(i18n("&Merge with Layer Below"), this, SLOT(slotMergeLayer()));<br> if (!index.sibling(index.row() + 1, 0).isValid()) mergeLayerDown->setEnabled(false);<br> menu.addSeparator();<br>+<br>+ QMenu *convertToMenu =
menu.addMenu(i18n("&Convert"));<br>+ addActionToMenu(convertToMenu, "convert_to_paint_layer");<br>+ addActionToMenu(convertToMenu, "convert_to_transparency_mask");<br>+ addActionToMenu(convertToMenu, "convert_to_filter_mask");<br>+ addActionToMenu(convertToMenu, "convert_to_selection_mask");<br>+<br>+ addActionToMenu(&menu, "isolate_layer");<br> }<br> menu.addSeparator();<br>- QMenu *convertToMenu = menu.addMenu(i18n("&Convert"));<br>- addActionToMenu(convertToMenu, "convert_to_paint_layer");<br>- addActionToMenu(convertToMenu, "convert_to_transparency_mask");<br>- addActionToMenu(convertToMenu, "convert_to_filter_mask");<br>- addActionToMenu(convertToMenu, "convert_to_selection_mask");<br>-
menu.addSeparator();<br> addActionToMenu(&menu, "add_new_transparency_mask");<br> addActionToMenu(&menu, "add_new_filter_mask");<br> addActionToMenu(&menu, "add_new_selection_mask");<br>diff --git a/krita/plugins/paintops/libpaintop/kis_custom_brush_widget.cpp b/krita/plugins/paintops/libpaintop/kis_custom_brush_widget.cpp<br>index ac1601c..0d77ccd 100644<br>--- a/krita/plugins/paintops/libpaintop/kis_custom_brush_widget.cpp<br>+++ b/krita/plugins/paintops/libpaintop/kis_custom_brush_widget.cpp<br>@@ -189,7 +189,7 @@ void KisCustomBrushWidget::createBrush()<br> KisSelectionSP selection = m_image->globalSelection();<br> // create copy of the data<br> m_image->lock();<br>- KisPaintDeviceSP dev = new
KisPaintDevice(*m_image->mergedImage());<br>+ KisPaintDeviceSP dev = new KisPaintDevice(*m_image->projection());<br> m_image->unlock();<br> <br> if (!selection){<br>diff --git a/krita/ui/kis_node_manager.cpp b/krita/ui/kis_node_manager.cpp<br>index 1a7b650..1604ea5 100644<br>--- a/krita/ui/kis_node_manager.cpp<br>+++ b/krita/ui/kis_node_manager.cpp<br>@@ -270,6 +270,16 @@ void KisNodeManager::setup(KActionCollection * actionCollection, KisActionManage<br> connect(&m_d->nodeConversionSignalMapper, SIGNAL(mapped(const QString &)),<br> this, SLOT(convertNode(const QString &)));<br> <br>+ action = new KisAction(koIcon("view-filter"), i18n("&Isolate Layer"), this);<br>+ action->setCheckable(true);<br>+
action->setActivationFlags(KisAction::ACTIVE_NODE);<br>+ actionManager->addAction("isolate_layer", action, actionCollection);<br>+ connect(action, SIGNAL(triggered(bool)), this, SLOT(toggleIsolateMode(bool)));<br>+<br>+ connect(m_d->view->image(), SIGNAL(sigIsolatedModeChanged()),<br>+ this, SLOT(slotUpdateIsolateModeAction()));<br>+ connect(this, SIGNAL(sigNodeActivated(KisNodeSP)), SLOT(slotUpdateIsolateModeAction()));<br>+ connect(this, SIGNAL(sigNodeActivated(KisNodeSP)), SLOT(slotTryFinishIsolatedMode()));<br> }<br> <br> void KisNodeManager::updateGUI()<br>@@ -333,6 +343,52 @@ void KisNodeManager::moveNodeDirect(KisNodeSP node, KisNodeSP parent, KisNodeSP<br> m_d->commandsAdapter->moveNode(node, parent, aboveThis);<br> }<br> <br>+void KisNodeManager::toggleIsolateMode(bool checked)<br>+{<br>+
KisImageWSP image = m_d->view->image();<br>+<br>+ if (checked) {<br>+ KisNodeSP activeNode = this->activeNode();<br>+ Q_ASSERT(activeNode);<br>+<br>+ image->startIsolatedMode(activeNode);<br>+ } else {<br>+ image->stopIsolatedMode();<br>+ }<br>+}<br>+<br>+void KisNodeManager::slotUpdateIsolateModeAction()<br>+{<br>+ KisAction *action = m_d->view->actionManager()->actionByName("isolate_layer");<br>+ Q_ASSERT(action);<br>+<br>+ KisNodeSP activeNode = this->activeNode();<br>+ KisNodeSP isolatedRootNode = m_d->view->image()->isolatedModeRoot();<br>+<br>+ action->setChecked(isolatedRootNode && isolatedRootNode == activeNode);<br>+}<br>+<br>+void
KisNodeManager::slotTryFinishIsolatedMode()<br>+{<br>+ KisNodeSP isolatedRootNode = m_d->view->image()->isolatedModeRoot();<br>+ if (!isolatedRootNode) return;<br>+<br>+ bool belongsToIsolatedGroup = false;<br>+<br>+ KisNodeSP node = this->activeNode();<br>+ while(node) {<br>+ if (node == isolatedRootNode) {<br>+ belongsToIsolatedGroup = true;<br>+ break;<br>+ }<br>+ node = node->parent();<br>+ }<br>+<br>+ if (!belongsToIsolatedGroup) {<br>+ m_d->view->image()->stopIsolatedMode();<br>+ }<br>+}<br>+<br> void KisNodeManager::createNode(const QString & nodeType)<br> {<br> KisNodeSP activeNode =
this->activeNode();<br>diff --git a/krita/ui/kis_node_manager.h b/krita/ui/kis_node_manager.h<br>index 9e8596b..1f81239 100644<br>--- a/krita/ui/kis_node_manager.h<br>+++ b/krita/ui/kis_node_manager.h<br>@@ -138,6 +138,10 @@ public slots:<br> */<br> void moveNodeDirect(KisNodeSP node, KisNodeSP parent, KisNodeSP aboveThis);<br> <br>+ void toggleIsolateMode(bool checked);<br>+ void slotUpdateIsolateModeAction();<br>+ void slotTryFinishIsolatedMode();<br>+<br> void moveNodeAt(KisNodeSP node, KisNodeSP parent, int index);<br> void createNode(const QString &node);<br> void convertNode(const QString &nodeType);<br>diff --git a/krita/ui/kis_node_model.cpp b/krita/ui/kis_node_model.cpp<br>index 8d64888..1b354c3 100644<br>--- a/krita/ui/kis_node_model.cpp<br>+++ b/krita/ui/kis_node_model.cpp<br>@@
-99,6 +99,26 @@ QModelIndex KisNodeModel::indexFromNode(KisNodeSP node) const<br> return m_d->indexConverter->indexFromDummy(dummy);<br> }<br> <br>+bool KisNodeModel::belongsToIsolatedGroup(KisNodeSP node) const<br>+{<br>+ KisNodeSP isolatedRoot = m_d->image->isolatedModeRoot();<br>+ if (!isolatedRoot) return true;<br>+<br>+ KisNodeDummy *isolatedRootDummy =<br>+ m_d->dummiesFacade->dummyForNode(isolatedRoot);<br>+ KisNodeDummy *dummy =<br>+ m_d->dummiesFacade->dummyForNode(node);<br>+<br>+ while (dummy) {<br>+ if (dummy == isolatedRootDummy) {<br>+ return true;<br>+ }<br>+ dummy = dummy->parent();<br>+ }<br>+<br>+ return
false;<br>+}<br>+<br> void KisNodeModel::resetIndexConverter()<br> {<br> delete m_d->indexConverter;<br>@@ -116,6 +136,23 @@ void KisNodeModel::resetIndexConverter()<br> }<br> }<br> <br>+void KisNodeModel::regenerateItems(KisNodeDummy *dummy)<br>+{<br>+ const QModelIndex &index = m_d->indexConverter->indexFromDummy(dummy);<br>+ emit dataChanged(index, index);<br>+<br>+ dummy = dummy->firstChild();<br>+ while (dummy) {<br>+ regenerateItems(dummy);<br>+ dummy = dummy->nextSibling();<br>+ }<br>+}<br>+<br>+void KisNodeModel::slotIsolatedModeChanged()<br>+{<br>+ regenerateItems(m_d->dummiesFacade->rootDummy());<br>+}<br>+<br> void KisNodeModel::updateSettings()<br> {<br> KisConfig cfg;<br>@@ -163,14 +200,16 @@ void
KisNodeModel::connectDummies(KisNodeDummy *dummy, bool needConnect)<br> <br> void KisNodeModel::setDummiesFacade(KisDummiesFacadeBase *dummiesFacade, KisImageWSP image, KisShapeController *shapeController)<br> {<br>- m_d->image = image;<br>+<br> m_d->shapeController = shapeController;<br> <br> if(m_d->dummiesFacade) {<br>+ m_d->image->disconnect(this);<br> m_d->dummiesFacade->disconnect(this);<br> connectDummies(m_d->dummiesFacade->rootDummy(), false);<br> }<br> <br>+ m_d->image = image;<br> m_d->dummiesFacade = dummiesFacade;<br> resetIndexConverter();<br> <br>@@ -191,6 +230,8 @@ void KisNodeModel::setDummiesFacade(KisDummiesFacadeBase *dummiesFacade, KisImag<br> <br>
connect(m_d->dummiesFacade, SIGNAL(sigDummyChanged(KisNodeDummy*)),<br> SLOT(slotDummyChanged(KisNodeDummy*)));<br>+<br>+ connect(m_d->image, SIGNAL(sigIsolatedModeChanged()), SLOT(slotIsolatedModeChanged()));<br> }<br> <br> reset();<br>@@ -320,6 +361,8 @@ QVariant KisNodeModel::data(const QModelIndex &index, int role) const<br> case Qt::DecorationRole: return node->icon();<br> case Qt::EditRole: return node->name();<br> case Qt::SizeHintRole: return m_d->image->size(); // FIXME<br>+ case Qt::TextColorRole:<br>+ return belongsToIsolatedGroup(node) ? QVariant() : Qt::gray;<br> case PropertiesRole: return
QVariant::fromValue(node->sectionModelProperties());<br> case AspectRatioRole: return double(m_d->image->width()) / m_d->image->height();<br> case ProgressRole: {<br>@@ -327,7 +370,7 @@ QVariant KisNodeModel::data(const QModelIndex &index, int role) const<br> return proxy ? proxy->percentage() : -1;<br> }<br> default:<br>- if (role >= int(BeginThumbnailRole))<br>+ if (role >= int(BeginThumbnailRole) && belongsToIsolatedGroup(node))<br> return node->createThumbnail(role - int(BeginThumbnailRole), role - int(BeginThumbnailRole));<br> else<br> return QVariant();<br>diff --git
a/krita/ui/kis_node_model.h b/krita/ui/kis_node_model.h<br>index 6352853..76d04eb 100644<br>--- a/krita/ui/kis_node_model.h<br>+++ b/krita/ui/kis_node_model.h<br>@@ -79,6 +79,8 @@ private slots:<br> void slotEndRemoveDummy();<br> void slotDummyChanged(KisNodeDummy *dummy);<br> <br>+ void slotIsolatedModeChanged();<br>+<br> void updateSettings();<br> void processUpdateQueue();<br> void progressPercentageChanged(int, const KisNodeSP);<br>@@ -95,6 +97,10 @@ private:<br> bool correctNewNodeLocation(KisNodeSP node,<br> KisNodeDummy* &parentDummy,<br>
KisNodeDummy* &aboveThisDummy);<br>+<br>+ void regenerateItems(KisNodeDummy *dummy);<br>+ bool belongsToIsolatedGroup(KisNodeSP node) const;<br>+<br> private:<br> <br> struct Private;<br>diff --git a/libs/main/KoDocumentSectionDelegate.cpp b/libs/main/KoDocumentSectionDelegate.cpp<br>index 13d6100..81ae7b1 100644<br>--- a/libs/main/KoDocumentSectionDelegate.cpp<br>+++ b/libs/main/KoDocumentSectionDelegate.cpp<br>@@ -264,9 +264,9 @@ bool KoDocumentSectionDelegate::eventFilter(QObject *object, QEvent *event)<br> // PRIVATE<br> <br> <br>-QStyleOptionViewItem KoDocumentSectionDelegate::getOptions(const QStyleOptionViewItem &o, const QModelIndex &index)<br>+QStyleOptionViewItemV4 KoDocumentSectionDelegate::getOptions(const QStyleOptionViewItem &o, const QModelIndex &index)<br> {<br>- QStyleOptionViewItem option = o;<br>+ QStyleOptionViewItemV4
option = o;<br> QVariant v = index.data(Qt::FontRole);<br> if (v.isValid()) {<br> option.font = v.value<QFont>();<br>diff --git a/libs/main/KoDocumentSectionDelegate.h b/libs/main/KoDocumentSectionDelegate.h<br>index e804f5d..ad4b9f1 100644<br>--- a/libs/main/KoDocumentSectionDelegate.h<br>+++ b/libs/main/KoDocumentSectionDelegate.h<br>@@ -57,7 +57,7 @@ private:<br> class Private;<br> Private* const d;<br> <br>- static QStyleOptionViewItem getOptions(const QStyleOptionViewItem &option, const QModelIndex &index);<br>+ static QStyleOptionViewItemV4 getOptions(const QStyleOptionViewItem &option, const QModelIndex &index);<br> int thumbnailHeight(const QStyleOptionViewItem &option, const QModelIndex &index) const;<br> int
availableWidth() const;<br> int textBoxHeight(const QStyleOptionViewItem &option) const;<br>_______________________________________________<br>Krita mailing list<br><a ymailto="mailto:kimageshop@kde.org" href="/mc/compose?to=kimageshop@kde.org">kimageshop@kde.org</a><br><a href="https://mail.kde.org/mailman/listinfo/kimageshop" target="_blank">https://mail.kde.org/mailman/listinfo/kimageshop</a><br></div></blockquote></td></tr></table>