aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/propertyeditor/propertyeditorimageprovider.h
diff options
context:
space:
mode:
authorHenning Gruendl <henning.gruendl@qt.io>2022-06-03 14:34:11 +0200
committerHenning Gründl <henning.gruendl@qt.io>2022-06-08 17:30:01 +0000
commitbd51b4fdc2eb080b5883ebecea4a31320aa6ae2d (patch)
treec06ab74f266dd2b2739204fc449741e71c590b1f /src/plugins/qmldesigner/components/propertyeditor/propertyeditorimageprovider.h
parent1c6fa836480808a9fee2ddd9461fc4ad2c4b3058 (diff)
QmlDesigner: Add tooltips to UrlChooser
* Add tooltips with thumbnails to UrlChooser enable preview of image formats and meshes * Add property editor image provider which makes use of the image cache * Add mesh image cache collector in order to create thumbnails for meshes and built-in primitves * Fix typo in explicit image cache image provider * Add return value in time stamp provider if provided file does not exist Change-Id: I2290d2ace87ddd90e9899e343f2ad1ecd2993fdf Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/components/propertyeditor/propertyeditorimageprovider.h')
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorimageprovider.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorimageprovider.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorimageprovider.h
new file mode 100644
index 0000000000..bb883e4450
--- /dev/null
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorimageprovider.h
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#pragma once
+
+#include "imagecache/smallimagecacheprovider.h"
+
+#include <QQuickAsyncImageProvider>
+
+namespace QmlDesigner {
+
+class PropertyEditorImageProvider : public QQuickAsyncImageProvider
+{
+public:
+ PropertyEditorImageProvider(AsynchronousImageCache &imageCache, const QImage &defaultImage = {})
+ : m_smallImageCacheProvider(imageCache, defaultImage)
+ {}
+
+ QQuickImageResponse *requestImageResponse(const QString &id,
+ const QSize &requestedSize) override;
+
+private:
+ SmallImageCacheProvider m_smallImageCacheProvider;
+};
+
+} // namespace QmlDesigner