15#ifndef QTRESOURCEVIEW_H
16#define QTRESOURCEVIEW_H
19#include <QtWidgets/qwidget.h>
20#include <QtWidgets/qdialog.h>
26class QDesignerFormEditorInterface;
33 explicit QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent =
nullptr);
36 void setDragEnabled(
bool dragEnabled);
37 bool dragEnabled()
const;
39 QtResourceModel *model()
const;
40 void setResourceModel(QtResourceModel *model);
42 QString selectedResource()
const;
43 void selectResource(
const QString &resource);
45 QString settingsKey()
const;
46 void setSettingsKey(
const QString &key);
48 bool isResourceEditingEnabled()
const;
49 void setResourceEditingEnabled(
bool enable);
52 enum ResourceType { ResourceImage, ResourceStyleSheet, ResourceOther };
53 static QString encodeMimeData(ResourceType resourceType,
const QString &path);
55 static bool decodeMimeData(
const QMimeData *md, ResourceType *t =
nullptr, QString *file =
nullptr);
56 static bool decodeMimeData(
const QString &text, ResourceType *t =
nullptr, QString *file =
nullptr);
59 void resourceSelected(
const QString &resource);
60 void resourceActivated(
const QString &resource);
63 bool event(QEvent *event) override;
66 QScopedPointer<
class QtResourceViewPrivate> d_ptr;
67 Q_DECLARE_PRIVATE(QtResourceView)
68 Q_DISABLE_COPY_MOVE(QtResourceView)
75 explicit QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent =
nullptr);
76 ~QtResourceViewDialog() override;
78 QString selectedResource()
const;
79 void selectResource(
const QString &path);
81 bool isResourceEditingEnabled()
const;
82 void setResourceEditingEnabled(
bool enable);
85 QScopedPointer<
class QtResourceViewDialogPrivate> d_ptr;
86 Q_DECLARE_PRIVATE(QtResourceViewDialog)
87 Q_DISABLE_COPY_MOVE(QtResourceViewDialog)
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
The QtBrowserItem class represents a property in a property browser instance.
The QtProperty class encapsulates an instance of a property.
The QtTreePropertyBrowser class provides QTreeWidget based property browser.
The QtVariantProperty class is a convenience class handling QVariant based properties.
QDesignerFormEditorInterface * core() const override
Returns a pointer to \QD's current QDesignerFormEditorInterface object.
void setFormWindow(QDesignerFormWindowInterface *formWindow) override
Sets the currently selected form window to formWindow.
bool selectObject(QObject *o) override
void clearSelection() override
void getSelection(Selection &s) const override
void dragMoveEvent(QDragMoveEvent *event) override
void dragLeaveEvent(QDragLeaveEvent *event) override
void dropEvent(QDropEvent *event) override
void dragEnterEvent(QDragEnterEvent *event) override
~ObjectInspector() override
void reloadResourceProperties() override
QString currentPropertyName() const override
Returns the name of the currently selected property in the property editor.
bool event(QEvent *event) override
This virtual function receives events to an object and should return true if the event e was recogniz...
~PropertyEditor() override
QDesignerFormEditorInterface * core() const override
Returns a pointer to \QD's current QDesignerFormEditorInterface object.
void setObject(QObject *object) override
Changes the currently selected object in \QD's workspace, to object.
QObject * object() const override
Returns the currently selected object in \QD's workspace.
void setReadOnly(bool readOnly) override
If readOnly is true, the property editor is made write protected; otherwise the write protection is r...
bool isReadOnly() const override
Returns true if the property editor is write protected; otherwise false.
void updatePropertySheet() override
void setPropertyValue(const QString &name, const QVariant &value, bool changed=true) override
Sets the value of the property specified by name to value.
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
#define QT_OBJECTINSPECTOR_EXPORT
#define QT_PROPERTYEDITOR_EXPORT
#define INIT_PLUGIN_INSTANCE(PLUGIN)
static int qtMajorVersion(int qtVersion)
static QString widgetBoxFileName(int qtVersion, const QDesignerLanguageExtension *lang=nullptr)
static void setMinorVersion(int minorVersion, int *qtVersion)
static int qtMinorVersion(int qtVersion)
#define QDESIGNER_SHARED_EXPORT