Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Alias method in QML component
Forum Updated to NodeBB v4.3 + New Features

Alias method in QML component

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlcomponentaliasmethod
2 Posts 2 Posters 2.9k 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.
  • P Offline
    P Offline
    Phrogz
    wrote on 20 Apr 2016, 15:16 last edited by Phrogz
    #1

    I am writing a component like so:

    import QtQuick 2.0
    import NDDQuickItem 1.0
    
    Item {
      property alias source: ndd.nddContentPath
    
      function goToSlide(component,slide){ ndd.goToSlide(component,slide) }
    
      NDDQuickItem {
        id: ndd
        width:parent.width; height:parent.height
      }
    }
    

    I can use property alias to "promote" properties of the NDDQuickItem to the root of the component. However, as shown, I'm currently writing global methods that just re-call a method on the NDDQuickItem.

    Is there an equivalent to property alias that works for methods? Something like:

    method alias goToSlide: ndd.goToSlide # not valid QML
    

    or

    goToSlide = ndd.goToSlide             # not valid QML
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 20 Apr 2016, 21:57 last edited by
      #2

      Hi,

      AFAIK, there's no such feature. You can check the bug report system to see if there's already something about it.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      1/2

      20 Apr 2016, 15:16

      • Login

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