Using a global variable to register meta types instead of the main() function.
Prevents needing to have extra includes in the main.
This commit is contained in:
parent
fe0681f19c
commit
b9bc00a389
4 changed files with 36 additions and 10 deletions
|
|
@ -4,6 +4,20 @@
|
|||
|
||||
using namespace boost::asio;
|
||||
|
||||
namespace {
|
||||
|
||||
class registerMetaTypes {
|
||||
public:
|
||||
registerMetaTypes()
|
||||
{
|
||||
qRegisterMetaType<ASyncDBConnection::State>();
|
||||
qRegisterMetaType<Pgsql::ErrorDetails>();
|
||||
}
|
||||
} registerMetaTypes_instance;
|
||||
|
||||
|
||||
}
|
||||
|
||||
ASyncDBConnection::ASyncDBConnection(boost::asio::io_service &ios)
|
||||
: m_asioSock(ios)
|
||||
{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue