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. sending signal from inline Component?
Forum Updated to NodeBB v4.3 + New Features

sending signal from inline Component?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 3 Posters 284 Views 2 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Hi all -

    I'm trying to code a reusable TextField. This will include an explicit signal. How is this done?

    Component {
        Flickable {
            Connections {
                target: passwordField // not seen
                function onTextFieldClicked(yValue, itemHeight) {...}
            }
            Loader {
                sourceComponent: passwordFieldComponent
            }
            Component {
                id: passwordFieldComponent
                TextField {
                    id: passwordField
                    signal textFieldClicked(int yValue, int itemHeight)
                    onActiveFocusChanged: {
                        if (activeFocus) {
                            textFieldClicked(y, height)
                            ...
    

    I've tried moving the signal definition around, but that doesn't seem to help. Any ideas? Thanks...

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Confused with question. Can you add more details or sample program ? This will help to answer the same.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #3

        I want to know how to identify (connect to) a signal that is in an inline Component.

        I ended up removing the signal, and using a different path to accomplish the same thing. It didn't answer the question, but it got me past my problem.

        Thanks for looking.

        1 Reply Last reply
        0
        • mzimmersM mzimmers has marked this topic as solved on
        • A Offline
          A Offline
          afalsa
          wrote on last edited by
          #4

          Although you used a different solution, I think doing the following should work:

                  Connections {
                      target: myLoader.item
                      function onTextFieldClicked(yValue, itemHeight) {...}
                  }
          
          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