#pragma once #include #include #include "clientapi.h" #include "config.h" namespace Ui { class RunePageList; } class DropEvent; class RunePageList : public QListWidget { Q_OBJECT public: static const uint32_t RoleId = Qt::UserRole; static const uint32_t RolePointer = Qt::UserRole + 1; explicit RunePageList(QWidget* parent = nullptr); ~RunePageList(); constexpr void setClient(bool b) { isClient = b; } constexpr void setOther(QListWidget* other) { this->other = other; } void loadRunePages(const std::vector& pages); void loadRunePages(const std::vector>& pages); signals: void runepageChanged(int id, QString name, const RunePage& rp); protected: virtual void dropEvent(QDropEvent* event) override; private: void addRunepageItem(QString name, int id, const ::RunePage& rp, bool isCurrent = false); Ui::RunePageList* ui; QListWidget* other = nullptr; bool isClient; };