API Documentation
Loading...
Searching...
No Matches
QCustomLabel.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: VerticalLabel
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/BaseValues.h>
35#include <NDEVR/Resource.h>
36#include <NDEVR/TranslatedString.h>
37#include <QLabel>
38namespace NDEVR
39{
40 class String;
41 class NDEVR_WIDGETS_API QCustomLabel : public QLabel
42 {
43 public:
44 enum Theme
45 {
46 e_header_a
47 , e_header_b
48 , e_label_a
49 };
50 QCustomLabel(QWidget* parent = nullptr);
51 QCustomLabel(const TranslatedString& text, QWidget* parent = nullptr);
52 QCustomLabel(const QString& text, QWidget* parent = nullptr);
53 TranslatedString text() const;
54 void paintEvent(QPaintEvent* e) override;
55 QSize minimumSizeHint() const override;
56 QSize sizeHint() const override;
57 void setVertical(bool vertical);
58 void setFlipped(bool flipped);
59 void setFontMultiplier(fltp04 font_multiplier);
60 void setBold(bool is_bold);
61 void setText(const TranslatedString& text);
62 void setText(const QString& text);
63 void setText(const char* text);
64 void setText(const String& text);
65 void setLightingTheme(Theme theme);
66 bool event(QEvent* event) override;
69 protected:
70 void init();
71 void updateFont();
72 protected:
76 bool m_is_vertical = false;
77 bool m_is_flipped = false;
78 bool m_is_bold = false;
79 };
80}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
Definition QCustomLabel.h:42
Theme m_theme
Definition QCustomLabel.h:75
static Resource< fltp08 > default_multiplier_desktop
Definition QCustomLabel.h:67
fltp04 m_font_multiplier
Definition QCustomLabel.h:74
TranslatedString m_translated_text
Definition QCustomLabel.h:73
Theme
Definition QCustomLabel.h:45
static Resource< fltp08 > default_multiplier_touch
Definition QCustomLabel.h:68
Definition Toggle.h:41
Definition String.h:40
Definition TranslatedString.h:9
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:157