[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[9] | 5 | #include "TabWidget.h"
|
---|
| 6 | #include "Tab.h"
|
---|
| 7 | #include <stdio.h>
|
---|
| 8 | #include "Layout.h"
|
---|
| 9 |
|
---|
| 10 | //#include "qledindicator.h"
|
---|
| 11 |
|
---|
[15] | 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;
|
---|
[9] | 23 |
|
---|
[15] | 24 | // QLedIndicator* led=new QLedIndicator(tab);
|
---|
| 25 | // tab->setCornerWidget(led,Qt::TopLeftCorner);
|
---|
[9] | 26 | }
|
---|
| 27 |
|
---|
[15] | 28 | TabWidget::~TabWidget() {}
|
---|
[9] | 29 |
|
---|
[15] | 30 | void TabWidget::XmlEvent(QDomElement dom) {
|
---|
| 31 | QString type = dom.tagName();
|
---|
| 32 | QString name = dom.attribute("name");
|
---|
| 33 | int position = dom.attribute("position").toInt();
|
---|
[9] | 34 |
|
---|
[15] | 35 | if (type == "Tab") {
|
---|
| 36 | Tab *layout = new Tab(this, name, position);
|
---|
| 37 | }
|
---|
[9] | 38 | }
|
---|
| 39 |
|
---|
[15] | 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;
|
---|
[9] | 46 | }
|
---|