##// END OF EJS Templates
New Peripheral view almost done.
jeandet -
r19:1cb664ab4bb3 tip default
parent child
Show More
@@ -53,6 +53,14 void CollapsablePeripheralWidget::change
53 }
53 }
54 }
54 }
55
55
56 void CollapsablePeripheralWidget::paintEvent(QPaintEvent *)
57 {
58 QStyleOption opt;
59 opt.init(this);
60 QPainter p(this);
61 style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
62 }
63
56 void CollapsablePeripheralWidget::collapse()
64 void CollapsablePeripheralWidget::collapse()
57 {
65 {
58 this->m_periph->setVisible(m_collapsed);
66 this->m_periph->setVisible(m_collapsed);
@@ -36,7 +36,7 public:
36 peripheralWidget* getPeripheralWidget();
36 peripheralWidget* getPeripheralWidget();
37 protected:
37 protected:
38 void changeEvent(QEvent *e);
38 void changeEvent(QEvent *e);
39
39 void paintEvent(QPaintEvent *);
40 public slots:
40 public slots:
41 void collapse();
41 void collapse();
42 void setName(const QString& name);
42 void setName(const QString& name);
@@ -6,8 +6,8
6 <rect>
6 <rect>
7 <x>0</x>
7 <x>0</x>
8 <y>0</y>
8 <y>0</y>
9 <width>845</width>
9 <width>833</width>
10 <height>249</height>
10 <height>192</height>
11 </rect>
11 </rect>
12 </property>
12 </property>
13 <property name="sizePolicy">
13 <property name="sizePolicy">
@@ -20,10 +20,7
20 <string>Form</string>
20 <string>Form</string>
21 </property>
21 </property>
22 <property name="styleSheet">
22 <property name="styleSheet">
23 <string notr="true">QWidget#CollapsablePeripheralWidget {
23 <string notr="true"/>
24 border: 1px solid gray;
25 border-radius: 9px;
26 }</string>
27 </property>
24 </property>
28 <layout class="QGridLayout" name="gridLayout">
25 <layout class="QGridLayout" name="gridLayout">
29 <item row="0" column="2">
26 <item row="0" column="2">
@@ -34,6 +31,9
34 <verstretch>0</verstretch>
31 <verstretch>0</verstretch>
35 </sizepolicy>
32 </sizepolicy>
36 </property>
33 </property>
34 <property name="focusPolicy">
35 <enum>Qt::NoFocus</enum>
36 </property>
37 <property name="text">
37 <property name="text">
38 <string/>
38 <string/>
39 </property>
39 </property>
@@ -9,6 +9,14 SocRegsViewerNew::SocRegsViewerNew(const
9 this->ui->socName->setText(name);
9 this->ui->socName->setText(name);
10 }
10 }
11
11
12 SocRegsViewerNew::SocRegsViewerNew(QWidget *parent):
13 QWidget(parent),
14 ui(new Ui::SocRegsViewerNew)
15 {
16 ui->setupUi(this);
17 this->ui->socName->setText("No name");
18 }
19
12 SocRegsViewerNew::~SocRegsViewerNew()
20 SocRegsViewerNew::~SocRegsViewerNew()
13 {
21 {
14 delete ui;
22 delete ui;
@@ -66,7 +74,7 void SocRegsViewerNew::periphUp(peripher
66 {
74 {
67 p_peripherals.at(senderIndex)->leave();
75 p_peripherals.at(senderIndex)->leave();
68 p_peripherals.at(index-1)->enter(cursorIndex,false);
76 p_peripherals.at(index-1)->enter(cursorIndex,false);
69 // ensureWidgetVisible(p_peripherals.at(index-1));
77 // ensureWidgetVisible(p_peripherals.at(index-1));
70 break;
78 break;
71 }
79 }
72 index--;
80 index--;
@@ -86,7 +94,7 void SocRegsViewerNew::periphDown(periph
86 {
94 {
87 p_peripherals.at(senderIndex)->leave();
95 p_peripherals.at(senderIndex)->leave();
88 p_peripherals.at(index+1)->enter(cursorIndex);
96 p_peripherals.at(index+1)->enter(cursorIndex);
89 // ensureWidgetVisible(p_peripherals.at(index+1));
97 // ensureWidgetVisible(p_peripherals.at(index+1));
90 break;
98 break;
91 }
99 }
92 index++;
100 index++;
@@ -94,6 +102,11 void SocRegsViewerNew::periphDown(periph
94 }
102 }
95 }
103 }
96
104
105 void SocRegsViewerNew::setSocName(const QString &name)
106 {
107 this->ui->socName->setText(name);
108 }
109
97 void SocRegsViewerNew::changeEvent(QEvent *e)
110 void SocRegsViewerNew::changeEvent(QEvent *e)
98 {
111 {
99 QWidget::changeEvent(e);
112 QWidget::changeEvent(e);
@@ -15,6 +15,7 class SocRegsViewerNew : public QWidget
15
15
16 public:
16 public:
17 explicit SocRegsViewerNew(const QString &name, QWidget *parent = 0);
17 explicit SocRegsViewerNew(const QString &name, QWidget *parent = 0);
18 explicit SocRegsViewerNew(QWidget *parent = 0);
18 ~SocRegsViewerNew();
19 ~SocRegsViewerNew();
19
20
20 peripheralWidget *peripheral(int index);
21 peripheralWidget *peripheral(int index);
@@ -26,6 +27,7 public slots:
26 void periphClicked(peripheralWidget* sender);
27 void periphClicked(peripheralWidget* sender);
27 void periphUp(peripheralWidget* sender,int cursorIndex);
28 void periphUp(peripheralWidget* sender,int cursorIndex);
28 void periphDown(peripheralWidget* sender,int cursorIndex);
29 void periphDown(peripheralWidget* sender,int cursorIndex);
30 void setSocName(const QString& name);
29 protected:
31 protected:
30 void changeEvent(QEvent *e);
32 void changeEvent(QEvent *e);
31
33
@@ -14,10 +14,7
14 <string>Form</string>
14 <string>Form</string>
15 </property>
15 </property>
16 <layout class="QGridLayout" name="gridLayout">
16 <layout class="QGridLayout" name="gridLayout">
17 <item row="0" column="1">
17 <item row="1" column="0" colspan="2">
18 <widget class="QComboBox" name="rootPluginCmbBx"/>
19 </item>
20 <item row="2" column="0" colspan="2">
21 <widget class="QScrollArea" name="PeriphList">
18 <widget class="QScrollArea" name="PeriphList">
22 <property name="widgetResizable">
19 <property name="widgetResizable">
23 <bool>true</bool>
20 <bool>true</bool>
@@ -28,7 +25,7
28 <x>0</x>
25 <x>0</x>
29 <y>0</y>
26 <y>0</y>
30 <width>693</width>
27 <width>693</width>
31 <height>302</height>
28 <height>337</height>
32 </rect>
29 </rect>
33 </property>
30 </property>
34 <layout class="QVBoxLayout" name="verticalLayout">
31 <layout class="QVBoxLayout" name="verticalLayout">
@@ -46,13 +43,6
46 </widget>
43 </widget>
47 </widget>
44 </widget>
48 </item>
45 </item>
49 <item row="0" column="0">
50 <widget class="QLabel" name="label">
51 <property name="text">
52 <string>Root Plugin</string>
53 </property>
54 </widget>
55 </item>
56 </layout>
46 </layout>
57 </widget>
47 </widget>
58 <resources/>
48 <resources/>
General Comments 0
You need to be logged in to leave comments. Login now