-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclipboardwidgetentry.h
119 lines (94 loc) · 3.96 KB
/
clipboardwidgetentry.h
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CLIPBOARDWIDGETENTRY_H
#define CLIPBOARDWIDGETENTRY_H
#include <QObject>
#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>
#include <QHBoxLayout>
#include <QIcon>
#include <QLine>
#include <QGroupBox>
#include <QEvent>
#include <QDebug>
#include <QSpacerItem>
#include <QMouseEvent>
#include <QTextEdit>
#include <QStackedLayout>
#include "clipBoardInternalSignal.h"
#include "pixmaplabel.h"
#include "elidedlabel.h"
#define EDIT_SVG_PATH ":/image/editor.svg"
#define COPY_SVG_PATH ":/image/copy.svg"
#define REMOVE_SVG_PATH ":/image/delete.svg"
#define SEARCH_SVG_CLEAN ":/image/button-close-hover-click-two.svg"
#define SEARCH_SVG_CLEAN_BACK ":/image/button-close-hover-click-add-background-one.svg"
#define LOCK_SVG_PATH ":/image/lock.png"
#define CANCEL_LOCK_PNG_PATH ":/image/cancel-lock.png"
#define ENTRYURL "Url"
#define ENTRYIMAGE "Image"
#define ENTRYTEXT "Text"
class ClipboardWidgetEntry : public QWidget
{
Q_OBJECT
public:
ClipboardWidgetEntry(QString dataFormat, QWidget *parent = nullptr);
QPushButton *m_pLockButton;
QPushButton *m_pEditButon;
QPushButton *m_pRemoveButton;
QPushButton *m_pCancelLockButton;
ElidedLabel *m_pCopyDataLabal;
pixmapLabel *m_pCopyFileIcon;
QLabel *m_pTimeLabel;
QLabel *m_pInforLabel;
QLabel *m_plineLabel;
QLabel *m_pUrlLabel;
QVBoxLayout *m_pMianVLayout;
QVBoxLayout *m_pdataVLayout;
QHBoxLayout *m_pHLayout;
QHBoxLayout *m_pPixlabelHLayout;
QString m_ptext;
QString m_dataFormat;
QWidget *m_pUpDataWidget;
QWidget *m_pdownOperaWidget;
QWidget *m_pPixlabelWidget;
bool m_bWhetherFix = false;
QString SetFormatBody(QString text);
QString judgeBlankLine(QStringList list); /* 去除掉空行,显示有字体的行 */
void initPushbutton(); /* 初始化三个按钮 */
void initLable(); /* 初始化Lable */
void initOperaArea(); /* 初始化下半部分的界面 */
void initdataDisplayArea(); /* 初始化放置图标的Icon */
void initButtomLayout(); /* 初始化下半部分布局 */
void initImageLayout(); /* 当为图像时,初始化布局方式 */
void initAllLayout(); /* 初始化整体布局 */
bool substringSposition(QString formatBody, QStringList list); /* 判断后面是否还有子串 */
enum TaskWidgetStatus{NORMAL, HOVER, PRESS};
TaskWidgetStatus status;
protected:
void enterEvent(QEvent *); //进入QWidget瞬间事件
void leaveEvent(QEvent *); //离开QWidget瞬间事件
void mouseDoubleClickEvent(QMouseEvent *event); //双击事件
void mousePressEvent(QMouseEvent *event); //单击事件
void paintEvent(QPaintEvent *e); //重绘事件
signals:
void doubleClicksignals(QWidget *w);
};
#endif // CLIPBOARDWIDGETENTRY_H