atrooney-online-2/include/aolineedit.h
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

27 lines
454 B
C++

#ifndef AOLINEEDIT_H
#define AOLINEEDIT_H
#include <QLineEdit>
#include <QMouseEvent>
class AOLineEdit : public QLineEdit {
Q_OBJECT
public:
AOLineEdit(QWidget *parent);
void preserve_selection(bool toggle) { p_selection = toggle; }
private:
bool p_selection = false;
protected:
void mouseDoubleClickEvent(QMouseEvent *e);
void focusOutEvent(QFocusEvent *ev);
signals:
void double_clicked();
};
#endif // AOLINEEDIT_H