16#ifndef QTRESOURCEVIEW_H
17#define QTRESOURCEVIEW_H
20#include <QtWidgets/qwidget.h>
21#include <QtWidgets/qdialog.h>
29class QDesignerFormEditorInterface;
36 explicit QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent =
nullptr);
37 ~QtResourceView() override;
39 void setDragEnabled(
bool dragEnabled);
40 bool dragEnabled()
const;
42 QtResourceModel *model()
const;
43 void setResourceModel(QtResourceModel *model);
45 QString selectedResource()
const;
46 void selectResource(
const QString &resource);
48 QString settingsKey()
const;
49 void setSettingsKey(
const QString &key);
51 bool isResourceEditingEnabled()
const;
52 void setResourceEditingEnabled(
bool enable);
55 enum ResourceType { ResourceImage, ResourceStyleSheet, ResourceOther };
56 static QString encodeMimeData(ResourceType resourceType,
const QString &path);
58 static bool decodeMimeData(
const QMimeData *md, ResourceType *t =
nullptr, QString *file =
nullptr);
59 static bool decodeMimeData(
const QString &text, ResourceType *t =
nullptr, QString *file =
nullptr);
62 void resourceSelected(
const QString &resource);
63 void resourceActivated(
const QString &resource);
66 bool event(QEvent *event) override;
69 std::unique_ptr<
class QtResourceViewPrivate> d_ptr;
70 Q_DECLARE_PRIVATE(QtResourceView)
71 Q_DISABLE_COPY_MOVE(QtResourceView)
78 explicit QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent =
nullptr);
79 ~QtResourceViewDialog() override;
81 QString selectedResource()
const;
82 void selectResource(
const QString &path);
84 bool isResourceEditingEnabled()
const;
85 void setResourceEditingEnabled(
bool enable);
88 std::unique_ptr<
class QtResourceViewDialogPrivate> d_ptr;
89 Q_DECLARE_PRIVATE(QtResourceViewDialog)
90 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