Results 1 to 3 of 3

Thread: QML function with optional parameters?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QML function with optional parameters?

    I think JavaScript lacks the notion of a default value for function arguments, but you can probably do something like this

    Qt Code:
    1. setAlert(header, small, (typeof closeable !== 'undefined' ? closeable : true));
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    ricardodovalle (14th August 2014)

Similar Threads

  1. Call JavaScript function with parameters from Qt C++
    By qt_developer in forum Qt Programming
    Replies: 5
    Last Post: 13th January 2015, 00:31
  2. Replies: 4
    Last Post: 22nd January 2014, 01:25
  3. Replies: 4
    Last Post: 20th January 2011, 01:03
  4. QScript + get function call parameters
    By Fastman in forum Qt Programming
    Replies: 3
    Last Post: 1st August 2009, 15:30
  5. Wrong function according to parameters is taken
    By Lykurg in forum General Programming
    Replies: 5
    Last Post: 20th March 2009, 19:55

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.