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. buddy function like with QLabel
Forum Updated to NodeBB v4.3 + New Features

buddy function like with QLabel

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 143 Views
  • 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.
  • S Offline
    S Offline
    sandro4912
    wrote on last edited by sandro4912
    #1

    In Qt Widgets wie can assign buddies to QLabel like this:

    QLineEdit *nameEdit  = new QLineEdit(this);
    QLabel    *nameLabel = new QLabel("&Name:", this);
    nameLabel->setBuddy(nameEdit);
    

    I could not find this in qml. Is there a way to achieve it?

    For Example in QML I used a Text for the QLabel and a TextField to replace QLineEdit like this:

    RowLayout {
        Text {
            text: qsTr("Question:")
        }
        TextField {
            id: questionTextField
            Layout.fillWidth: true
            selectByMouse: true
        }
    }
    
    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