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

qml tool console behavior

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.2.0
    • Quick: Other
    • None

    Description

      On OSX or Linux, one can open several QML files at the same time with one instance of qml.app, either from Finder or from the terminal. So it would be possible to write several QML "desktop accessories" and launch them in one's login session, for example.

      However on Windows if you set up qml.exe as the "open with" handler for .qml files, then select several QML files in explorer and open them, it will launch multiple instances of qml.exe. Furthermore each of them has its own console window.

      It's always a problem on Windows to see the console output: either it's completely hidden, even when you run from the DOS terminal, or else it launches its own window which is in the way (and only if you remember to add CONFIG+=console, which has that effect only on Windows). The best alternative I can imagine right now is if there was a context menu on the taskbar entry for the qml process to request a log window (to which all the output from qDebug, console.log, qWarning etc. goes). It could then be a nice graphical window with search features instead of something that looks like a DOS window. Then we would want to figure out how to get this optionally on other platforms too: if you run qml from a terminal, it's nice to see the console output inline in the terminal, but if you run it from your desktop shell, it's nice to have the optional console log window. For command-line usage there could be another option to request the console log window instead of inline output.

      But that could be done in Qt in general, and could have features to filter the new categorized logging output. But in a QML application it makes sense to use QML for the log window (based on Qt Quick Controls), whereas for widget apps it makes sense to use widgets. So the easy fix is to just add this feature to the qml tool, but it would make sense to have more reusable functionality which does the right thing depending on whether you have a QApplication or a QGuiApplication, similar to how QtQuick.Dialogs makes this kind of choice.

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes