Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-82154

LoggingCategory documentation encourages the use of a singleton without explaining how

    XMLWordPrintable

Details

    Description

      https://doc.qt.io/qt-5/qml-qtqml-loggingcategory.html says:

      Note: As the creation of objects is expensive, it is encouraged to put the needed LoggingCategory definitions into a singleton and import this where needed.

      New users might have no idea how to do this. We should have an example that demonstrates how such a singleton would look. For example:

      pragma Singleton
      
      import QtQml 2.12
      
      QtObject {
          property LoggingCategory dialogs: LoggingCategory {
              name: "app.ui.dialogs"
          }
          
          property LoggingCategory settings: LoggingCategory {
              name: "app.settings"
          }
      }
      

      and then link to the documentation that describes how the qmldir should look, etc.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            veshivas Venugopal Shivashankar
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes