nextpnr/gui/basewindow.h

50 lines
939 B
C
Raw Normal View History

2018-06-21 19:41:16 +08:00
#ifndef BASEMAINWINDOW_H
#define BASEMAINWINDOW_H
#include "infotab.h"
#include "nextpnr.h"
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QStatusBar>
2018-06-21 19:55:36 +08:00
#include <QTabWidget>
#include <QToolBar>
2018-06-21 19:41:16 +08:00
Q_DECLARE_METATYPE(std::string)
2018-06-22 19:10:27 +08:00
NEXTPNR_NAMESPACE_BEGIN
2018-06-21 19:41:16 +08:00
class BaseMainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit BaseMainWindow(Context *ctx, QWidget *parent = 0);
virtual ~BaseMainWindow();
2018-06-21 19:41:16 +08:00
Context *getContext() { return ctx; }
protected:
void createMenusAndBars();
protected Q_SLOTS:
void writeInfo(std::string text);
virtual void open() = 0;
virtual bool save() = 0;
2018-06-21 19:41:16 +08:00
protected:
Context *ctx;
QTabWidget *tabWidget;
2018-06-21 20:12:02 +08:00
QTabWidget *centralTabWidget;
2018-06-21 19:41:16 +08:00
InfoTab *info;
2018-06-21 19:55:36 +08:00
2018-06-21 19:41:16 +08:00
QMenuBar *menuBar;
QToolBar *mainToolBar;
QStatusBar *statusBar;
};
2018-06-22 19:10:27 +08:00
NEXTPNR_NAMESPACE_END
2018-06-21 19:41:16 +08:00
#endif // BASEMAINWINDOW_H