15#ifndef QTRESOURCEVIEW_H
16#define QTRESOURCEVIEW_H
19#include <QtWidgets/qwidget.h>
20#include <QtWidgets/qdialog.h>
28class QDesignerFormEditorInterface;
35 explicit QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent =
nullptr);
36 ~QtResourceView() override;
38 void setDragEnabled(
bool dragEnabled);
39 bool dragEnabled()
const;
41 QtResourceModel *model()
const;
42 void setResourceModel(QtResourceModel *model);
44 QString selectedResource()
const;
45 void selectResource(
const QString &resource);
47 QString settingsKey()
const;
48 void setSettingsKey(
const QString &key);
50 bool isResourceEditingEnabled()
const;
51 void setResourceEditingEnabled(
bool enable);
54 enum ResourceType { ResourceImage, ResourceStyleSheet, ResourceOther };
55 static QString encodeMimeData(ResourceType resourceType,
const QString &path);
57 static bool decodeMimeData(
const QMimeData *md, ResourceType *t =
nullptr, QString *file =
nullptr);
58 static bool decodeMimeData(
const QString &text, ResourceType *t =
nullptr, QString *file =
nullptr);
61 void resourceSelected(
const QString &resource);
62 void resourceActivated(
const QString &resource);
65 bool event(QEvent *event) override;
68 std::unique_ptr<
class QtResourceViewPrivate> d_ptr;
69 Q_DECLARE_PRIVATE(QtResourceView)
70 Q_DISABLE_COPY_MOVE(QtResourceView)
77 explicit QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent =
nullptr);
78 ~QtResourceViewDialog() override;
80 QString selectedResource()
const;
81 void selectResource(
const QString &path);
83 bool isResourceEditingEnabled()
const;
84 void setResourceEditingEnabled(
bool enable);
87 std::unique_ptr<
class QtResourceViewDialogPrivate> d_ptr;
88 Q_DECLARE_PRIVATE(QtResourceViewDialog)
89 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.
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
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