• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

krdc

  • sources
  • kde-4.12
  • kdenetwork
  • krdc
tabbedviewwidget.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2009 Tony Murray <murraytony @ gmail.com>
4 **
5 ** This file is part of KDE.
6 **
7 ** This program is free software; you can redistribute it and/or modify
8 ** it under the terms of the GNU General Public License as published by
9 ** the Free Software Foundation; either version 2 of the License, or
10 ** (at your option) any later version.
11 **
12 ** This program is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ** GNU General Public License for more details.
16 **
17 ** You should have received a copy of the GNU General Public License
18 ** along with this program; see the file COPYING. If not, write to
19 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 ** Boston, MA 02110-1301, USA.
21 **
22 ****************************************************************************/
23 
24 #ifndef TABBEDVIEWWIDGET_H
25 #define TABBEDVIEWWIDGET_H
26 
27 #include <QAbstractItemModel>
28 #include <KTabWidget>
29 
30 class TabbedViewWidgetModel : public QAbstractItemModel
31 {
32  friend class TabbedViewWidget;
33  Q_OBJECT
34 public:
35  explicit TabbedViewWidgetModel(KTabWidget *modelTarget);
36  QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
37  QModelIndex parent(const QModelIndex &index) const;
38  int rowCount(const QModelIndex &parent = QModelIndex()) const;
39  int columnCount(const QModelIndex &parent = QModelIndex()) const;
40  Qt::ItemFlags flags(const QModelIndex &index) const;
41  bool setData(const QModelIndex &index, const QVariant &value, int role);
42  QVariant data(const QModelIndex &index, int role) const;
43 protected:
44  void emitLayoutAboutToBeChanged();
45  void emitLayoutChanged();
46  void emitDataChanged(int index);
47 private:
48  KTabWidget *m_tabWidget;
49 };
50 
51 class TabbedViewWidget : public KTabWidget
52 {
53  Q_OBJECT
54 public:
55  explicit TabbedViewWidget(QWidget *parent = 0, Qt::WFlags flags = 0);
56  virtual ~TabbedViewWidget();
57  TabbedViewWidgetModel* getModel();
58  int addTab(QWidget *page, const QString &label);
59  int addTab(QWidget *page, const QIcon &icon, const QString &label);
60  int insertTab(int index, QWidget *page, const QString &label);
61  int insertTab(int index, QWidget *page, const QIcon &icon, const QString &label);
62  void removeTab(int index);
63  void removePage(QWidget *page);
64  void moveTab(int from, int to);
65  void setTabText(int index, const QString &label);
66 private:
67  TabbedViewWidgetModel *m_model;
68 };
69 
70 #endif // FULLSCREENWINDOW_H
71 
TabbedViewWidget::removeTab
void removeTab(int index)
Definition: tabbedviewwidget.cpp:164
TabbedViewWidget::setTabText
void setTabText(int index, const QString &label)
Definition: tabbedviewwidget.cpp:178
QWidget
TabbedViewWidgetModel::emitDataChanged
void emitDataChanged(int index)
Definition: tabbedviewwidget.cpp:102
TabbedViewWidgetModel::data
QVariant data(const QModelIndex &index, int role) const
Definition: tabbedviewwidget.cpp:73
TabbedViewWidget::addTab
int addTab(QWidget *page, const QString &label)
Definition: tabbedviewwidget.cpp:122
TabbedViewWidgetModel::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: tabbedviewwidget.cpp:44
TabbedViewWidgetModel::setData
bool setData(const QModelIndex &index, const QVariant &value, int role)
Definition: tabbedviewwidget.cpp:63
TabbedViewWidget::moveTab
void moveTab(int from, int to)
Definition: tabbedviewwidget.cpp:171
TabbedViewWidgetModel::emitLayoutAboutToBeChanged
void emitLayoutAboutToBeChanged()
Definition: tabbedviewwidget.cpp:92
TabbedViewWidgetModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: tabbedviewwidget.cpp:31
TabbedViewWidgetModel::parent
QModelIndex parent(const QModelIndex &index) const
Definition: tabbedviewwidget.cpp:39
TabbedViewWidget::~TabbedViewWidget
virtual ~TabbedViewWidget()
Definition: tabbedviewwidget.cpp:113
TabbedViewWidget
Definition: tabbedviewwidget.h:51
TabbedViewWidgetModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const
Definition: tabbedviewwidget.cpp:55
QAbstractItemModel
TabbedViewWidget::TabbedViewWidget
TabbedViewWidget(QWidget *parent=0, Qt::WFlags flags=0)
Definition: tabbedviewwidget.cpp:108
TabbedViewWidget::getModel
TabbedViewWidgetModel * getModel()
Definition: tabbedviewwidget.cpp:117
TabbedViewWidgetModel::TabbedViewWidgetModel
TabbedViewWidgetModel(KTabWidget *modelTarget)
Definition: tabbedviewwidget.cpp:26
TabbedViewWidget::insertTab
int insertTab(int index, QWidget *page, const QString &label)
Definition: tabbedviewwidget.cpp:140
TabbedViewWidgetModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: tabbedviewwidget.cpp:50
TabbedViewWidget::removePage
void removePage(QWidget *page)
Definition: tabbedviewwidget.cpp:156
TabbedViewWidgetModel::emitLayoutChanged
void emitLayoutChanged()
Definition: tabbedviewwidget.cpp:97
TabbedViewWidgetModel
Definition: tabbedviewwidget.h:30
KTabWidget
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:54:04 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

krdc

Skip menu "krdc"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal