Kexi API Documentation (2.0 alpha)

KexiDBDriverComboBox Class Reference

#include <kexidbdrivercombobox.h>

Inheritance diagram for KexiDBDriverComboBox:

KComboBox 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:

  KexiDB::DriverManager manager;
  KexiDB::Driver::InfoMap drvs = manager.driversInfo();

  KexiDBDriverComboBox* combo = new KexiDBDriverComboBox(drvs, true, 0);

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, QStringm_driversMap
QStringList m_driverNames


Member Enumeration Documentation

enum KexiDBDriverComboBox::Options
 

Enumeration values:
ShowFileDrivers 
ShowServerDrivers 
ShowAll 

Definition at line 52 of file kexidbdrivercombobox.h.


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.

Definition at line 26 of file kexidbdrivercombobox.cpp.

References KexiDB::Driver::Info::caption, foreach, m_driverNames, m_driversMap, KexiDB::Driver::Info::name, ShowFileDrivers, and ShowServerDrivers.

KexiDBDriverComboBox::~KexiDBDriverComboBox  ) 
 

Definition at line 71 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.

References m_driversMap.

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.

References m_driverNames.

Referenced by KexiDBConnectionWidget::setDataInternal().


Member Data Documentation

QStringList KexiDBDriverComboBox::m_driverNames [protected]
 

Definition at line 98 of file kexidbdrivercombobox.h.

Referenced by KexiDBDriverComboBox(), and setDriverName().

QMap<QString,QString> KexiDBDriverComboBox::m_driversMap [protected]
 

Definition at line 97 of file kexidbdrivercombobox.h.

Referenced by KexiDBDriverComboBox(), and selectedDriverName().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:49:58 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003