Bug 477871 - Program crash when entering a personsname into shown frame.
Summary: Program crash when entering a personsname into shown frame.
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Engine (show other bugs)
Version: 8.3.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-01 21:36 UTC by kik01
Modified: 2023-12-03 11:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.3.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kik01 2023-12-01 21:36:10 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
works fine until digiKam-8.2.0-20231120T151458
Comment 1 Maik Qualmann 2023-12-01 22:33:38 UTC
Git commit e0e44234d790026b3fce5a904133d323bfc65777 by Maik Qualmann.
Committed on 01/12/2023 at 23:32.
Pushed by mqualmann into branch 'master'.

fix missing begin/end model reset, Qt6 requires it
FIXED-IN: 8.3.0

M  +2    -2    NEWS
M  +3    -0    core/libs/tags/engine/tagscompleter.cpp

https://invent.kde.org/graphics/digikam/-/commit/e0e44234d790026b3fce5a904133d323bfc65777
Comment 2 Maik Qualmann 2023-12-01 22:35:14 UTC
There is another crash here when exiting the preview/scene, deep in Qt6. I'll take a look at that tomorrow.

Maik
Comment 3 caulier.gilles 2023-12-02 04:12:09 UTC
Maik,

The code do not compile under Qt6.5.3 here:

[ 36%] Building CXX object core/libs/models/CMakeFiles/gui_digikammodels_obj.dir/itemalbummodel.cpp.o
/home/gilles/Devel/Devel/8.x/core/libs/tags/engine/tagscompleter.cpp: In member function ‘void Digikam::TagCompleter::update(const QString&)’:
/home/gilles/Devel/Devel/8.x/core/libs/tags/engine/tagscompleter.cpp:145:30: error: ‘void QAbstractItemModel::beginResetModel()’ is protected within this context
  145 |     d->model->beginResetModel();
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /opt/qt6/include/QtWidgets/qcompleter.h:11,
                 from /opt/qt6/include/QtWidgets/QCompleter:1,
                 from /home/gilles/Devel/Devel/8.x/core/libs/tags/engine/tagscompleter.h:20,
                 from /home/gilles/Devel/Devel/8.x/core/libs/tags/engine/tagscompleter.cpp:20:
/opt/qt6/include/QtCore/qabstractitemmodel.h:392:10: note: declared protected here
  392 |     void beginResetModel();
      |          ^~~~~~~~~~~~~~~
/home/gilles/Devel/Devel/8.x/core/libs/tags/engine/tagscompleter.cpp:202:28: error: ‘void QAbstractItemModel::endResetModel()’ is protected within this context
  202 |     d->model->endResetModel();
      |     ~~~~~~~~~~~~~~~~~~~~~~~^~
/opt/qt6/include/QtCore/qabstractitemmodel.h:393:10: note: declared protected here
  393 |     void endResetModel();
      |          ^~~~~~~~~~~~~
make[2]: *** [core/libs/tags/CMakeFiles/gui_digikamtags_obj.dir/build.make:188: core/libs/tags/CMakeFiles/gui_digikamtags_obj.dir/engine/tagscompleter.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:9488: core/libs/tags/CMakeFiles/gui_digikamtags_obj.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 36%] Building CXX object core/utilities/imageeditor/CMakeFiles/gui_imageeditorgui_obj.dir/main/imagewindow_setup.cpp.o
[ 36%] Built target gui_lighttable_obj
[ 36%] Building CXX object core/utilities/imageeditor/CMakeFiles/gui_imageeditorgui_obj.dir/main/imagewindow_config.cpp.o
[ 36%] Building CXX object core/libs/models/CMakeFiles/gui_digikammodels_obj.dir/itemalbumfiltermodel.cpp.o
[ 36%] Built target gui_digikammodels_obj
[ 36%] Building CXX object core/utilities/imageeditor/CMakeFiles/gui_imageeditorgui_obj.dir/main/imagewindow_import.cpp.o
[ 36%] Built target gui_imageeditorgui_obj
make: *** [Makefile:146: all] Error 2

Gilles
Comment 4 Maik Qualmann 2023-12-02 06:57:36 UTC
Git commit 0499a54ac935c30c710c2aff1e92289f27792edb by Maik Qualmann.
Committed on 02/12/2023 at 07:56.
Pushed by mqualmann into branch 'master'.

revert model reset

M  +0    -14   core/libs/tags/engine/tagscompleter.cpp

https://invent.kde.org/graphics/digikam/-/commit/0499a54ac935c30c710c2aff1e92289f27792edb
Comment 5 Maik Qualmann 2023-12-02 06:59:20 UTC
Yes, I'm also surprised that it's compiled here, since the functions are protected. But it's the cause, I'm looking for another solution, could also be a bug in Qt6.

Maik
Comment 6 Maik Qualmann 2023-12-02 07:26:00 UTC
My build folder wasn't clean, so it seemed to compile.

Maik
Comment 7 caulier.gilles 2023-12-02 08:02:41 UTC
Hi Maik,

Look in source code, beginResetModel() and endResetModel() is only called in derived classes from QModel*

Gilles
Comment 8 Maik Qualmann 2023-12-02 22:17:28 UTC
Git commit 83b05dfd1bbcf582e30118f804539cee3faf3e8b by Maik Qualmann.
Committed on 02/12/2023 at 23:16.
Pushed by mqualmann into branch 'master'.

fix crash in the TagCompleter when model changes
In Qt6, the QCompleter::setModel() function uses the move constructor.
That's really not nice, as it causes us to lose our QStandardItemModel.
This clearly shows the problem of the move constructor.
This should definitely be communicated in the Qt doc.

M  +5    -9    core/libs/tags/engine/tagscompleter.cpp

https://invent.kde.org/graphics/digikam/-/commit/83b05dfd1bbcf582e30118f804539cee3faf3e8b
Comment 9 Maik Qualmann 2023-12-03 11:33:02 UTC
Git commit 1009320c87bbd465a9794aaf175176e0f3741b79 by Maik Qualmann.
Committed on 03/12/2023 at 12:32.
Pushed by mqualmann into branch 'master'.

we need different code for Qt5/6

M  +44   -2    core/libs/tags/engine/tagscompleter.cpp

https://invent.kde.org/graphics/digikam/-/commit/1009320c87bbd465a9794aaf175176e0f3741b79