kexi

KexiDBDriverComboBox Class Reference

#include <kexidbdrivercombobox.h>

List of all members.


Detailed Description

Combo box widget for selecting a database driver.

This widget provides a combobox for selecting a database driver.

Usage:

A more complete example can be found in koffice/kexi/tests/widgets/.

Definition at line 47 of file kexidbdrivercombobox.h.


Public Types

enum  Options { ShowFileDrivers = 1, ShowServerDrivers = 2, ShowAll = ShowFileDrivers|ShowServerDrivers }

Public Member Functions

 KexiDBDriverComboBox (QWidget *parent, const KexiDB::Driver::InfoMap &driversInfo, Options options=ShowAll)
 ~KexiDBDriverComboBox ()
QStringList driverNames () const
QString selectedDriverName () const
void setDriverName (const QString &driverName)

Protected Attributes

QMap< QString, QString > m_driversMap
QStringList m_driverNames

Constructor & Destructor Documentation

KexiDBDriverComboBox::KexiDBDriverComboBox ( QWidget *  parent,
const KexiDB::Driver::InfoMap driversInfo,
Options  options = ShowAll 
)

Constructs a KexiDBDriverComboBox object.

The combobox is populated with the names of the drivers in driversInfo. A suitable value for driversInfo can be obtained from KexiDB::DriverManager::driversInfo().

If includeFileBasedDrivers is set to false, then only those drivers that are for database servers (those which have X-Kexi-DriverType=Network in their .desktop file) are shown.

Todo:
change this if better icon is available

Todo:
change this if better icon is available

Definition at line 26 of file kexidbdrivercombobox.cpp.


Member Function Documentation

QStringList KexiDBDriverComboBox::driverNames (  )  const [inline]

Gets a list of the names of all drivers.

Note that this returns just the names of those drivers that are in the combobox: if the includeFileBasedDrivers argument to the constructor was false, this won't include the file based drivers either.

Returns:
a list of names of drivers that were found

Definition at line 79 of file kexidbdrivercombobox.h.

QString KexiDBDriverComboBox::selectedDriverName (  )  const

Get the name of the currrently selected driver. If the combobox is empty, QString::null will be returned.

Returns:
the name of the currently selected driver

Definition at line 75 of file kexidbdrivercombobox.cpp.

void KexiDBDriverComboBox::setDriverName ( const QString &  driverName  ) 

Set the currrently selected driver.

The combobox entry for driverName is selected. If driverName is not listed in the combobox then there is no change. The search is case insensitive.

Definition at line 83 of file kexidbdrivercombobox.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys