2018-06-06 11:05:20 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QJsonObject>
|
|
|
|
#include <memory>
|
|
|
|
#include <QStandardItem>
|
|
|
|
#include <QTableView>
|
|
|
|
|
2019-02-22 16:50:45 +00:00
|
|
|
#include "core/Cutter.h"
|
2018-06-06 11:05:20 +00:00
|
|
|
#include "CutterDockWidget.h"
|
2019-09-25 14:18:30 +00:00
|
|
|
#include "menus/AddressableItemContextMenu.h"
|
2018-06-06 11:05:20 +00:00
|
|
|
|
|
|
|
class MainWindow;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class StackWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class StackWidget : public CutterDockWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit StackWidget(MainWindow *main, QAction *action = nullptr);
|
|
|
|
~StackWidget();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void updateContents();
|
|
|
|
void setStackGrid();
|
2018-07-18 10:15:10 +00:00
|
|
|
void fontsUpdatedSlot();
|
2018-07-24 23:15:38 +00:00
|
|
|
void onDoubleClicked(const QModelIndex &index);
|
|
|
|
void customMenuRequested(QPoint pos);
|
|
|
|
void editStack();
|
2019-09-25 14:18:30 +00:00
|
|
|
void onCurrentChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
|
|
|
void onItemChanged(QStandardItem *item);
|
2018-06-06 11:05:20 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<Ui::StackWidget> ui;
|
|
|
|
QTableView *viewStack = new QTableView;
|
|
|
|
QStandardItemModel *modelStack = new QStandardItemModel(1, 3, this);
|
2018-07-24 23:15:38 +00:00
|
|
|
QAction *editAction;
|
2019-09-25 14:18:30 +00:00
|
|
|
QAction menuText;
|
2019-01-13 18:11:59 +00:00
|
|
|
RefreshDeferrer *refreshDeferrer;
|
2019-09-25 14:18:30 +00:00
|
|
|
AddressableItemContextMenu addressableItemContextMenu;
|
|
|
|
bool updatingData = false;
|
2019-02-22 16:50:45 +00:00
|
|
|
};
|