0

I am writing a small application that reflects designer form in qt. Here there is a problem in QLineEdit i.e. when i click on QLineEdit it sets into editable mode. But i want to select the QLineEdit as it is been selected in designer form.enter image description here

As in image the QLineEdit should be selected. Should we need to create a pixmap of QLineEdit and put in a QLabel or is there any easier way to get around.

AAEM
  • 1,837
  • 2
  • 18
  • 26
anbu selvan
  • 725
  • 3
  • 13
  • 41

1 Answers1

0

You're trying to reimplement Designer functionality - the basic Qt Widgets code doesn't implement this. You can certainly reuse Designer, it's embeddable so if you're designing a form editor, just use Designer as a plug-in/module in your application.

If you wish to reimplement it, you can't merely draw on the line edit widget itself, as it would clip the painting to its own outline. You can have an overlay widget, slightly larger than the line edit, transparent to mouse events, that tracks the line edit's position and displays the handles.

I'd be helpful if you let us know what you're trying to achieve beyond just drawing some handles. Presumably those handles would be useful for something? What's that?

Community
  • 1
  • 1
Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313