#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include <QStandardItemModel>
#include <QIdentityProxyModel>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_treeView_Source_clicked(const QModelIndex &index);
    void on_treeView_Proxy_clicked(const QModelIndex &index);
    void on_pushButton_SourceInsertRows_released();
    void on_pushButton_SourceRemoveRows_released();
    void on_pushButton_SourceInsertColumns_released();
    void on_pushButton_SourceRemoveColumns_released();
    void on_pushButton_ProxyInsertRows_released();
    void on_pushButton_ProxyRemoveRows_released();
    void on_pushButton_ProxyInsertColumns_released();
    void on_pushButton_ProxyRemoveColumns_released();

private:
    Ui::MainWindow *ui;
    QStandardItemModel model;
    QPersistentModelIndex modelIndex;
    QIdentityProxyModel proxy;
    QPersistentModelIndex proxyIndex;

    void setupModels();
    void updateViews();
};

#endif // MAINWINDOW_H
