tahoma2d/toonz/sources/include/toonzqt/tmessageviewer.h

60 lines
1.3 KiB
C
Raw Normal View History

2016-03-19 06:57:51 +13:00
#pragma once
#include <QFrame>
#include <QModelIndex>
#include <QListView>
#include "tcommon.h"
#include "tmsgcore.h"
#undef DVAPI
#undef DVVAR
#ifdef TOONZQT_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
class MySortFilterProxyModel;
class QCheckBox;
class QStandardItemModel;
class DVAPI TMessageRepository final : public QObject {
2016-06-15 18:43:10 +12:00
QStandardItemModel *m_sim;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
static TMessageRepository *instance();
TMessageRepository();
QStandardItemModel *getModel() const { return m_sim; }
void clear();
2016-03-19 06:57:51 +13:00
public slots:
2016-06-15 18:43:10 +12:00
void messageReceived(int, const QString &);
2016-03-19 06:57:51 +13:00
signals:
2016-06-15 18:43:10 +12:00
void openMessageCenter(); // TMessageRepository emits this signal to indicate
// that the TMessageViewer should be made visible
2016-03-19 06:57:51 +13:00
};
//---------------------------------------------------------------------------------------
class DVAPI TMessageViewer final : public QFrame {
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
protected:
2016-06-15 18:43:10 +12:00
static std::vector<TMessageViewer *> m_tmsgViewers;
MySortFilterProxyModel *m_proxyModel;
void rowsInserted(const QModelIndex &parent, int start, int end);
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
QCheckBox *m_redCheck, *m_greenCheck, *m_yellowCheck;
TMessageViewer(QWidget *);
static bool isTMsgVisible();
2016-03-19 06:57:51 +13:00
public slots:
2016-06-15 18:43:10 +12:00
void onClicked(bool);
void refreshFilter(int);
2016-03-19 06:57:51 +13:00
};