Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. make Labels on QLineEdit, with the text split by space or comma.
QtWS25 Last Chance

make Labels on QLineEdit, with the text split by space or comma.

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 412 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.
  • O Offline
    O Offline
    opengpu
    wrote on last edited by
    #1

    i want to split the text of QLineEdit, this is easy.
    then i want to make the QStringList show on Labels on QLineEdit, which is easy for user to clear a single Label. While edit QLineEdit, the Labels are hidden and original text is show in QLineEdit.

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      And what's the exact problem? Does QLabel::setText() not work for you?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        Subclass QLineEdit and implement your own painting when not editing. You should be able to draw labels using QPainter. You'll also need to reimplement mouse release event to handle removing the labels (if you need that functionality).

        (Z(:^

        1 Reply Last reply
        4

        • Login

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