-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.0 Alpha
-
None
-
Mageia Linux Cauldron x86_64, gcc 5.2.1
-
6ae2bfad41 (qt/qtbase/dev) 6ae2bfad41 (qt/tqtc-qtbase/dev) 28390ce4aa (qt/qtbase/6.4) 28390ce4aa (qt/tqtc-qtbase/6.4) 49de278cd2 (qt/qtbase/6.3) 49de278cd2 (qt/tqtc-qtbase/6.3) 062423a7a1 (qt/tqtc-qtbase/5.15) c5c7daf67a (qt/tqtc-qtbase/6.2)
+underlined text+In the documentation example I see the usage of previous filter. I think, it is meant to use in the following way:
oldCategoryFilter = QLoggingCategory::installFilter(myCategoryFilter);
This code leads to crash, as QLoggingCategory::installFilter() call myCategoryFilter() when oldCategoriFilter is not valid yet.
The workaround is to use this code:
oldCategoryFilter = QLoggingCategory::installFilter(Q_NULLPTR); QLoggingCategory::installFilter(myCategoryFilter);
This is not obvious and looks like a hack, so I think it is either a bug, or should be pointed in documentation.
For Gerrit Dashboard: QTBUG-49704 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
142612,1 | Add QLoggingCategory::filter() accessor | 5.6 | qt/qtbase | Status: ABANDONED | 0 | 0 |
142613,5 | Add QLoggingCategory::filter() accessor | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
414085,10 | Fix doc and example of QLoggingCategory::installCategory() | dev | qt/qtbase | Status: MERGED | +2 | 0 |
416028,2 | Fix doc and example of QLoggingCategory::installCategory() | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |
416029,3 | Fix doc and example of QLoggingCategory::installCategory() | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |
416030,3 | Fix doc and example of QLoggingCategory::installCategory() | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
416031,3 | Fix doc and example of QLoggingCategory::installCategory() | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |