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. Recommendation on editing Label Content by mouse click
Forum Updated to NodeBB v4.3 + New Features

Recommendation on editing Label Content by mouse click

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 311 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.
  • T Offline
    T Offline
    TonyM
    wrote on last edited by
    #1

    Hi,
    I am experimenting with the example code. I would like to edit the content of the Valuecharecteristics.jpg which corresponds to

    Label {
                    id: characteristicValue
                    font.pointSize: characteristicName.font.pointSize*0.7
                    textContent: ("Value: " + modelData.characteristicValue)
                    anchors.bottom: characteristicHandle.top
                    horizontalAlignment: Text.AlignHCenter
                    anchors.topMargin: 5
                }
    

    section of file . Ideally, I would like to click on the value and edit the content.

    I have tried using TextInput. But it does not look good. The window appears in elsewhere and is not quite obvious. Is there any other QML types which are better suited for the purpose? I am quite new to Qt and if you could point me to any links or better QML type, that would be very helpful.
    Many Thanks,
    Tony

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sonicss
      wrote on last edited by
      #2

      I think if you want to edit the value of Label, I suggest u use TextInput or TextField. So u can use virtual keyboard to input values.

      you can customizing the TextInput or TextField if u don't like the apperance of the component

      https://doc.qt.io/archives/qt-5.11/qtquickcontrols2-customize.html#customizing-button

      Or there is another way: Write a customed virtual keyboard. And listen the component which is focused. get the class name of the focused component, if the class equal which you want to input, pop up your customed virtual keyboard.

      1 Reply Last reply
      3
      • T Offline
        T Offline
        TonyM
        wrote on last edited by
        #3

        Sorry, for some reason I did not get notification on replies in this thread. Thank you @sonicss

        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