-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcustommessagebox.h
More file actions
63 lines (55 loc) · 1.73 KB
/
custommessagebox.h
File metadata and controls
63 lines (55 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef CUSTOMMESSAGEBOX_H
#define CUSTOMMESSAGEBOX_H
#include <QDialog>
#include <QString>
class QLabel;
class QPushButton;
class QVBoxLayout;
class QMouseEvent;
/**
* @brief 사용자 지정 메시지 박스 클래스
* @details 사용자 정의 메시지 박스를 생성하고 표시합니다.
*/
class CustomMessageBox : public QDialog {
Q_OBJECT
public:
/**
* @brief CustomMessageBox 생성자
* @details 사용자 지정 메시지 박스를 생성합니다.
* @param parent 부모 위젯
* @param title 메시지 박스 타이틀
* @param message 표시할 메시지
*/
explicit CustomMessageBox(QWidget *parent = nullptr, const QString &title = "", const QString &message = "");
protected:
/**
* @brief 마우스 클릭 이벤트 처리
* @details 창 이동을 위한 드래그 시작 위치를 저장합니다.
* @param event 마우스 이벤트
*/
void mousePressEvent(QMouseEvent *event) override;
/**
* @brief 마우스 이동 이벤트 처리
* @details 창을 드래그하여 이동합니다.
* @param event 마우스 이벤트
*/
void mouseMoveEvent(QMouseEvent *event) override;
/**
* @brief 마우스 릴리즈 이벤트 처리
* @details 드래그 상태를 해제합니다.
* @param event 마우스 이벤트
*/
void mouseReleaseEvent(QMouseEvent *event) override;
private:
/** @brief 메시지 라벨 */
QLabel *messageLabel;
/** @brief 확인 버튼 */
QPushButton *okButton;
/** @brief 메인 레이아웃 */
QVBoxLayout *mainLayout;
/** @brief 드래그 상태 플래그 */
bool m_dragging;
/** @brief 드래그 위치 */
QPoint m_dragPos;
};
#endif // CUSTOMMESSAGEBOX_H