본문으로 건너뛰기
로딩중...
검색중...
일치하는것 없음
MapCoordinateStatusWidget.h
1#pragma once
2
3#include "gdkqt/QtGdkExport.h"
4
5#include <QWidget>
6
7class QAction;
8class QHBoxLayout;
9class QLabel;
10class QLineEdit;
11class QMenu;
12class QToolButton;
13
14namespace GdkQt {
15
17
25class QT_GDK_API MapCoordinateStatusWidget final : public QWidget {
26 Q_OBJECT
27public:
36 QWidget* parent = nullptr);
39
42 void setScaleText(const QString& text);
45 void setCrsText(const QString& text);
48 void setCoordinateText(const QString& text);
56 void setCoordinateInputError(bool hasError);
62 void updateCoordinateModeUi(bool enabled, int currentModeIndex,
63 bool mapCoordinateAvailable, bool geographicAvailable = true);
72 void insertAuxiliaryWidget(QWidget* widget);
75 void setInfoToolTip(const QString& text);
76
77private:
78 void buildUi();
79 void rebuildModeMenu();
80 static QString modeLabel(int modeIndex);
81
82 MapViewController* m_controller = nullptr;
83 QHBoxLayout* m_layout = nullptr;
84 QToolButton* m_coordModeButton = nullptr;
85 QLineEdit* m_coordEdit = nullptr;
86 QLabel* m_scaleLabel = nullptr;
87 QToolButton* m_crsButton = nullptr;
88 QToolButton* m_infoButton = nullptr;
89 QString m_infoToolTipOverride;
90 QMenu* m_coordModeMenu = nullptr;
91 QAction* m_mgrsAction = nullptr;
92 QAction* m_geographicAction = nullptr;
93 QAction* m_mapCoordinateAction = nullptr;
94 int m_currentModeIndex = 0;
95 bool m_mapCoordinateAvailable = false;
96};
97
98} // namespace GdkQt
~MapCoordinateStatusWidget() override
위젯을 해제합니다.
MapCoordinateStatusWidget(MapViewController *controller, QWidget *parent=nullptr)
상태 컨트롤을 만듭니다.
void updateCoordinateModeUi(bool enabled, int currentModeIndex, bool mapCoordinateAvailable, bool geographicAvailable=true)
좌표 모드 버튼, 입력란, 모드 메뉴를 한 번에 갱신합니다.
void clearCoordinateInputFocus()
좌표 입력란의 포커스를 해제합니다.
bool coordinateInputHasFocus() const
좌표 입력란에 포커스가 있는지 돌려줍니다.
void setScaleText(const QString &text)
축척 라벨의 텍스트를 바꿉니다.
void setInfoToolTip(const QString &text)
정보 버튼의 도구 설명을 바꿉니다.
void setCoordinateText(const QString &text)
좌표 입력란의 텍스트를 바꿉니다.
void setCrsText(const QString &text)
좌표 참조계 버튼의 텍스트를 바꿉니다.
void insertAuxiliaryWidget(QWidget *widget)
응용 프로그램 위젯을 축척 라벨 바로 앞에 끼워 넣습니다.
void retranslateUi()
언어가 바뀐 뒤 버튼 텍스트, 도구 설명, 메뉴 항목 텍스트를 다시 번역합니다.
void setCoordinateInputError(bool hasError)
좌표 입력란의 테두리와 배경을 오류 표시(빨강) 또는 보통 표시로 바꿉니다.
지도 뷰 이동 명령과 상태 표시줄의 좌표, 축척, 좌표 참조계 문구를 담당하는 컨트롤러입니다.
정의 MapViewController.h:34
glsGdkQt의 공개 형식과 함수가 있는 네임스페이스입니다.
정의 AppSettings.h:15