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

QCoreApplication::arguments() falsely triggers Q_ASSERT on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.3.1
    • Core: Other
    • None

    Description

      On Windows, QCoreApplication::arguments() calls ::GetCommandLine(), parses it into QStringList and compares the result size with argc passed to QCoreApplication constructor via Q_ASSERT.

      However, there are valid cases when these values differ. One of them is ActiveQt-based server, which WinMain implementation strips argc/argv of ActiveX-related parameters, or doesn't even compose argc/argv at all when called with some parameters, using fake empties.

      It's pretty annoying to run a Debug build of such an application that uses the command line for its own purposes (e.g. when it is run normally, not as an ActiveX server or tool).

      Another case is a QtWinMigrate-based application, which exhibits the same behavior.

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              blagodarin Sergei Blagodarin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes