# eric4.SqlBrowser.SqlConnectionWidget

Module implementing a widget showing the SQL connections.

### Global Attributes

None

### Classes

SqlConnectionWidget | Class implementing a widget showing the SQL connections.

### Functions

None

## SqlConnectionWidget

Class implementing a widget showing the SQL connections.

### Signals

cleared()
  emitted after the connection tree has been cleared
schemaRequested(QString)
  emitted when the schema display is requested
tableActivated(QString)
  emitted after the entry for a table has been activated

### Derived from

QWidget

### Class Attributes

None

### Class Methods

None

### Methods

SqlConnectionWidget | Constructor
__currentItemChanged | Private slot handling a change of the current item.
__dbCaption | Private method to assemble a string for the caption.
__itemActivated | Private slot handling the activation of an item.
__setActive | Private slot to set an item to active.
__setBold | Private slot to set the font to bold.
currentDatabase | Public method to get the current database.
refresh | Public slot to refresh the connection tree.
showSchema | Public slot to show schema data of a database.

### Static Methods

None

#### SqlConnectionWidget (Constructor)

SqlConnectionWidget(parent = None)

Constructor

parent
  reference to the parent widget (QWidget)

#### SqlConnectionWidget.__currentItemChanged

__currentItemChanged(current, previous)

Private slot handling a change of the current item.

current
  reference to the new current item (QTreeWidgetItem)
previous
  reference to the previous current item (QTreeWidgetItem)

#### SqlConnectionWidget.__dbCaption

__dbCaption(db)

Private method to assemble a string for the caption.

db
  reference to the database object (QSqlDatabase)

Returns:
  caption string (QString)

#### SqlConnectionWidget.__itemActivated

__itemActivated(itm, column)

Private slot handling the activation of an item.

itm
  reference to the item (QTreeWidgetItem)
column
  column that was activated (integer)

#### SqlConnectionWidget.__setActive

__setActive(itm)

Private slot to set an item to active.

itm
  reference to the item to set as the active item (QTreeWidgetItem)

#### SqlConnectionWidget.__setBold

__setBold(itm, bold)

Private slot to set the font to bold.

itm
  reference to the item to be changed (QTreeWidgetItem)
bold
  flag indicating bold (boolean)

#### SqlConnectionWidget.currentDatabase

currentDatabase()

Public method to get the current database.

Returns:
  reference to the current database (QSqlDatabase)

#### SqlConnectionWidget.refresh

refresh()

Public slot to refresh the connection tree.

#### SqlConnectionWidget.showSchema

showSchema()

Public slot to show schema data of a database.

Up