Files
QtGameMaker/dialogs/pathpropertiesdialog.h
T

63 lines
1.3 KiB
C++
Raw Normal View History

2022-01-09 06:42:13 +01:00
#pragma once
#include <QDialog>
#include <memory>
2022-01-10 21:49:06 +01:00
#include <optional>
2022-01-09 06:42:13 +01:00
2022-01-10 21:49:06 +01:00
#include "projectcontainer.h"
class QSpinBox;
2022-01-09 06:42:13 +01:00
class QLabel;
namespace Ui { class PathPropertiesDialog; }
class ProjectTreeModel;
2022-01-10 21:49:06 +01:00
class PathPointsModel;
2022-01-09 06:42:13 +01:00
class PathPropertiesDialog : public QDialog
{
Q_OBJECT
public:
explicit PathPropertiesDialog(Path &path, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
2022-01-09 06:42:13 +01:00
~PathPropertiesDialog();
void accept() override;
void reject() override;
private slots:
2022-01-10 21:49:06 +01:00
void selectionChanged(const QModelIndex &index);
void selectedPointChanged(const std::optional<std::size_t> &index);
void dataChanged(const QModelIndex &index);
void cursorMoved(const QPoint &point);
void add();
void insert();
void delete_();
2022-01-09 06:42:13 +01:00
void changed();
void pathNameChanged(const Path &path);
2022-01-09 06:42:13 +01:00
private:
void updateTitle();
2022-01-10 21:49:06 +01:00
void updatePointFields();
2022-01-09 06:42:13 +01:00
const std::unique_ptr<Ui::PathPropertiesDialog> m_ui;
Path &m_path;
ProjectTreeModel &m_projectModel;
2022-01-10 21:49:06 +01:00
std::vector<Path::Point> m_points;
const std::unique_ptr<PathPointsModel> m_pointsModel;
bool m_unsavedChanges{};
2022-01-09 06:42:13 +01:00
2022-01-10 21:49:06 +01:00
QSpinBox * const m_spinBoxSnapX;
QSpinBox * const m_spinBoxSnapY;
2022-01-09 06:42:13 +01:00
QLabel * const m_labelX;
QLabel * const m_labelY;
QLabel * const m_labelArea;
};