Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Does QtMvvm support image object binding ? #5

@mangoeffect

Description

@mangoeffect

such like

//data
class ImageData
{
	Q_GADGET

	Q_PROPERTY(QString key MEMBER key USER true)

public:
	QImage img;
};
`
`//ViewModel
class SampleViewModel : public QtMvvm::ViewModel
{
	Q_OBJECT

	Q_PROPERTY(QtDataSync::DataStoreModel* model READ model CONSTANT)

public:
	Q_INVOKABLE explicit SampleViewModel(QObject *parent = nullptr);

	QtDataSync::DataStoreModel* model() const;

public Q_SLOTS:
	void addData(const QImage &key);
	void removeAt(int index);

	void showSyncInfo();

private:
	QtDataSync::DataStoreModel *_model;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions