QCAD
Open Source 2D CAD
RLineweight.h
Go to the documentation of this file.
1 
20 #ifndef RLINEWEIGHT_H_
21 #define RLINEWEIGHT_H_
22 
23 #include "core_global.h"
24 
25 #include <QCoreApplication>
26 #include <QMetaType>
27 #include <QString>
28 #include <QIcon>
29 #include <QPair>
30 #include <QMap>
31 #include <QList>
32 
33 #ifndef RDEFAULT_QSIZE_ICON
34 #define RDEFAULT_QSIZE_ICON QSize(32,10)
35 #endif
36 
42 
43  Q_DECLARE_TR_FUNCTIONS(RLineweight)
44 
45 public:
46  enum Lineweight {
47  Weight000 = 0,
48  Weight005 = 5,
49  Weight009 = 9,
50  Weight013 = 13,
51  Weight015 = 15,
52  Weight018 = 18,
53  Weight020 = 20,
54  Weight025 = 25,
55  Weight030 = 30,
56  Weight035 = 35,
57  Weight040 = 40,
58  Weight050 = 50,
59  Weight053 = 53,
60  Weight060 = 60,
61  Weight070 = 70,
62  Weight080 = 80,
63  Weight090 = 90,
64  Weight100 = 100,
65  Weight106 = 106,
66  Weight120 = 120,
67  Weight140 = 140,
68  Weight158 = 158,
69  Weight200 = 200,
70  Weight211 = 211,
71  WeightByLayer = -1,
72  WeightByBlock = -2,
73  WeightByLwDefault = -3,
74  WeightInvalid = -4
75  };
76 
77 public:
78  RLineweight();
79  static QList<QPair<QString, RLineweight::Lineweight> > getList(bool onlyFixed, bool noDefault = false);
80  static QIcon getIcon(RLineweight::Lineweight color, const QSize& size = RDEFAULT_QSIZE_ICON);
81  static QString getName(RLineweight::Lineweight lineweight);
82 
83 private:
84  static void init();
85  static void init(const QString& cn, RLineweight::Lineweight lineweight);
86 
87 private:
88  static bool isInitialized;
89  static QList<QPair<QString, RLineweight::Lineweight> > list;
90  //static QMap<RLineweight::Lineweight, QIcon> iconMap;
91  static QMap<QPair<RLineweight::Lineweight, QPair<int, int> >, QIcon> iconMap;
92 
93 };
94 
98 typedef QPair<QString, RLineweight::Lineweight> _RPairStringRLineweight;
101 
102 #endif /* RLINEWEIGHT_H_ */
RLineweight::isInitialized
static bool isInitialized
Definition: RLineweight.h:88
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(RMath *)
RDEFAULT_QSIZE_ICON
#define RDEFAULT_QSIZE_ICON
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: RLineweight.h:34
core_global.h
RLineweight::Lineweight
Lineweight
Definition: RLineweight.h:46
RLineweight
Definition: RLineweight.h:41
RLineweight::list
static QList< QPair< QString, RLineweight::Lineweight > > list
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: RLineweight.h:89
_RPairStringRLineweight
QPair< QString, RLineweight::Lineweight > _RPairStringRLineweight
Definition: RLineweight.h:98
init
void init(void basePath)
Definition: AddBlockInit.js:2
RLineweight::iconMap
static QMap< QPair< RLineweight::Lineweight, QPair< int, int > >, QIcon > iconMap
Definition: RLineweight.h:91
QCADCORE_EXPORT
#define QCADCORE_EXPORT
Definition: core_global.h:10