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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • paged
kpagewidgetmodel.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE Libraries
3 
4  Copyright (C) 2006 Tobias Koenig (tokoe@kde.org)
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KPAGEWIDGETMODEL_H
23 #define KPAGEWIDGETMODEL_H
24 
25 #include "kpagemodel.h"
26 
27 class QWidget;
28 
29 class KIcon;
30 
50 class KDEUI_EXPORT KPageWidgetItem : public QObject
51 {
52  Q_OBJECT
53  Q_PROPERTY( QString name READ name WRITE setName )
54  Q_PROPERTY( QString header READ header WRITE setHeader )
55  Q_PROPERTY( KIcon icon READ icon WRITE setIcon )
56  Q_PROPERTY( bool checkable READ isCheckable WRITE setCheckable )
57  Q_PROPERTY( bool checked READ isChecked WRITE setChecked )
63  Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled)
64 
65  public:
71  KPageWidgetItem( QWidget *widget );
72 
80  KPageWidgetItem( QWidget *widget, const QString &name );
81 
85  ~KPageWidgetItem();
86 
90  QWidget* widget() const;
91 
96  void setName( const QString &name );
97 
101  QString name() const;
102 
113  void setHeader( const QString &header );
114 
118  QString header() const;
119 
124  void setIcon( const KIcon &icon );
125 
129  KIcon icon() const;
130 
136  void setCheckable( bool checkable );
137 
141  bool isCheckable() const;
142 
146  bool isChecked() const;
147 
151  bool isEnabled() const;
152 
153  public Q_SLOTS:
157  void setEnabled(bool);
158 
162  void setChecked( bool checked );
163 
164  Q_SIGNALS:
169  void changed();
170 
175  void toggled( bool checked );
176 
177  private:
178  class Private;
179  Private* const d;
180 };
181 
182 class KPageWidgetModelPrivate;
183 
188 class KDEUI_EXPORT KPageWidgetModel : public KPageModel
189 {
190  Q_OBJECT
191  Q_DECLARE_PRIVATE(KPageWidgetModel)
192 
193  public:
199  explicit KPageWidgetModel( QObject *parent = 0 );
200 
204  ~KPageWidgetModel();
205 
214  KPageWidgetItem* addPage( QWidget *widget, const QString &name );
215 
221  void addPage( KPageWidgetItem *item );
222 
233  KPageWidgetItem* insertPage( KPageWidgetItem *before, QWidget *widget, const QString &name );
234 
243  void insertPage( KPageWidgetItem *before, KPageWidgetItem *item );
244 
254  KPageWidgetItem* addSubPage( KPageWidgetItem *parent, QWidget *widget, const QString &name );
255 
263  void addSubPage( KPageWidgetItem *parent, KPageWidgetItem *item );
264 
268  void removePage( KPageWidgetItem *item );
269 
273  virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
274  virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
275  virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
276  virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
277  virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
278  virtual QModelIndex parent( const QModelIndex &index ) const;
279  virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
280 
284  KPageWidgetItem *item(const QModelIndex &index) const;
285 
290  QModelIndex index( const KPageWidgetItem *item ) const;
291 
292  Q_SIGNALS:
297  void toggled( KPageWidgetItem *page, bool checked );
298 
299  private:
300  Q_PRIVATE_SLOT(d_func(), void _k_itemChanged())
301  Q_PRIVATE_SLOT(d_func(), void _k_itemToggled(bool))
302 };
303 
304 #endif
QModelIndex
QWidget
KPageModel
A base class for a model used by KPageView.
Definition: kpagemodel.h:56
KStandardAction::name
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
KPageWidgetModel
This page model is used by.
Definition: kpagewidgetmodel.h:188
QObject
KIcon
A wrapper around QIcon that provides KDE icon features.
Definition: kicon.h:40
QString
kpagemodel.h
KPageWidgetItem
KPageWidgetItem is used by KPageWidget and represents a page.
Definition: kpagewidgetmodel.h:50
QObject::parent
QObject * parent() const
QVariant
Qt::ItemFlags
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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