Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED]Default Arguments in shared library
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Default Arguments in shared library

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dreamerindia
    wrote on last edited by
    #1

    dear all,

    Can we give default parameter in the shared library?

    we use to typedef the function from the library & in typdef we define return type and input argument type.

    so it will not accept if some argumnets are missing.

    for example:

    In library if i give like this,

    @NUMPADLIBRARYSHARED_EXPORT NumberPanel* getNumKBPanel(short int,QWidget*,double incRatio=1);@

    and in application i use it as,

    @ typedef QWidget* (pf2)(short int,QWidget);
    pf2 getNumKBPanel = (pf2)kbPanel->resolve("getNumKBPanel");
    QWidget *w = getNumKBPanel(pValue,this); @

    its working without default value 1.

    how to do that.

    suggestions are welcome.

    ~Ravivarman~

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rcari
      wrote on last edited by
      #2

      You can't. The signature of the function is @NumberPanel* (fn)(short int, QWidget*, double);@
      Your cast is dangerous, and will NOT work.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dreamerindia
        wrote on last edited by
        #3

        ok.one question about this forum.how you added your photo.i tried but can't find it where? :-)

        ~Ravivarman~

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dreamerindia
          wrote on last edited by
          #4

          instead of default argumements... i overloaded the function with required arguments....and its ok...

          ~Ravivarman~

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved