bunch of stuff. very basic drag/drop now working
This commit is contained in:
51
tierrow.hpp
Normal file
51
tierrow.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef TIERROW_HPP
|
||||
#define TIERROW_HPP
|
||||
|
||||
#include "tiercard.hpp"
|
||||
#include "tierrowtitlecard.hpp"
|
||||
#include "flowlayout.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QDrag>
|
||||
|
||||
class TierRow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using IdType = TierRowTitleCard::IdType;
|
||||
static TierRow* create(QWidget* parent = nullptr);
|
||||
static TierRow* getFromId(IdType id);
|
||||
~TierRow();
|
||||
void addCard(TierCard* card);
|
||||
TierCard* takeCard(uint32_t id);
|
||||
void setColor(QColor color);
|
||||
QColor color();
|
||||
void setText(QString text);
|
||||
QString text();
|
||||
uint32_t id();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
// void mousePressEvent(QMouseEvent* event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void dragMoveEvent(QDragMoveEvent *event) override;
|
||||
|
||||
private:
|
||||
explicit TierRow(IdType id, QWidget* parent = nullptr);
|
||||
TierRowTitleCard* titleCard;
|
||||
QWidget* bgFadeContainer;
|
||||
QWidget* cardContainer;
|
||||
QLayout* cardLayout;
|
||||
QColor _color;
|
||||
void recalcMaxHeight();
|
||||
inline static std::unordered_map<IdType, TierRow*> idMap;
|
||||
|
||||
public slots:
|
||||
void cardResize(QRect newSize);
|
||||
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
#endif // TIERROW_HPP
|
||||
Reference in New Issue
Block a user