LineEdit
::LineEdit(QWidget* parent
){
connect(this, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(CursorPositionChanged(int, int)));
}
LineEdit
::LineEdit(const QString
& text,
QWidget* parent
){
connect(this, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(CursorPositionChanged(int, int)));
setCursorPosition(0);
}
{
setCursorPosition(0);
}
void LineEdit::CursorPositionChanged(int oldPos, int newPos)
{
if (!hasFocus())
setCursorPosition(0);
}
LineEdit::LineEdit(QWidget* parent)
: QLineEdit(parent)
{
connect(this, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(CursorPositionChanged(int, int)));
}
LineEdit::LineEdit(const QString& text, QWidget* parent)
: QLineEdit(text, parent)
{
connect(this, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(CursorPositionChanged(int, int)));
setCursorPosition(0);
}
void LineEdit::focusOutEvent(QFocusEvent* e)
{
QLineEdit::focusOutEvent(e);
setCursorPosition(0);
}
void LineEdit::CursorPositionChanged(int oldPos, int newPos)
{
if (!hasFocus())
setCursorPosition(0);
}
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.
Bookmarks