Heart 1.3.848.aa44c26
Heart is base back end library for your c++ Qt projects.
softdelete.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2025 QuasarApp.
3 * Distributed under the lgplv3 software license, see the accompanying
4 * Everyone is permitted to copy and distribute verbatim copies
5 * of this license document, but changing it is not allowed.
6*/
7
8#include "softdelete.h"
9#include <quasarapp.h>
10
12
14
15 if (!fSoftDelete) {
16
17 qCritical() << "You delete %0 without preparing. " << typeid (this).name() <<
18 "The object was deleted without preparing. All changes can not be saved. "
19 "For fix it trouble use the softDelete method.";
20
21#ifdef QT_DEBUG
22 std::abort();
23#endif
24
25 }
26}
27
29 fSoftDelete = true;
30 prepareForDelete();
31 delete this;
32}
33
void softDelete()
softDelete This method remove this object and save all changes into database.
virtual ~SoftDelete()
~SoftDelete This destructor has bin crashed if the softDelete method not will be invoked before delet...