Unsolved QLineEdit onEnter menu
-
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 -
You can set clearButtonEnabled = true in the Qt-Designer for the lineedit.
-
Thnaks, is something what Im looking for.
But maybe do you know how to set something in QItemDelegate and add diffferent behavior?
-
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)