mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-11-20 17:11:57 +00:00
26 lines
509 B
C++
26 lines
509 B
C++
#include "FocusLineEdit.h"
|
|
#include <QDebug>
|
|
|
|
FocusLineEdit::FocusLineEdit(QWidget *parent) : QLineEdit(parent)
|
|
{
|
|
_selectOnMousePress = false;
|
|
}
|
|
|
|
void FocusLineEdit::focusInEvent(QFocusEvent *e)
|
|
{
|
|
QLineEdit::focusInEvent(e);
|
|
selectAll();
|
|
_selectOnMousePress = true;
|
|
}
|
|
|
|
void FocusLineEdit::mousePressEvent(QMouseEvent *me)
|
|
{
|
|
QLineEdit::mousePressEvent(me);
|
|
if (_selectOnMousePress)
|
|
{
|
|
selectAll();
|
|
_selectOnMousePress = false;
|
|
}
|
|
qDebug() << selectedText();
|
|
}
|