atrooney-online-2/src/aolineedit.cpp
Crystalwarrior c8e12558cd Clang-ify the code with this styling using Visual Studio Code:
{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Stroustrup, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All }
(this is the Visual Studio preset with only "BreakBeforeBraces" changed from Allman to Stroustrup)
2020-05-22 01:18:24 +03:00

21 lines
533 B
C++

#include "aolineedit.h"
AOLineEdit::AOLineEdit(QWidget *parent) : QLineEdit(parent)
{
}
void AOLineEdit::mouseDoubleClickEvent(QMouseEvent *e)
{
QLineEdit::mouseDoubleClickEvent(e);
double_clicked();
}
void AOLineEdit::focusOutEvent(QFocusEvent *ev)
{
int start = selectionStart();
int len = selectionEnd() - start; //We're not using selectionLength because Linux build doesn't run qt5.10
QLineEdit::focusOutEvent(ev);
if (p_selection && start != -1 && len != -1)
this->setSelection(start, len);
}