diff --git a/qml/page/T_EventoEdit.qml b/qml/page/T_EventoEdit.qml index c2752d5..8924992 100644 --- a/qml/page/T_EventoEdit.qml +++ b/qml/page/T_EventoEdit.qml @@ -348,7 +348,7 @@ FluScrollablePage { width: 6 height: 30 radius: [3, 3, 3, 3] - color: ListView.isCurrentItem ? FluTheme.primaryColor.normal : + color: model.id == LocationModel.selected ? FluTheme.primaryColor.normal : FluColors.Grey110 anchors { @@ -434,6 +434,7 @@ FluScrollablePage { id: area height: 40 width: 180 + property bool checked: false FluRectangle { id: rect_division width: 6 @@ -446,15 +447,6 @@ FluScrollablePage { } } - Connections { - target: area - function onCheckedChanged() { - rect_division.color = rect_department.departmentIds.indexOf(model.id) < 0 ? - FluColors.Grey110 : - FluTheme.primaryColor.normal - } - } - FluText { anchors { left: rect_division.right @@ -467,7 +459,6 @@ FluScrollablePage { MouseArea { id: item_mouse - property bool checked: false anchors.fill: parent hoverEnabled: true onClicked: { @@ -476,13 +467,13 @@ FluScrollablePage { else rect_department.departmentIds.splice(rect_department.departmentIds.indexOf(model.id), 1) - checked = !checked - area.checkedChanged() + area.checked = !area.checked + rect_division.color = rect_department.departmentIds.indexOf(model.id) < 0 ? + FluColors.Grey110 : + FluTheme.primaryColor.normal } } - signal checkedChanged() - Rectangle { anchors.fill: parent radius: 8 diff --git a/src/controller/evento_service.cpp b/src/controller/evento_service.cpp index c5b7019..de262f4 100644 --- a/src/controller/evento_service.cpp +++ b/src/controller/evento_service.cpp @@ -232,6 +232,7 @@ void EventoService::load_History() { } void EventoService::load_Block(QDate date) { + CalendarController::getInstance(); date = getMonday(date); getRepo()->getEventListAfterTime(date).then([=](EventoResult> result) { if (!result) { diff --git a/src/controller/information_service.cpp b/src/controller/information_service.cpp index 6ec439c..64796cd 100644 --- a/src/controller/information_service.cpp +++ b/src/controller/information_service.cpp @@ -44,6 +44,7 @@ void InformationService::load_EditInfo() { } void InformationService::load_DepartmentInfo() { + DepartmentEventsController::getInstance(); getRepo()->getDepartmentListWithSubscriptionInfo().then( [this](EventoResult> result) { if (!result) { diff --git a/src/domain/model/type_model.cpp b/src/domain/model/type_model.cpp index 55ce867..a083307 100644 --- a/src/domain/model/type_model.cpp +++ b/src/domain/model/type_model.cpp @@ -52,7 +52,12 @@ QHash TypeModel::roleNames() const { } void TypeModel::resetModel(std::vector&& model) { - beginResetModel(); - m_data = std::move(model); - endResetModel(); + QMetaObject::invokeMethod( + this, + [&]() { + beginResetModel(); + m_data = std::move(model); + endResetModel(); + }, + Qt::BlockingQueuedConnection); }