Hello,
I had to inherit the QLineEdit to have them to always show the start of the text instead of the end of the text if the text is longer than the space to show it.
Here the customized QLineEdit:
Qt Code:
  1. LineEdit::LineEdit(QWidget* parent)
  2. : QLineEdit(parent)
  3. {
  4. connect(this, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(CursorPositionChanged(int, int)));
  5. }
  6.  
  7. LineEdit::LineEdit(const QString& text, QWidget* parent)
  8. : QLineEdit(text, parent)
  9. {
  10. connect(this, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(CursorPositionChanged(int, int)));
  11. setCursorPosition(0);
  12. }
  13.  
  14. void LineEdit::focusOutEvent(QFocusEvent* e)
  15. {
  16. QLineEdit::focusOutEvent(e);
  17. setCursorPosition(0);
  18. }
  19.  
  20. void LineEdit::CursorPositionChanged(int oldPos, int newPos)
  21. {
  22. if (!hasFocus())
  23. setCursorPosition(0);
  24. }
To copy to clipboard, switch view to plain text mode 
I feel like this is a mode that should be part of Qt by default.
Maybe it's already possible and I missed this functionality?
Any thinking about it?
Thanks!