Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix leak in TagFilterProxyModel, fix QML errors and speed up glyphmodel some more.

Wolthera van Hövell tot Westerflier7a9dd6f61892
diff --git a/libs/flake/text/KoFontGlyphModel.cpp b/libs/flake/text/KoFontGlyphModel.cpp
index eef2fa5b9a..fba72c741a 100644
--- a/libs/flake/text/KoFontGlyphModel.cpp
+++ b/libs/flake/text/KoFontGlyphModel.cpp
@@ -228,7 +228,7 @@ struct KoFontGlyphModel::Private {
}
featureInfo.insert(tagName, info);
- if (!info.glyphPalette) {
+ if (!info.glyphPalette || (samplesOnly && !info.sample.isEmpty())) {
continue;
}
diff --git a/plugins/dockers/textproperties/TagFilterProxyModelQmlWrapper.cpp b/plugins/dockers/textproperties/TagFilterProxyModelQmlWrapper.cpp
index 34a7a3b75d..965ca482e4 100644
--- a/plugins/dockers/textproperties/TagFilterProxyModelQmlWrapper.cpp
+++ b/plugins/dockers/textproperties/TagFilterProxyModelQmlWrapper.cpp
@@ -16,10 +16,10 @@
#include <resources/KoFontFamily.h>
struct TagFilterProxyModelQmlWrapper::Private {
- Private()
- : tagFilterProxyModel(new FontFamilyTagFilterModel())
- , tagModel(new KisTagModel(ResourceType::FontFamilies))
- , compressor(KisSignalCompressor(100, KisSignalCompressor::POSTPONE))
+ Private(QObject *parent = nullptr)
+ : tagFilterProxyModel(new FontFamilyTagFilterModel(parent))
+ , tagModel(new KisTagModel(ResourceType::FontFamilies, parent))
+ , compressor(KisSignalCompressor(100, KisSignalCompressor::POSTPONE, parent))
{
allResourceModel = KisResourceModelProvider::resourceModel(ResourceType::FontFamilies);
tagFilterProxyModel->sort(KisAbstractResourceModel::Name);
@@ -35,7 +35,7 @@ struct TagFilterProxyModelQmlWrapper::Private {
TagFilterProxyModelQmlWrapper::TagFilterProxyModelQmlWrapper(QObject *parent)
: QObject(parent)
- , d(new Private())
+ , d(new Private(parent))
{
connect(&d->compressor, SIGNAL(timeout()), this, SLOT(setSearchTextOnModel()));
diff --git a/plugins/dockers/textproperties/qml/FontStyle.qml b/plugins/dockers/textproperties/qml/FontStyle.qml
index 30997245a5..abb7c3db82 100644
--- a/plugins/dockers/textproperties/qml/FontStyle.qml
+++ b/plugins/dockers/textproperties/qml/FontStyle.qml
@@ -96,7 +96,7 @@ CollapsibleGroupProperty {
titleItem: RowLayout{
width: parent.width;
- height: childrenRect.height;
+ height: implicitHeight;
spacing: columnSpacing;
Label {
id: propertyTitle;
@@ -105,6 +105,7 @@ CollapsibleGroupProperty {
color: sysPalette.text;
elide: Text.ElideRight;
Layout.maximumWidth: contentWidth;
+ Layout.preferredHeight: implicitHeight;
}
SqueezedComboBox {
@@ -112,6 +113,7 @@ CollapsibleGroupProperty {
model: fontStylesModel;
textRole: "display";
Layout.fillWidth: true;
+ Layout.preferredHeight: implicitHeight;
onActivated: {
if (!blockSignals) {
// Because each change to propertiesModel causes signals to fire,