KDE 4.9 PyKDE API Reference

- KDE's Python API

# KPageWidgetModel Class Reference

`from PyKDE4.kdeui import *`

Inherits: KPageModel → QAbstractItemModel → QObject

## Detailed Description

This page model is used by

See also:
  KPageWidget to provide a hierarchical layout of pages.

## Signals

| toggled (KPageWidgetItem page, bool checked)

## Methods

| __init__ (self, QObject parent=0)
KPageWidgetItem | addPage (self, QWidget widget, QString name)
| addPage (self, KPageWidgetItem item)
KPageWidgetItem | addSubPage (self, KPageWidgetItem parent, QWidget widget, QString name)
| addSubPage (self, KPageWidgetItem parent, KPageWidgetItem item)
int | columnCount (self, QModelIndex parent=QModelIndex())
QVariant | data (self, QModelIndex index, int role=Qt.DisplayRole)
Qt::ItemFlags | flags (self, QModelIndex index)
QModelIndex | index (self, int row, int column, QModelIndex parent=QModelIndex())
QModelIndex | index (self, KPageWidgetItem item)
KPageWidgetItem | insertPage (self, KPageWidgetItem before, QWidget widget, QString name)
| insertPage (self, KPageWidgetItem before, KPageWidgetItem item)
KPageWidgetItem | item (self, QModelIndex index)
QModelIndex | parent (self, QModelIndex index)
| removePage (self, KPageWidgetItem item)
int | rowCount (self, QModelIndex parent=QModelIndex())
bool | setData (self, QModelIndex index, QVariant value, int role=Qt.EditRole)

## Signal Documentation

toggled | ( | KPageWidgetItem | page,
|  | bool | checked
| ) |  |  |

This signal is emitted whenever a checkable page changes its state.

Parameters:

  | checked | is true when the
  | page | is checked, or false if the
  | page | is unchecked.

Signal syntax:
  `QObject.connect(source, SIGNAL("toggled(KPageWidgetItem*, bool)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent=0
| ) |  |  |

Creates a new page widget model.

Parameters:

  | parent | The parent object.

KPageWidgetItem addPage | ( | self, |
|  | QWidget | widget,
|  | QString | name
| ) |  |  |

Adds a new top level page to the model.

Parameters:

  item

  The
  See also:
    KPageWidgetItem which describes the page.

addPage | ( | self, |
|  | KPageWidgetItem | item
| ) |  |  |

Adds a new top level page to the model.

Parameters:

  item

  The
  See also:
    KPageWidgetItem which describes the page.

KPageWidgetItem addSubPage | ( | self, |
|  | KPageWidgetItem | parent,
|  | QWidget | widget,
|  | QString | name
| ) |  |  |

Inserts a new sub page in the model.

Parameters:

  parent

  The new page will be insert as child of this
  See also:
    KPageWidgetItem.

  Parameters:

    item

    The
    See also:
      KPageWidgetItem which describes the page.

addSubPage | ( | self, |
|  | KPageWidgetItem | parent,
|  | KPageWidgetItem | item
| ) |  |  |

Inserts a new sub page in the model.

Parameters:

  parent

  The new page will be insert as child of this
  See also:
    KPageWidgetItem.

  Parameters:

    item

    The
    See also:
      KPageWidgetItem which describes the page.

int columnCount | ( | self, |
|  | QModelIndex | parent=QModelIndex()
| ) |  |  |

These methods are reimplemented from QAbstractItemModel.

QVariant data | ( | self, |
|  | QModelIndex | index,
|  | int | role=Qt.DisplayRole
| ) |  |  |

Qt::ItemFlags flags | ( | self, |
|  | QModelIndex | index
| ) |  |  |

QModelIndex index | ( | self, |
|  | int | row,
|  | int | column,
|  | QModelIndex | parent=QModelIndex()
| ) |  |  |

Returns the index for a given

See also:
  KPageWidgetItem. The index is invalid if the item can't be found in the model.

QModelIndex index | ( | self, |
|  | KPageWidgetItem | item
| ) |  |  |

Returns the index for a given

See also:
  KPageWidgetItem. The index is invalid if the item can't be found in the model.

KPageWidgetItem insertPage | ( | self, |
|  | KPageWidgetItem | before,
|  | QWidget | widget,
|  | QString | name
| ) |  |  |

Inserts a new page in the model.

Parameters:

  before

  The new page will be insert before this
  See also:
    KPageWidgetItem on the same level in hierarchy.

  Parameters:

    item

    The
    See also:
      KPageWidgetItem which describes the page.

insertPage | ( | self, |
|  | KPageWidgetItem | before,
|  | KPageWidgetItem | item
| ) |  |  |

Inserts a new page in the model.

Parameters:

  before

  The new page will be insert before this
  See also:
    KPageWidgetItem on the same level in hierarchy.

  Parameters:

    item

    The
    See also:
      KPageWidgetItem which describes the page.

KPageWidgetItem item | ( | self, |
|  | QModelIndex | index
| ) |  |  |

Returns the

See also:
  KPageWidgetItem for a given index or 0 if the index is invalid.

QModelIndex parent | ( | self, |
|  | QModelIndex | index
| ) |  |  |

removePage | ( | self, |
|  | KPageWidgetItem | item
| ) |  |  |

Removes the page associated with the given

See also:
  KPageWidgetItem.

int rowCount | ( | self, |
|  | QModelIndex | parent=QModelIndex()
| ) |  |  |

bool setData | ( | self, |
|  | QModelIndex | index,
|  | QVariant | value,
|  | int | role=Qt.EditRole
| ) |  |  |