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 /**--------------------------------------------------------------------------------------------------
42 \brief Displays translated text. No user interaction functionality is provided. The visual appearance
43 of the label can be configured in various ways.
44 **/
45 class NDEVR_WIDGETS_API QCustomLabel : public QLabel
46 {
47 public:
48 enum Theme
49 {
50 e_header_a
51 , e_header_b
52 , e_label_a
53 };
54 QCustomLabel(QWidget* parent = nullptr);
55 QCustomLabel(const TranslatedString& text, QWidget* parent = nullptr);
56 QCustomLabel(const QString& text, QWidget* parent = nullptr);
58 void paintEvent(QPaintEvent* e) override;
59 QSize minimumSizeHint() const override;
60 QSize sizeHint() const override;
61 void setVertical(bool vertical);
62 void setFlipped(bool flipped);
63 void setFontMultiplier(fltp04 font_multiplier);
64 void setBold(bool is_bold);
65 void setText(const TranslatedString& text);
66 void setText(const QString& text);
67 void setText(const char* text);
68 void setText(const String& text);
70 bool event(QEvent* event) override;
73 protected:
74 void init();
75 void updateFont();
76 protected:
80 bool m_is_vertical = false;
81 bool m_is_flipped = false;
82 bool m_is_bold = false;
83 };
84}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
Displays translated text. No user interaction functionality is provided. The visual appearance of the...
Definition QCustomLabel.h:46
void setText(const QString &text)
QSize minimumSizeHint() const override
Theme m_theme
Definition QCustomLabel.h:79
QCustomLabel(const QString &text, QWidget *parent=nullptr)
QSize sizeHint() const override
void setLightingTheme(Theme theme)
bool event(QEvent *event) override
QCustomLabel(const TranslatedString &text, QWidget *parent=nullptr)
TranslatedString text() const
void setText(const TranslatedString &text)
fltp04 m_font_multiplier
Definition QCustomLabel.h:78
TranslatedString m_translated_text
Definition QCustomLabel.h:77
static Resource< fltp08 > default_multiplier_desktop
Definition QCustomLabel.h:71
void setText(const char *text)
Theme
Definition QCustomLabel.h:49
void setText(const String &text)
QCustomLabel(QWidget *parent=nullptr)
void setFlipped(bool flipped)
void paintEvent(QPaintEvent *e) override
void setVertical(bool vertical)
void setBold(bool is_bold)
void setFontMultiplier(fltp04 font_multiplier)
static Resource< fltp08 > default_multiplier_touch
Definition QCustomLabel.h:72
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
Definition Toggle.h:41
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127