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. QLineEdit onEnter menu

QLineEdit onEnter menu

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.0k 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.
  • K Offline
    K Offline
    Kaluss
    wrote on last edited by
    #1

    Hi all,
    could anybody tell me how I can implement special behavior for QLineEdit?

    I need something like it is in Qt Creator in search filed - when You enter into this line on the right the "x" icon is shown which allows to delete all text from it or in "Open files explorer" the 'x' icon is shown which allows to close selected doc.

    Please give me some hints or links to information about this functionality.

    Best regards,
    Tomek

    M 1 Reply Last reply
    0
    • K Kaluss

      Hi all,
      could anybody tell me how I can implement special behavior for QLineEdit?

      I need something like it is in Qt Creator in search filed - when You enter into this line on the right the "x" icon is shown which allows to delete all text from it or in "Open files explorer" the 'x' icon is shown which allows to close selected doc.

      Please give me some hints or links to information about this functionality.

      Best regards,
      Tomek

      M Offline
      M Offline
      Mr. Kibu
      wrote on last edited by
      #2

      @Kaluss

      You can set clearButtonEnabled = true in the Qt-Designer for the lineedit.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Kaluss
        wrote on last edited by
        #3

        Thnaks, is something what Im looking for.

        But maybe do you know how to set something in QItemDelegate and add diffferent behavior?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mr. Kibu
          wrote on last edited by
          #4

          Sorry, not exactly. But see this example http://doc.qt.io/qt-5/qtwidgets-itemviews-spinboxdelegate-example.html

          I think you can use a lineedit instead of the spinbox and set lineedit->clearButtonEnabled(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