MantisBT - Doomseeker
View Issue Details
0003897Doomseeker[All Projects] Cleanuppublic2021-08-08 22:022021-12-14 09:03
Blzut3 
Blzut3 
noneminorhave not tried
needs testingsuspended 
1.3.2 
1.3.3 
0003897: QDirModel cannot be used to build with Qt 6 (needs to be replaced with QFileSystemModel)
QDirModel is marked obsolete in Qt 5 and removed in Qt 6. QFileSystemModel was introduced in Qt 4.4 as its replacement.
No tags attached.
child of 0003895needs testing Blzut3 Add support for Qt 6.2+ 
Issue History
2021-08-08 22:02Blzut3New Issue
2021-08-08 22:02Blzut3Relationship addedchild of 0003895
2021-08-09 20:48Blzut3Assigned To => Blzut3
2021-08-09 20:48Blzut3Statusnew => assigned
2021-08-10 17:49Blzut3Note Added: 0021719
2021-08-11 04:09WubTheCaptainStatusassigned => resolved
2021-08-11 04:09WubTheCaptainResolutionopen => suspended
2021-08-16 18:51WubTheCaptainProduct Version1.3.3 => 1.3.2
2021-08-16 18:51WubTheCaptainSummaryReplace use of QDirModel with QFileSystemModel => QDirModel cannot be used to build with Qt6 (needs to be replaced with QFileSystemModel)
2021-08-16 19:37WubTheCaptainPrioritynormal => none
2021-08-16 19:37WubTheCaptainStatusresolved => assigned
2021-08-16 19:42WubTheCaptainSummaryQDirModel cannot be used to build with Qt6 (needs to be replaced with QFileSystemModel) => QDirModel cannot be used to build with Qt 6 (needs to be replaced with QFileSystemModel)
2021-12-09 02:53WubTheCaptainNote Added: 0021865
2021-12-14 09:03Blzut3Note Added: 0021896
2021-12-14 09:03Blzut3Statusassigned => needs testing

Notes
(0021719)
Blzut3   
2021-08-10 17:49   
Made a temporary version of this for Qt 6 effort:'https://bitbucket.org/Doomseeker/doomseeker/commits/849f63742459c141edd9f91521e57062f9dfabe9 [^]'

It seems like despite Qt claiming its a full replacement, the interaction between QCompleter and QFileSystemModel isn't great. Although I haven't done an exhaustive search it seems that other people are having the same issue, for example Kitware is seeing this with CMake's GUI:'https://gitlab.kitware.com/cmake/cmake/-/issues/21609 [^]'

Specifically the issue is that even when set up seemingly correctly, suggestions are only given if you start from the root directory. Modifying what's already there doesn't work.

We can sit on this issue for awhile longer, so may be worth waiting to see how the problem gets solved by others.
(0021865)
WubTheCaptain   
2021-12-09 02:53   
/home/wub/.local/src/doomseeker/doomseeker/src/core/gui/configuration/cfgwadseekergeneral.cpp: In 
member function ‘void CFGWadseekerGeneral::activateCompleter()’:
/home/wub/.local/src/doomseeker/doomseeker/src/core/gui/configuration/cfgwadseekergeneral.cpp:88:81: 
warning: ‘QDirModel::QDirModel(QObject*)’ is deprecated: Use QFileSystemModel [-Wdeprecated-declarations]
   
88 |                 d->cbTargetDirectory->setCompleter(new QCompleter(new QDirModel()));
      |                                                                                 ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QDirModel:1,
                 from /home/wub/.local/src/doomseeker/doomseeker/src/core/gui/configuration/cfgwadseekergeneral.cpp:33:

/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qdirmodel.h:73:67: note: declared here
   73 |     QT_DEPRECATED_VERSION_X_5_15("Use QFileSystemModel") explicit QDirModel(QObject 
*parent = nullptr);
      |                                                                   ^~~~~~~~~
/home/wub/.local/src/doomseeker/doomseeker/src/core/gui/freedoomdialog.cpp: In member function ‘void 
FreedoomDialog::setupInstallPaths()’:
/home/wub/.local/src/doomseeker/doomseeker/src/core/gui/freedoomdialog.cpp:241:52: warning: ‘QDirModel::QDirModel(QObject*)’ 
is deprecated: Use QFileSystemModel [-Wdeprecated-declarations]
  241 |         completer->setModel(new QDirModel(completer));
      |                                                    ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QDirModel:1,
                 from /home/wub/.local/src/doomseeker/doomseeker/src/core/gui/freedoomdialog.cpp:36:

/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qdirmodel.h:73:67: note: declared here
   73 |     QT_DEPRECATED_VERSION_X_5_15("Use QFileSystemModel") explicit QDirModel(QObject 
*parent = nullptr);
      |                                                                   ^~~~~~~~~
(0021896)
Blzut3   
2021-12-14 09:03   
Poked at this again and although I thought I tried this already, this change seems to resolve most of the problem with QFileSystemModel:'https://bitbucket.org/Doomseeker/doomseeker/commits/60730df5e5b3f670804d1628c3cabd192b13726e [^]'

Due to a known issue with QFileSystemModel in most versions of Qt 5 (and Qt 4), I'm not really comfortable with using the code path on Qt 5 even with the deprecation warning. Perhaps it wouldn't be unreasonable to relax the check to include using QFileSystemModel if you compile against 5.15 which should be fine, but testing should be done on all three operating systems.