QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
lastusedstyle.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef LAST_USED_STYLE_H
19#define LAST_USED_STYLE_H
20
21#include <QBrush>
22#include <QFont>
23#include <QPen>
24
38{
39 public:
40 static bool hasShapePen();
41 static QPen shapePen();
42 static void setShapePen(const QPen &pen);
43
44 static bool hasShapeBrush();
45 static QBrush shapeBrush();
46 static void setShapeBrush(const QBrush &brush);
47
48 static bool hasTextFont();
49 static QFont textFont();
50 static void setTextFont(const QFont &font);
51
52 private:
53 LastUsedStyle() = delete;
54
55 static QPen m_shape_pen;
56 static bool m_has_shape_pen;
57 static QBrush m_shape_brush;
58 static bool m_has_shape_brush;
59 static QFont m_text_font;
60 static bool m_has_text_font;
61};
62
63#endif // LAST_USED_STYLE_H
static QBrush shapeBrush()
Definition lastusedstyle.cpp:65
static void setTextFont(const QFont &font)
LastUsedStyle::setTextFont Record font as the last-used free text font for this session.
Definition lastusedstyle.cpp:102
static void setShapePen(const QPen &pen)
LastUsedStyle::setShapePen Record pen as the last-used shape pen for this session.
Definition lastusedstyle.cpp:48
static bool hasShapePen()
Definition lastusedstyle.cpp:30
static QPen m_shape_pen
Definition lastusedstyle.h:55
static bool hasTextFont()
Definition lastusedstyle.cpp:84
LastUsedStyle()=delete
static void setShapeBrush(const QBrush &brush)
LastUsedStyle::setShapeBrush Record brush as the last-used shape brush for this session.
Definition lastusedstyle.cpp:75
static QFont m_text_font
Definition lastusedstyle.h:59
static bool m_has_text_font
Definition lastusedstyle.h:60
static bool hasShapeBrush()
Definition lastusedstyle.cpp:57
static QPen shapePen()
Definition lastusedstyle.cpp:38
static bool m_has_shape_pen
Definition lastusedstyle.h:56
static bool m_has_shape_brush
Definition lastusedstyle.h:58
static QFont textFont()
Definition lastusedstyle.cpp:92
static QBrush m_shape_brush
Definition lastusedstyle.h:57