kexi

#include <kexidbdrivercombobox.h>

Public Types

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

Public Member Functions

 KexiDBDriverComboBox (TQWidget *parent, const KexiDB::Driver::InfoMap &driversInfo, Options options=ShowAll)
TQStringList driverNames () const
TQString selectedDriverName () const
void setDriverName (const TQString &driverName)

Protected Attributes

TQMap< TQString, TQString > m_driversMap
TQStringList m_driverNames

Detailed Description

Combo box widget for selecting a database driver.

This widget provides a combobox for selecting a database driver.

Usage:

KexiDB::Driver::InfoMap drvs = manager.driversInfo();
KexiDBDriverComboBox* combo = new KexiDBDriverComboBox(drvs, true, 0);
KexiDBDriverComboBox(TQWidget *parent, const KexiDB::Driver::InfoMap &driversInfo, Options options=ShowAll)
Database driver management, e.g. finding and loading drivers.
const KexiDB::Driver::InfoMap driversInfo()

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

Definition at line 47 of file kexidbdrivercombobox.h.

Member Enumeration Documentation

◆ Options

enum KexiDBDriverComboBox::Options

Definition at line 53 of file kexidbdrivercombobox.h.

Constructor & Destructor Documentation

◆ KexiDBDriverComboBox()

KexiDBDriverComboBox::KexiDBDriverComboBox ( TQWidget * 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.

◆ ~KexiDBDriverComboBox()

KexiDBDriverComboBox::~KexiDBDriverComboBox ( )

Definition at line 71 of file kexidbdrivercombobox.cpp.

Member Function Documentation

◆ driverNames()

TQStringList 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 80 of file kexidbdrivercombobox.h.

◆ selectedDriverName()

TQString KexiDBDriverComboBox::selectedDriverName ( ) const

Get the name of the currrently selected driver. If the combobox is empty, TQString() will be returned.

Returns
the name of the currently selected driver

Definition at line 75 of file kexidbdrivercombobox.cpp.

◆ setDriverName()

void KexiDBDriverComboBox::setDriverName ( const TQString & 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.

Member Data Documentation

◆ m_driverNames

TQStringList KexiDBDriverComboBox::m_driverNames
protected

Definition at line 99 of file kexidbdrivercombobox.h.

◆ m_driversMap

TQMap<TQString,TQString> KexiDBDriverComboBox::m_driversMap
protected

Definition at line 98 of file kexidbdrivercombobox.h.


The documentation for this class was generated from the following files: