docs: describe the pmdaroot process interfaces
[pcp.git] / src / pmchart / tabwidget.cpp
blobbc1ede65f0fba4aaca1121f4c7e24a714221ce52
1 /*
2 * Copyright (c) 2007, Aconex. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
14 #include "tabwidget.h"
15 #include "tab.h"
16 #include "main.h"
18 TabWidget::TabWidget(QWidget *parent) : QTabWidget(parent)
20 setFont(*globalFont);
21 my.activeTab = NULL;
24 bool TabWidget::setActiveTab(Tab *tab)
26 my.activeTab = tab;
27 return tab->isArchiveSource();
30 bool TabWidget::setActiveTab(int index)
32 my.activeTab = my.tabs.at(index);
33 return my.activeTab->isArchiveSource();
36 void TabWidget::insertTab(Tab *tab)
38 my.tabs.append(tab);
39 tabBar()->setVisible(my.tabs.size() > 1);
42 void TabWidget::removeTab(int index)
44 my.tabs.removeAt(index);
45 tabBar()->setVisible(my.tabs.size() > 1);
46 QTabWidget::removeTab(index);