PIVX Core
5.6.99
P2P Digital Currency
src
qt
expandablebutton.h
Go to the documentation of this file.
1
// Copyright (c) 2019-2020 The PIVX Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef PIVX_QT_EXPANDABLEBUTTON_H
6
#define PIVX_QT_EXPANDABLEBUTTON_H
7
8
#include <QWidget>
9
#include <QEvent>
10
#include <QString>
11
#include <iostream>
12
13
#include <QPropertyAnimation>
14
#include <atomic>
15
16
namespace
Ui
{
17
class
ExpandableButton
;
18
}
19
20
class
ExpandableButton
:
public
QWidget
21
{
22
Q_OBJECT
23
24
public
:
25
explicit
ExpandableButton
(QWidget *parent =
nullptr
);
26
~ExpandableButton
();
27
28
void
setButtonClassStyle
(
const
char
*
name
,
const
QVariant &value,
bool
forceUpdate =
false
);
29
void
setButtonText
(
const
QString& _text);
30
void
setNoIconText
(
const
QString& _text);
31
void
setIcon
(QString path);
32
33
bool
isChecked
();
34
void
setChecked
(
bool
check);
35
void
setKeepExpanded
(
bool
_keepExpended){
36
this->
keepExpanded
= _keepExpended;
37
}
38
void
setSmall
();
39
void
setExpanded
();
40
Q_SIGNALS:
41
void
Mouse_Pressed
();
42
void
Mouse_Hover
();
43
void
Mouse_HoverLeave
();
44
45
public
Q_SLOTS:
46
void
setText2
(QString text2);
47
48
QString
getText
(){
49
return
this->
text
;
50
}
51
52
protected
:
53
virtual
void
enterEvent
(QEvent *);
54
virtual
void
leaveEvent
(QEvent *);
55
56
private
Q_SLOTS:
57
58
void
on_pushButton_clicked
(
bool
checked);
59
60
void
innerMousePressEvent
();
61
private
:
62
Ui::ExpandableButton *
ui
;
63
QString
notExpandedText
;
64
QString
text
;
65
std::atomic<bool>
isAnimating
;
66
QPropertyAnimation *
animation
=
nullptr
;
67
bool
isExpanded
=
false
;
68
69
bool
keepExpanded
=
false
;
70
};
71
72
#endif
// PIVX_QT_EXPANDABLEBUTTON_H
ExpandableButton
Definition:
expandablebutton.h:21
ExpandableButton::setButtonText
void setButtonText(const QString &_text)
Definition:
expandablebutton.cpp:42
ExpandableButton::leaveEvent
virtual void leaveEvent(QEvent *)
Definition:
expandablebutton.cpp:102
ExpandableButton::setChecked
void setChecked(bool check)
Definition:
expandablebutton.cpp:73
ExpandableButton::Mouse_Pressed
void Mouse_Pressed()
ExpandableButton::Mouse_HoverLeave
void Mouse_HoverLeave()
ExpandableButton::ExpandableButton
ExpandableButton(QWidget *parent=nullptr)
Definition:
expandablebutton.cpp:15
ExpandableButton::text
QString text
Definition:
expandablebutton.h:64
ExpandableButton::setText2
void setText2(QString text2)
Definition:
expandablebutton.cpp:57
ExpandableButton::keepExpanded
bool keepExpanded
Definition:
expandablebutton.h:69
ExpandableButton::setExpanded
void setExpanded()
Definition:
expandablebutton.cpp:86
ExpandableButton::on_pushButton_clicked
void on_pushButton_clicked(bool checked)
Definition:
expandablebutton.cpp:115
ExpandableButton::setNoIconText
void setNoIconText(const QString &_text)
Definition:
expandablebutton.cpp:50
ExpandableButton::~ExpandableButton
~ExpandableButton()
Definition:
expandablebutton.cpp:63
ExpandableButton::isChecked
bool isChecked()
Definition:
expandablebutton.cpp:68
ExpandableButton::animation
QPropertyAnimation * animation
Definition:
expandablebutton.h:66
ExpandableButton::innerMousePressEvent
void innerMousePressEvent()
Definition:
expandablebutton.cpp:110
ExpandableButton::ui
Ui::ExpandableButton * ui
Definition:
expandablebutton.h:62
ExpandableButton::setButtonClassStyle
void setButtonClassStyle(const char *name, const QVariant &value, bool forceUpdate=false)
Definition:
expandablebutton.cpp:29
ExpandableButton::setSmall
void setSmall()
Definition:
expandablebutton.cpp:78
ExpandableButton::isAnimating
std::atomic< bool > isAnimating
Definition:
expandablebutton.h:65
ExpandableButton::setKeepExpanded
void setKeepExpanded(bool _keepExpended)
Definition:
expandablebutton.h:35
ExpandableButton::enterEvent
virtual void enterEvent(QEvent *)
Definition:
expandablebutton.cpp:93
ExpandableButton::setIcon
void setIcon(QString path)
Definition:
expandablebutton.cpp:37
ExpandableButton::getText
QString getText()
Definition:
expandablebutton.h:48
ExpandableButton::notExpandedText
QString notExpandedText
Definition:
expandablebutton.h:63
ExpandableButton::Mouse_Hover
void Mouse_Hover()
ExpandableButton::isExpanded
bool isExpanded
Definition:
expandablebutton.h:67
Ui
Definition:
addnewcontactdialog.h:10
name
const char * name
Definition:
rest.cpp:37
Generated on Wed Apr 2 2025 00:40:31 for PIVX Core by
1.9.1