# eric7.PdfViewer.PdfToCWidget

Module implementing a Table of Contents viewer widget.

### Global Attributes

None

### Classes

PdfToCModel | Class implementing a TOC model with page numbers.
PdfToCWidget | Class implementing a Table of Contents viewer widget.

### Functions

None

## PdfToCModel

Class implementing a TOC model with page numbers.

### Derived from

QPdfBookmarkModel

### Class Attributes

None

### Class Methods

None

### Methods

PdfToCModel | Constructor
columnCount | Public method to define the number of columns to be shown.
data | Public method to return the requested data.

### Static Methods

None

#### PdfToCModel (Constructor)

PdfToCModel(parent)

Constructor

parent (TYPE)
  DESCRIPTION

#### PdfToCModel.columnCount

columnCount(_index)

Public method to define the number of columns to be shown.

_index (QModelIndex)
  index of the element (unused)

Return:
  column count (always 2)

Return Type:
  int

#### PdfToCModel.data

data(index, role)

Public method to return the requested data.

index (QModelIndex)
  index of the element
role (Qt.ItemDataRole)
  data role

Return:
  requested data

Return Type:
  Any

Up

## PdfToCWidget

Class implementing a Table of Contents viewer widget.

### Signals

topicActivated(page, zoomFactor)
  emitted to navigate to the selected topic

### Derived from

QWidget

### Class Attributes

None

### Class Methods

None

### Methods

PdfToCWidget | Constructor
__handleDocumentStatus | Private slot to handle a change of the document status.
__searchTextChanged | Private slot to handle a change of the search text.
__topicSelected | Private slot to handle the selection of a ToC entry.

### Static Methods

None

#### PdfToCWidget (Constructor)

PdfToCWidget(document, parent=None)

Constructor

document (QPdfDocument)
  reference to the PDF document object
parent (QWidget (optional))
  reference to the parent widget (defaults to None)

#### PdfToCWidget.__handleDocumentStatus

__handleDocumentStatus(status)

Private slot to handle a change of the document status.

status (QPdfDocument.Status)
  document status

#### PdfToCWidget.__searchTextChanged

__searchTextChanged(text)

Private slot to handle a change of the search text.

text (str)
  search text

#### PdfToCWidget.__topicSelected

__topicSelected(index)

Private slot to handle the selection of a ToC entry.

index (QModelIndex)
  index of the activated entry

Up