QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
38 
39  Q_DECLARE_TR_FUNCTIONS(RLineweight);
40 
41 public:
42  enum Lineweight {
43  Weight000 = 0,
44  Weight005 = 5,
45  Weight009 = 9,
46  Weight013 = 13,
47  Weight015 = 15,
48  Weight018 = 18,
49  Weight020 = 20,
50  Weight025 = 25,
51  Weight030 = 30,
52  Weight035 = 35,
53  Weight040 = 40,
54  Weight050 = 50,
55  Weight053 = 53,
56  Weight060 = 60,
57  Weight070 = 70,
58  Weight080 = 80,
59  Weight090 = 90,
60  Weight100 = 100,
61  Weight106 = 106,
62  Weight120 = 120,
63  Weight140 = 140,
64  Weight158 = 158,
65  Weight200 = 200,
66  Weight211 = 211,
67  WeightByLayer = -1,
68  WeightByBlock = -2,
69  WeightByLwDefault = -3,
70  WeightInvalid = -4
71  };
72 
73 public:
74  RLineweight();
75  static QList<QPair<QString, RLineweight::Lineweight> > getList(bool onlyFixed);
76  static QIcon getIcon(RLineweight::Lineweight color);
77  static QString getName(RLineweight::Lineweight lineweight);
78 
79 private:
80  static void init();
81  static void init(const QString& cn, RLineweight::Lineweight lineweight);
82 
83 private:
84  static bool isInitialized;
85  static QList<QPair<QString, RLineweight::Lineweight> > list;
86  static QMap<RLineweight::Lineweight, QIcon> iconMap;
87 
88 };
89 
93 typedef QPair<QString, RLineweight::Lineweight> _RPairStringRLineweight;
94 Q_DECLARE_METATYPE(_RPairStringRLineweight)
95 Q_DECLARE_METATYPE(QList< _RPairStringRLineweight >)
96 
97 #endif /* RLINEWEIGHT_H_ */