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

Ability to pass arguments to the main() C++ function

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.3.0 Beta1
    • 5.1.0
    • QPA
    • None
    • Android, Qt5.1

    • Android
    • 1f695a31e2e3df1782e2ee5565ff9e7bfd8dd9ae

      There is currently no way to pass arguments to the main() C++ function. It used to be possible in Necessitas based on Qt 4.8.

      Assuming that it's not a good practise to change the code of QtActivity, it would be good if a subclass of QtActivity could set arguments and QtActivity forward them to the C++ side when starting the app.
      QtActivity has a static final constant APPLICATION_PARAMETERS that is not usable either.

      Example use case: the app gets a filename via an Activity Intent and need to send it to the main() C++ function.

      Suggestion: Remove APPLICATION_PARAMETERS. Create an instance variable in QtActivity (applicationParameters with setter and getter) and use this variable in startApp() and onServiceConnected() to pass the arguments via the bundle parameters with key APPLICATION_PARAMETERS_KEY.

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

            taipan BogDan Vatra
            lasconic Lasconic
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes