##// 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 64 void CollapsablePeripheralWidget::collapse()
57 65 {
58 66 this->m_periph->setVisible(m_collapsed);
@@ -36,7 +36,7 public:
36 36 peripheralWidget* getPeripheralWidget();
37 37 protected:
38 38 void changeEvent(QEvent *e);
39
39 void paintEvent(QPaintEvent *);
40 40 public slots:
41 41 void collapse();
42 42 void setName(const QString& name);
@@ -6,8 +6,8
6 6 <rect>
7 7 <x>0</x>
8 8 <y>0</y>
9 <width>845</width>
10 <height>249</height>
9 <width>833</width>
10 <height>192</height>
11 11 </rect>
12 12 </property>
13 13 <property name="sizePolicy">
@@ -20,10 +20,7
20 20 <string>Form</string>
21 21 </property>
22 22 <property name="styleSheet">
23 <string notr="true">QWidget#CollapsablePeripheralWidget {
24 border: 1px solid gray;
25 border-radius: 9px;
26 }</string>
23 <string notr="true"/>
27 24 </property>
28 25 <layout class="QGridLayout" name="gridLayout">
29 26 <item row="0" column="2">
@@ -34,6 +31,9
34 31 <verstretch>0</verstretch>
35 32 </sizepolicy>
36 33 </property>
34 <property name="focusPolicy">
35 <enum>Qt::NoFocus</enum>
36 </property>
37 37 <property name="text">
38 38 <string/>
39 39 </property>
@@ -9,6 +9,14 SocRegsViewerNew::SocRegsViewerNew(const
9 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 20 SocRegsViewerNew::~SocRegsViewerNew()
13 21 {
14 22 delete ui;
@@ -66,7 +74,7 void SocRegsViewerNew::periphUp(peripher
66 74 {
67 75 p_peripherals.at(senderIndex)->leave();
68 76 p_peripherals.at(index-1)->enter(cursorIndex,false);
69 // ensureWidgetVisible(p_peripherals.at(index-1));
77 // ensureWidgetVisible(p_peripherals.at(index-1));
70 78 break;
71 79 }
72 80 index--;
@@ -86,7 +94,7 void SocRegsViewerNew::periphDown(periph
86 94 {
87 95 p_peripherals.at(senderIndex)->leave();
88 96 p_peripherals.at(index+1)->enter(cursorIndex);
89 // ensureWidgetVisible(p_peripherals.at(index+1));
97 // ensureWidgetVisible(p_peripherals.at(index+1));
90 98 break;
91 99 }
92 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 110 void SocRegsViewerNew::changeEvent(QEvent *e)
98 111 {
99 112 QWidget::changeEvent(e);
@@ -15,6 +15,7 class SocRegsViewerNew : public QWidget
15 15
16 16 public:
17 17 explicit SocRegsViewerNew(const QString &name, QWidget *parent = 0);
18 explicit SocRegsViewerNew(QWidget *parent = 0);
18 19 ~SocRegsViewerNew();
19 20
20 21 peripheralWidget *peripheral(int index);
@@ -26,6 +27,7 public slots:
26 27 void periphClicked(peripheralWidget* sender);
27 28 void periphUp(peripheralWidget* sender,int cursorIndex);
28 29 void periphDown(peripheralWidget* sender,int cursorIndex);
30 void setSocName(const QString& name);
29 31 protected:
30 32 void changeEvent(QEvent *e);
31 33
@@ -14,10 +14,7
14 14 <string>Form</string>
15 15 </property>
16 16 <layout class="QGridLayout" name="gridLayout">
17 <item row="0" column="1">
18 <widget class="QComboBox" name="rootPluginCmbBx"/>
19 </item>
20 <item row="2" column="0" colspan="2">
17 <item row="1" column="0" colspan="2">
21 18 <widget class="QScrollArea" name="PeriphList">
22 19 <property name="widgetResizable">
23 20 <bool>true</bool>
@@ -28,7 +25,7
28 25 <x>0</x>
29 26 <y>0</y>
30 27 <width>693</width>
31 <height>302</height>
28 <height>337</height>
32 29 </rect>
33 30 </property>
34 31 <layout class="QVBoxLayout" name="verticalLayout">
@@ -46,13 +43,6
46 43 </widget>
47 44 </widget>
48 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 46 </layout>
57 47 </widget>
58 48 <resources/>
General Comments 0
You need to be logged in to leave comments. Login now