Skip to content
OE_ui_stitchlist.h 1 KiB
Newer Older
#ifndef OE_UI_STITCHLIST_H
#define OE_UI_STITCHLIST_H

#include "main.h"
#include "mainwindow.h"
#include <QListView>
#include "listviewdelegate.h"

class OE_controller;
class OE_interfaceDisplay;
class OE_document;
class OE_ui_stitchList : public QListView
{
public:
3dsman's avatar
3dsman committed
    OE_ui_stitchList(MainWindow* window, OE_root* root);
    void addStitch(OE_stitchs* stitch);
    void refreshStitches();
    OE_controller* getController();
    OE_interfaceDisplay* getInterfaceDisplay();
    OE_document* getDocument();
private:
	OE_root* root;
	MainWindow* window;
	QStandardItemModel* model;
	ListviewDelegate* listdelegate;
	void addItem(QColor color, QIcon icon, QIcon type, QIcon pattern, int stitchCount);
	void addItem(QColor color, int stitchCount);
    void keyPressEvent(QKeyEvent *event);
protected:
    void dropEvent(QDropEvent *event);
private slots:
	void on_refreshStitchList();
    void on_refreshStitch(OE_stitchs* stitch);
    void handleSelectionChanged();
};

#endif // OE_UI_STITCHLIST_H