Multithreading 如何在QT环境中使用来自不同类或方法的mongocxx连接? 作为一个Scala/java女孩,我有时在C++ +Qt中完全失去了理智。
我有非常简单的线程类,如:Multithreading 如何在QT环境中使用来自不同类或方法的mongocxx连接? 作为一个Scala/java女孩,我有时在C++ +Qt中完全失去了理智。,multithreading,mongodb,qt,mongo-cxx-driver,Multithreading,Mongodb,Qt,Mongo Cxx Driver,我有非常简单的线程类,如: mongoUpdate::mongoUpdate(QObject *parent) : QObject(parent) { mongocxx::options::client client_options; mongocxx::instance inst{}; mongocxx::uri uri("mongodb://xxxx"); mongocxx::client client(uri)
mongoUpdate::mongoUpdate(QObject *parent) :
QObject(parent)
{
mongocxx::options::client client_options;
mongocxx::instance inst{};
mongocxx::uri uri("mongodb://xxxx");
mongocxx::client client(uri);
// db = client["aces"];
// coll = db["aces"];
qDebug() << "PARENT Mongo Connected" << endl;
// MONGO
}
void mongoUpdate::send_mongo(QImage m_qimg)
{
Write the mongo m_qimg. bla
}
mongoUpdate::mongoUpdate(QObject*父对象):
QObject(父对象)
{
mongocxx::选项::客户端选项;
mongocxx::实例inst{};
mongocxx::uri(“mongodb://xxxx");
mongocxx::客户端(uri);
//db=客户[“aces”];
//coll=db[“aces”];
qDebug()