You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
675 B
40 lines
675 B
#ifndef TABVIEWMODEL_H
|
|
#define TABVIEWMODEL_H
|
|
|
|
#include <QtMvvmCore/ViewModel>
|
|
|
|
class TabViewModel : public QtMvvm::ViewModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Q_INVOKABLE explicit TabViewModel(QObject *parent = nullptr);
|
|
~TabViewModel();
|
|
|
|
public Q_SLOTS:
|
|
void addTab();
|
|
};
|
|
|
|
class TabItemViewModel : public QtMvvm::ViewModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
|
|
|
|
public:
|
|
Q_INVOKABLE explicit TabItemViewModel(QObject *parent = nullptr);
|
|
~TabItemViewModel();
|
|
|
|
QString title() const;
|
|
|
|
Q_SIGNALS:
|
|
void titleChanged(QString title);
|
|
|
|
protected:
|
|
void onInit(const QVariantHash ¶ms) override;
|
|
|
|
private:
|
|
QString _title;
|
|
};
|
|
|
|
#endif // TABVIEWMODEL_H
|
|
|