# class DomainModel

###

Module | dnssd
Namespace | DNSSD
Class | DomainModel
Inherits | QAbstractItemModel

\class DomainModel domainmodel.h DNSSD/DomainModel

DomainModel implements Qt Model interface around DomainBrowser to allow easy integration of domain discovery into GUI. Example of combo box showing list of browsing domains:

    DNSSD.DomainModel* m=new DomainModel(new DNSSD.DomainBrowser(DNSSD.DomainBrowser.Browsing));
    QComboBox *c=new QComboBox();
    c->setModel(m);

\since 4.1 Model for list of Zeroconf domains Author Jakub Stachowski

### methods

- DomainModel (browser, parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  browser | DNSSD.DomainBrowser |
  parent | QObject | 0

  Creates model for given domain browses and starts browsing for domain. The model becomes parent of the browser so there is no need to delete it afterwards.

- columnCount (parent)

  returns int

  Argument | Type | Default
  --- | --- | ---
  parent | QModelIndex | QModelIndex()

- data (index, role)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |
  role | int | Qt.DisplayRole

- hasIndex (row, column, parent)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  row | int |
  column | int |
  parent | QModelIndex |

- index (row, column, parent)

  returns QModelIndex

  Argument | Type | Default
  --- | --- | ---
  row | int |
  column | int |
  parent | QModelIndex | QModelIndex()

- parent (index)

  returns QModelIndex

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |

- rowCount (parent)

  returns int

  Argument | Type | Default
  --- | --- | ---
  parent | QModelIndex | QModelIndex()