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. How can I simply customise one aspect of a button?
Forum Updated to NodeBB v4.3 + New Features

How can I simply customise one aspect of a button?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 260 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.
  • V Offline
    V Offline
    Vadi2
    wrote on last edited by Vadi2
    #1

    I like my TabButton to elide text in the middle - and nothing else - but QML is sending me on a wild trip that I don't want to be on. I don't want to reimplement the entire style of the button, partially because doing that isn't working - either the palette colours are missing, or Color.blend is unaccessible, and so on and so forth.

    How can I just ask it to elide text in the middle and not tweak anything else at all?

    J.HilkJ 1 Reply Last reply
    0
    • V Vadi2

      I like my TabButton to elide text in the middle - and nothing else - but QML is sending me on a wild trip that I don't want to be on. I don't want to reimplement the entire style of the button, partially because doing that isn't working - either the palette colours are missing, or Color.blend is unaccessible, and so on and so forth.

      How can I just ask it to elide text in the middle and not tweak anything else at all?

      J.HilkJ Online
      J.HilkJ Online
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @Vadi2
      AFAI See it, you have 2 options.

      Ether create your own contentItem:
      https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-button

      or pre elide the string using TextMetrics
      https://doc.qt.io/qt-5/qml-qtquick-textmetrics.html#elidedText-prop


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      4
      • V Offline
        V Offline
        Vadi2
        wrote on last edited by
        #3

        That works, thanks!

        1 Reply Last reply
        1

        • Login

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