swift
src
gui
ticklabel.cpp
1
// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
4
#include "
gui/ticklabel.h
"
5
6
#include "
misc/icons.h
"
7
8
using namespace
swift::misc
;
9
10
namespace
swift::gui
11
{
12
CTickLabel::CTickLabel(
QWidget
*parent) :
QLabel
(parent)
13
{
14
this->
setText
(
""
);
15
this->
setMargin
(0);
16
this->
setMaximumSize
(CIcons::tick16().
size
());
17
this->setLabel();
18
}
19
20
void
CTickLabel::setTicked
(
bool
ticked)
21
{
22
if
(m_isPixmapTicked == ticked) {
return
; }
23
this->m_isPixmapTicked = ticked;
24
this->setLabel();
25
26
emit
tickChanged
(this->m_isPixmapTicked);
27
}
28
29
void
CTickLabel::setToolTips
(
const
QString
&ticked,
const
QString
&unticked)
30
{
31
m_toolTipTicked = ticked;
32
m_toolTipUnticked = unticked;
33
this->setLabel();
34
}
35
36
void
CTickLabel::setLabel()
37
{
38
this->
setText
(
""
);
39
this->
setPixmap
(this->m_isPixmapTicked ? m_pixmapTicked : m_pixmapUnticked);
40
this->
setToolTip
(this->m_isPixmapTicked ? m_toolTipTicked : m_toolTipUnticked);
41
}
42
}
// namespace swift::gui
swift::gui::CTickLabel::tickChanged
void tickChanged(bool ticked)
Changed ticked state.
swift::gui::CTickLabel::setTicked
void setTicked(bool ticked)
Set ticked.
Definition:
ticklabel.cpp:20
swift::gui::CTickLabel::setToolTips
void setToolTips(const QString &ticked, const QString &unticked)
Set the tool tips.
Definition:
ticklabel.cpp:29
icons.h
swift::gui
GUI related classes.
Definition:
altitudeedit.cpp:13
swift::misc
Free functions in swift::misc.
Definition:
aircraftmatcher.h:22
QLabel
QLabel::setMargin
void setMargin(int)
QLabel::setPixmap
void setPixmap(const QPixmap &)
QLabel::setText
void setText(const QString &)
QString
QWidget
QWidget::setMaximumSize
void setMaximumSize(const QSize &)
QWidget::size
size
QWidget::setToolTip
void setToolTip(const QString &)
ticklabel.h
Generated on Wed Sep 3 2025 21:41:19 for swift by
1.9.1