DNSSD.DomainModel

KDE 4.5 PyKDE API Reference

- KDE's Python API

# DomainModel Class Reference

`from PyKDE4.dnssd import *`

Inherits: QAbstractItemModel → QObject
Namespace: DNSSD

## Detailed Description

DomainModel domainmodel.h DNSSD/DomainModel Model for list of Zeroconf domains

This class provides a Qt Model for DomainBrowser to allow easy integration of domain discovery into a GUI. For example, to provide a combo box listing available domains, you can do:

     DNSSD.DomainModel *domainModel = new DomainModel(
         new DNSSD.DomainBrowser(DNSSD.DomainBrowser.Browsing)
         );
     QComboBox *domainCombo = new QComboBox();
     domainCombo->setModel(domainModel);

Since:
  4.1

Author:
  Jakub Stachowski

## Methods
| __init__ (self, DNSSD.DomainBrowser browser, QObject parent=0)
int | columnCount (self, QModelIndex parent=QModelIndex())
QVariant | data (self, QModelIndex index, int role=Qt.DisplayRole)
bool | hasIndex (self, int row, int column, QModelIndex parent)
QModelIndex | index (self, int row, int column, QModelIndex parent=QModelIndex())
QModelIndex | parent (self, QModelIndex index)
int | rowCount (self, QModelIndex parent=QModelIndex())

## Method Documentation

__init__ | ( | self, |
|  | DNSSD.DomainBrowser | browser,
|  | QObject | parent=0
| ) |  |  |

Creates a model for given domain browser and starts browsing for domains.

The model takes ownership of the browser, so there is no need to delete it afterwards.

You should not call DomainBrowser.startBrowse() on browser before passing it to DomainModel.

Parameters:

  | browser | the domain browser that will provide the domains to be listed by the model
  | parent | the parent object (see QObject documentation)

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

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

bool hasIndex | ( | self, |
|  | int | row,
|  | int | column,
|  | QModelIndex | parent
| ) |  |  |

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

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

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