You could accomplish this by having a boolean check indicating that an attempt to connect to the database is already in progress.
void MyClass::slotConnectToDatabase()
{
if (m_connectingToDatabase)
return;
m_connectingToDatabase = true;
// connect to database
m_connectingToDatabase = false;
}