48 Q_PROPERTY(
int count READ count NOTIFY countChanged)
49 Q_PROPERTY(
bool empty READ isEmpty NOTIFY emptyChanged)
50 Q_PROPERTY(QStringList names READ names NOTIFY namesChanged)
51 Q_PROPERTY(QStringList titles READ titles NOTIFY titlesChanged)
52 Q_PROPERTY(QList<
IrcUser*> users READ users NOTIFY usersChanged)
53 Q_PROPERTY(
Irc::DataRole displayRole READ displayRole WRITE setDisplayRole)
54 Q_PROPERTY(
IrcChannel* channel READ channel WRITE setChannel NOTIFY channelChanged)
55 Q_PROPERTY(
Irc::SortMethod sortMethod READ sortMethod WRITE setSortMethod)
56 Q_PROPERTY(Qt::SortOrder sortOrder READ sortOrder WRITE setSortOrder)
67 QStringList names() const;
68 QStringList titles() const;
70 Q_INVOKABLE
IrcUser* get(
int index) const;
71 Q_INVOKABLE
IrcUser* find(const QString& name) const;
72 Q_INVOKABLE
bool contains(const QString& name) const;
73 Q_INVOKABLE
int indexOf(
IrcUser* user) const;
75 Irc::DataRole displayRole() const;
76 void setDisplayRole(
Irc::DataRole role);
78 Irc::SortMethod sortMethod() const;
79 void setSortMethod(
Irc::SortMethod method);
81 Qt::SortOrder sortOrder() const;
82 void setSortOrder(Qt::SortOrder order);
84 QModelIndex index(
IrcUser* user) const;
85 IrcUser* user(const QModelIndex& index) const;
87#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
88 QHash<int, QByteArray> roleNames()
const override;
90 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
91 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
92 QModelIndex index(
int row,
int column = 0,
const QModelIndex& parent = QModelIndex())
const override;
96 void sort(
int column = 0, Qt::SortOrder order = Qt::AscendingOrder)
override;
97 void sort(
Irc::SortMethod method, Qt::SortOrder order = Qt::AscendingOrder);
104 void countChanged(
int count);
105 void emptyChanged(
bool empty);
106 void namesChanged(
const QStringList& names);
107 void titlesChanged(
const QStringList& titles);
108 void usersChanged(
const QList<IrcUser*>& users);
115 friend class IrcUserLessThan;
116 friend class IrcChannelPrivate;
117 friend class IrcUserGreaterThan;
118 QScopedPointer<IrcUserModelPrivate> d_ptr;