File indexing completed on 2024-12-22 04:17:46
0001 /*************************************************************************** 0002 * * 0003 * copyright : (C) 2007 The University of Toronto * 0004 * netterfield@astro.utoronto.ca * 0005 * * 0006 * This program is free software; you can redistribute it and/or modify * 0007 * it under the terms of the GNU General Public License as published by * 0008 * the Free Software Foundation; either version 2 of the License, or * 0009 * (at your option) any later version. * 0010 * * 0011 ***************************************************************************/ 0012 0013 #ifndef TABWIDGET_H 0014 #define TABWIDGET_H 0015 0016 #include <QTabWidget> 0017 0018 namespace Kst { 0019 0020 class View; 0021 0022 class TabWidget : public QTabWidget 0023 { 0024 Q_OBJECT 0025 0026 public: 0027 explicit TabWidget(QWidget *parent); 0028 ~TabWidget(); 0029 0030 View *currentView() const; 0031 QList<View*> views() const; 0032 // pass tab name as objectName 0033 void addView(View*); 0034 void deleteView(View* view); 0035 void clear(); 0036 QTabBar *tabBar() const { return QTabWidget::tabBar(); } 0037 0038 Q_SIGNALS: 0039 void currentViewModeChanged(); 0040 0041 public Q_SLOTS: 0042 View *createView(); 0043 void renameCurrentView(); 0044 void closeCurrentView(); 0045 void setCurrentViewName(QString name); 0046 0047 private Q_SLOTS: 0048 void contextMenu(const QPoint&); 0049 0050 private: 0051 int _cnt; 0052 void checkedShowTabbar(); 0053 }; 0054 0055 } 0056 0057 #endif 0058 0059 // vim: ts=2 sw=2 et