1 | // %flair:license{
|
---|
2 | // This file is part of the Flair framework distributed under the
|
---|
3 | // CECILL-C License, Version 1.0.
|
---|
4 | // %flair:license}
|
---|
5 | #include "TabWidget.h"
|
---|
6 | #include "Tab.h"
|
---|
7 | #include <stdio.h>
|
---|
8 | #include "Layout.h"
|
---|
9 |
|
---|
10 | //#include "qledindicator.h"
|
---|
11 |
|
---|
12 | TabWidget::TabWidget(Layout *parent, int row, int col, QString name,
|
---|
13 | QTabWidget::TabPosition position)
|
---|
14 | : XmlWidget(name, "TabWidget", parent) {
|
---|
15 | tab = new QTabWidget();
|
---|
16 | // tab->setTabShape(QTabWidget::Triangular);
|
---|
17 | // tab->setDocumentMode(true);
|
---|
18 | parent->addWidget(tab, row, col);
|
---|
19 | tab->setTabPosition(position);
|
---|
20 | SetIsContainer(true);
|
---|
21 | SetIsExpandable(true);
|
---|
22 | visible_widget = tab;
|
---|
23 |
|
---|
24 | // QLedIndicator* led=new QLedIndicator(tab);
|
---|
25 | // tab->setCornerWidget(led,Qt::TopLeftCorner);
|
---|
26 | }
|
---|
27 |
|
---|
28 | TabWidget::~TabWidget() {}
|
---|
29 |
|
---|
30 | void TabWidget::XmlEvent(QDomElement *dom) {
|
---|
31 | QString type = dom->tagName();
|
---|
32 | QString name = dom->attribute("name");
|
---|
33 | int position = dom->attribute("position").toInt();
|
---|
34 |
|
---|
35 | if (type == "Tab") {
|
---|
36 | Tab *layout = new Tab(this, name, position);
|
---|
37 | }
|
---|
38 | }
|
---|
39 |
|
---|
40 | bool TabWidget::IsUptodate(void) {
|
---|
41 | for (int i = 0; i < childs->count(); i++) {
|
---|
42 | if (childs->at(i)->IsUptodate() == false)
|
---|
43 | return false;
|
---|
44 | }
|
---|
45 | return true;
|
---|
46 | }
|
---|