Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2454

Default argument is not used for more complex types

    XMLWordPrintable

Details

    • 1fabac91e (dev), 66690e5c0 (6.5)

    Description

      If there is a function with default argument, it doesn't seem to be used if it is a bit more complex type. For example std::pair argument doesn't take the default argument in generated wrapper.

      To reproduce run attached example. It prints "got pair 0,0" for a call to set_pair(std::pair<int,int> = std::pair(123,123));. In icecream_wrapper.cpp it can be seen to not pass the default argument to cppArg0:

              ::std::pair<int,int> cppArg0;
              if (pythonToCpp[0])
                  pythonToCpp[0](pyArgs[0], &cppArg0);
      
              if (!Shiboken::Errors::occurred()) {
                  // set_pair(std::pair<int,int>)
                  cppSelf->set_pair(cppArg0);
              }
      

      but it works if the argument type is int.

      Attachments

        1. pyside2454_diag.diff
          5 kB
          Friedemann Kleint
        2. pyside2454_repro.diff
          1 kB
          Friedemann Kleint
        3. pyside2454.zip
          13 kB
          Joni Poikelin
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            poikelin Joni Poikelin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes