config/versionguientry.cpp

changeset 54
0b3a5bc4e8a8
equal deleted inserted replaced
53:a5b53cc10436 54:0b3a5bc4e8a8
1 #include <QLabel>
2 #include <QTableWidget>
3 #include "versionguientry.h"
4
5 //
6 // -----------------------------------------------------------------------------
7 //
8
9 VersionGuiEntry::VersionGuiEntry (const QString& name, bool isRelease,
10 QLabel* label, QTableWidgetItem* pathItem)
11 : m_name (name),
12 m_isRelease (isRelease),
13 m_label (label),
14 m_pathItem (pathItem)
15 {
16 updateStyleSheet();
17 }
18
19 //
20 // -----------------------------------------------------------------------------
21 //
22
23 void VersionGuiEntry::setRelease (bool a)
24 {
25 m_isRelease = a;
26 updateStyleSheet();
27 }
28
29 //
30 // -----------------------------------------------------------------------------
31 //
32
33 void VersionGuiEntry::updateStyleSheet()
34 {
35 m_label->setStyleSheet (m_isRelease ? "font-weight: bold" : "");
36 }
37
38 //
39 // -----------------------------------------------------------------------------
40 //
41
42 class QLabel* VersionGuiEntry::label()
43 {
44 return m_label;
45 }
46
47 //
48 // -----------------------------------------------------------------------------
49 //
50
51 class QTableWidgetItem* VersionGuiEntry::pathItem()
52 {
53 return m_pathItem;
54 }
55
56 //
57 // -----------------------------------------------------------------------------
58 //
59
60 const QString& VersionGuiEntry::name()
61 {
62 return m_name;
63 }
64
65 //
66 // -----------------------------------------------------------------------------
67 //
68
69 bool VersionGuiEntry::isRelease()
70 {
71 return m_isRelease;
72 }

mercurial