OpenCores
URL https://opencores.org/ocsvn/ezidebug/ezidebug/trunk

Subversion Repositories ezidebug

[/] [ezidebug/] [trunk/] [EziDebug_src/] [titlebar.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 EziDebug
#ifndef TITLEBAR_H
2
#define TITLEBAR_H
3
 
4
#include <QWidget>
5
 
6
#include "button.h"
7
 
8
//#typedef  5 VALUE_DIS
9
const int VALUE_DIS = 5;
10
 
11
QT_BEGIN_NAMESPACE
12
//class QAction;
13
//class QActionGroup;
14
class QLabel;
15
class QPoint;
16
class QHBoxLayout;
17
//class QPushButton;
18
class QToolButton;
19
//class QTreeWidget;
20
//class QImage;
21
//class FindDialog;
22
QT_END_NAMESPACE
23
 
24
class TitleBar : public QWidget
25
{
26
    Q_OBJECT
27
public:
28
    explicit TitleBar(QWidget *parent = 0);
29
 
30
    //枚举,按钮状态
31
    enum eBtnMoustState{
32
        eBtnStateNone,//无效
33
        eBtnStateDefault,//默认值(如按钮初始显示)
34
        eBtnStateHover,//鼠标移到按钮上状态
35
        eBtnStatePress//鼠标按下按钮时状态
36
    };
37
 
38
    Button *closeButton;//关闭按钮
39
 
40
 
41
//    QLabel *iconLabel;//最左侧的小图标
42
//    QLabel *lineLabel;//中间的长直线
43
//    QLabel *closeButtonLabel;//最右侧关闭按键的图标
44
 
45
signals:
46
 
47
public slots:
48
 
49
private:
50
    void mousePressEvent(QMouseEvent *);        //自定义一个鼠标点击事件函数
51
    void mouseMoveEvent(QMouseEvent *);         //自定义一个鼠标拖动事件函数
52
    void mouseReleaseEvent(QMouseEvent *);
53
    void resizeEvent(QResizeEvent *);
54
 
55
    QPoint pointPress;//记录按下鼠标左键时的全局位置
56
    QPoint pointMove;//记录鼠标移动后的全局位置
57
    bool isLeftButtonPress;//是否点击鼠标左键
58
 
59
    QHBoxLayout *layout;
60
//  QPixmap background;//背景图片
61
 
62
 
63
 
64
    void CreateWidget();//创建子部件
65
    void SetWidgetStyle();//设置子部件样式(qss)
66
    void CreateLayout();//创建设置布局
67
 
68
    //void SetBtnIcon(QToolButton *pBtn,eBtnMoustState state,bool bInit=false);//设置按钮不同状态下的图标
69
 
70
};
71
 
72
#endif // TITLEBAR_H

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.