##// END OF EJS Templates
Use raw pointer for VariableModel (QObject class)
Alexandre Leroux -
r148:15bcbc130e6c
parent child
Show More
@@ -7,17 +7,18
7 Q_LOGGING_CATEGORY(LOG_VariableController, "VariableController")
7 Q_LOGGING_CATEGORY(LOG_VariableController, "VariableController")
8
8
9 struct VariableController::VariableControllerPrivate {
9 struct VariableController::VariableControllerPrivate {
10 explicit VariableControllerPrivate()
10 explicit VariableControllerPrivate(VariableController *parent)
11 : m_WorkingMutex{}, m_VariableModel{std::make_unique<VariableModel>()}
11 : m_WorkingMutex{}, m_VariableModel{new VariableModel{parent}}
12 {
12 {
13 }
13 }
14
14
15 QMutex m_WorkingMutex;
15 QMutex m_WorkingMutex;
16 std::unique_ptr<VariableModel> m_VariableModel;
16 /// Variable model. The VariableController has the ownership
17 VariableModel *m_VariableModel;
17 };
18 };
18
19
19 VariableController::VariableController(QObject *parent)
20 VariableController::VariableController(QObject *parent)
20 : QObject{parent}, impl{spimpl::make_unique_impl<VariableControllerPrivate>()}
21 : QObject{parent}, impl{spimpl::make_unique_impl<VariableControllerPrivate>(this)}
21 {
22 {
22 qCDebug(LOG_VariableController()) << tr("VariableController construction")
23 qCDebug(LOG_VariableController()) << tr("VariableController construction")
23 << QThread::currentThread();
24 << QThread::currentThread();
@@ -37,7 +38,7 Variable *VariableController::createVariable(const QString &name) noexcept
37
38
38 VariableModel *VariableController::variableModel() noexcept
39 VariableModel *VariableController::variableModel() noexcept
39 {
40 {
40 return impl->m_VariableModel.get();
41 return impl->m_VariableModel;
41 }
42 }
42
43
43 void VariableController::initialize()
44 void VariableController::initialize()
General Comments 0
You need to be logged in to leave comments. Login now