Apparently, a class inheriting from a QList specialization cannot
be properly exported, while this works fine when inheriting from
std::vector instead. Since we now prefer std containers over Qt's
anyway, changing the baseclass is a Good Thing™ either way, so
just do it.
UiStyle::FormatList ContentsChatItem::formatList() const
{
UiStyle::FormatList fmtList = ChatItem::formatList();
- for (int i = 0; i < privateData()->clickables.count(); i++) {
+ for (size_t i = 0; i < privateData()->clickables.size(); i++) {
Clickable click = privateData()->clickables.at(i);
if (click.type() == Clickable::Url) {
overlayFormat(fmtList, click.start(), click.start() + click.length(), UiStyle::FormatType::Url);
if (QRegExp("^#\\d+$").exactMatch(match))
continue;
}
- result.append(Clickable((Clickable::Type)type, matches[type], matchEnd[type] - matches[type]));
+ result.emplace_back((Clickable::Type)type, matches[type], matchEnd[type] - matches[type]);
}
}
while (type >= 0);
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef CLICKABLE_H_
-#define CLICKABLE_H_
+#pragma once
+
+#include <vector>
#include <QStackedWidget>
};
-class ClickableList : public QList<Clickable>
+class ClickableList : public std::vector<Clickable>
{
public:
static ClickableList fromString(const QString &);
Clickable atCursorPos(int idx);
};
-
-
-#endif // CLICKABLE_H_