1. Home
  2. Docs
  3. DBManager
  4. Headers
  5. [ Class ] DBData

[ Class ] DBData

Auxiliar class which helps to set the database connection;

Return Method name
DBData DBData()
void setHostName(const QString &host)
void setDatabaseName(const QString &name)
void setUserName(const QString &name)
void setPassword(const QString &password)
void setConnectionName(const QString &cName)
void setConnectOptions(const QString &options)
void setTablePrefix(const QString &prefix)
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy)
void setDatabaseConnectionType(DBConnectionType type)
void setPort(int port)
QString hostName()
QString databaseName()
QString username()
QString password()
QString connectionName()
QString connectOptions()
QString tablePrefix()
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy()
DBConnectionType connectionType()
int port()


Creates a new instance of the DBData class (constructor) and initialize its properties with their default values.

setHostName(const QString &host)

Sets the connection host name.

setDatabaseName(const QString &name)

Sets the database name.

setUserName(const QString &name)

Sets the database username.

setPassword(const QString &password)

Sets the database password.

setConnectionName(const QString &cName)

Sets the database connection name.

setConnectOptions(const QString &options)

Sets the database connection options. More details at: https://doc.qt.io/qt-5/qsqldatabase.html#setConnectOptions.

setTablePrefix(const QString &prefix)

Sets the standard table prefix (according to the application).

setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy)

Sets the database numerical precision policy. More details at: https://doc.qt.io/qt-5/qsqldatabase.html#setNumericalPrecisionPolicy.

setDatabaseConnectionType(DBConnectionType type)

Sets the database connection driver.

setPort(int port)

Sets the database connection port.


Returns the database host. Default value: Empty string.


Returns the database name. Default value: Empty string.


Returns the database username. Default value: Empty string.


Returns the database password. Default value: Empty string.


Returns the database connection name. Default value: Empty string.


Returns the database connection options. Default value: Empty string.


Returns the standard table prefix. Default value: Empty string.


Returns the numerical precision policy. Default value: QSql::LowPrecisionDouble.


Returns the database connection driver. Default value: DBConnectionType::UNDEFINED.


Returns the database connection port. Default value: -1.

Was this article helpful to you? Yes No