본문으로 건너뛰기
로딩중...
검색중...
일치하는것 없음
FeaturePropertyPanel.h
1#pragma once
2
3#include "gdkqt/QtGdkExport.h"
4
5#include "features/attributes/FeaturePropertyModel.h"
6
7#include <QString>
8#include <QVector>
9#include <QWidget>
10
11#include <functional>
12
13class QLabel;
14class QTreeWidget;
15class QPushButton;
16class QTableWidget;
17class QToolButton;
18
19namespace GdkQt {
20
27class QT_GDK_API FeaturePropertyPanel final : public QWidget
28{
29 Q_OBJECT
30
31public:
34 explicit FeaturePropertyPanel(QWidget* parent = nullptr);
35
41 void setModel(const FeaturePropertyModel& model);
45 void clear();
54 bool hasPendingEdits() const;
73 void setStyleResourceFolderProvider(std::function<QStringList()> provider);
74
75signals:
88 void featureIndexSelected(int index);
103 void updateAttributesRequested(const QString& layerId,
104 qint64 featureId,
105 bool featureIdIsViewId,
106 const QVector<FeatureAttributeInput>& values);
107
108private:
109 struct AttributeEditor {
110 FeatureInsertField field;
111 FeatureAttributeInput originalValue;
112 QString originalEditorText;
113 QWidget* editor = nullptr;
114 QLabel* errorLabel = nullptr;
115 };
116
117 void enterEditMode();
118 void leaveEditMode();
119 void rebuildReadOnlyTable();
120 void rebuildEditableTable();
121 void rebuildFeatureTree();
122 void applyEdits();
123 bool hasPendingEditorChanges() const;
124 void setEditorError(AttributeEditor& editor, const QString& message);
125 void handleTableCellDoubleClicked(int row, int column);
126 void focusAttributeEditor(int attributeIndex);
127
128 FeaturePropertyModel m_model;
129 bool m_editing = false;
130 bool m_suppressTreeSignal = false;
131 QVector<AttributeEditor> m_attributeEditors;
132 std::function<QStringList()> m_styleResourceFolderProvider;
133
134 // 단일 피처 모드 위젯
135 QWidget* m_header = nullptr;
136 QLabel* m_titleLabel = nullptr;
137 QWidget* m_navWidget = nullptr;
138 QToolButton* m_prevButton = nullptr;
139 QLabel* m_countLabel = nullptr;
140 QToolButton* m_nextButton = nullptr;
141 QToolButton* m_editButton = nullptr;
142 QTableWidget* m_table = nullptr;
143 QWidget* m_buttonBar = nullptr;
144 QPushButton* m_okButton = nullptr;
145 QPushButton* m_cancelButton = nullptr;
146
147 // 다중 선택 모드 위젯 (드래그 선택 결과)
148 QLabel* m_noticeLabel = nullptr;
149 QTreeWidget* m_featureTree = nullptr;
150};
151
152} // namespace GdkQt
void featureIndexSelected(int index)
여러 피처 목록 트리에서 사용자가 피처 항목을 고르면 발생합니다.
void previousFeatureRequested()
사용자가 이전 피처 단추를 눌렀을 때 발생합니다.
void clear()
모델과 편집 상태를 지우고 빈 단일 피처 표시로 되돌립니다.
bool applyPendingEdits()
확정하지 않은 값을 검사하고 제출합니다.
void nextFeatureRequested()
사용자가 다음 피처 단추를 눌렀을 때 발생합니다.
void acceptPendingEdits()
편집 모드를 끝내고 편집기 값을 버린 뒤 읽기 전용 표시로 되돌립니다.
void updateAttributesRequested(const QString &layerId, qint64 featureId, bool featureIdIsViewId, const QVector< FeatureAttributeInput > &values)
한 피처의 속성 갱신을 컨트롤러에 요청합니다.
void setModel(const FeaturePropertyModel &model)
표시할 피처 또는 피처 목록 모델을 바꿉니다.
bool confirmDiscardPendingEdits()
확정하지 않은 편집 값이 있으면 버릴지 사용자에게 묻습니다.
void setStyleResourceFolderProvider(std::function< QStringList()> provider)
STYLE 필드 편집기가 스타일 이미지 리소스 폴더를 얻을 때 쓰는 콜백을 정합니다.
bool hasPendingEdits() const
편집 모드에서 원래 값과 다른 입력이 있는지 알려 줍니다.
FeaturePropertyPanel(QWidget *parent=nullptr)
빈 패널을 만듭니다.
glsGdkQt의 공개 형식과 함수가 있는 네임스페이스입니다.
정의 AppSettings.h:15
필드 하나에 넣을 속성 값입니다.
정의 FeatureInsertTypes.h:71
새 피처 입력과 속성 편집에 쓰는 필드 정의입니다.
정의 FeatureInsertTypes.h:25
FeaturePropertyPanel에 넘기는 피처 정보 스냅숏입니다.
정의 FeaturePropertyModel.h:50