Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved QLineEdit onEnter menu

    General and Desktop
    2
    4
    818
    Loading More Posts
    • 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
      Kaluss last edited by

      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 Reply Quote 0
      • M
        Mr. Kibu @Kaluss last edited by

        @Kaluss

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

        1 Reply Last reply Reply Quote 0
        • K
          Kaluss last edited by

          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 Reply Quote 0
          • M
            Mr. Kibu last edited by

            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 Reply Quote 0
            • First post
              Last post