Changeset View
Changeset View
Standalone View
Standalone View
tabbox/clientmodel.h
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 51 | enum { | |||
---|---|---|---|---|---|
53 | CaptionRole = Qt::UserRole + 1, ///< The caption of TabBoxClient | 53 | CaptionRole = Qt::UserRole + 1, ///< The caption of TabBoxClient | ||
54 | DesktopNameRole = Qt::UserRole + 2, ///< The name of the desktop the TabBoxClient is on | 54 | DesktopNameRole = Qt::UserRole + 2, ///< The name of the desktop the TabBoxClient is on | ||
55 | IconRole = Qt::UserRole + 3, // TODO: to be removed | 55 | IconRole = Qt::UserRole + 3, // TODO: to be removed | ||
56 | WIdRole = Qt::UserRole + 5, ///< The window ID of TabBoxClient | 56 | WIdRole = Qt::UserRole + 5, ///< The window ID of TabBoxClient | ||
57 | MinimizedRole = Qt::UserRole + 6, ///< TabBoxClient is minimized | 57 | MinimizedRole = Qt::UserRole + 6, ///< TabBoxClient is minimized | ||
58 | CloseableRole = Qt::UserRole + 7 ///< TabBoxClient can be closed | 58 | CloseableRole = Qt::UserRole + 7 ///< TabBoxClient can be closed | ||
59 | }; | 59 | }; | ||
60 | explicit ClientModel(QObject* parent = nullptr); | 60 | explicit ClientModel(QObject* parent = nullptr); | ||
61 | ~ClientModel(); | 61 | ~ClientModel() override; | ||
62 | virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; | 62 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; | ||
63 | virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; | 63 | int columnCount(const QModelIndex& parent = QModelIndex()) const override; | ||
64 | virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; | 64 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||
65 | virtual QModelIndex parent(const QModelIndex& child) const; | 65 | QModelIndex parent(const QModelIndex& child) const override; | ||
66 | virtual QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; | 66 | QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; | ||
67 | Q_INVOKABLE QString longestCaption() const; | 67 | Q_INVOKABLE QString longestCaption() const; | ||
68 | 68 | | |||
69 | /** | 69 | /** | ||
70 | * @param client The TabBoxClient whose index should be returned | 70 | * @param client The TabBoxClient whose index should be returned | ||
71 | * @return Returns the ModelIndex of given TabBoxClient or an invalid ModelIndex | 71 | * @return Returns the ModelIndex of given TabBoxClient or an invalid ModelIndex | ||
72 | * if the model does not contain the given TabBoxClient. | 72 | * if the model does not contain the given TabBoxClient. | ||
73 | */ | 73 | */ | ||
74 | QModelIndex index(QWeakPointer<TabBoxClient> client) const; | 74 | QModelIndex index(QWeakPointer<TabBoxClient> client) const; | ||
Show All 39 Lines |