Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
Loading...
Searching...
No Matches
custom_line_edit.h
Go to the documentation of this file.
1
6
7
#ifndef CUSTOMLINEEDIT_H
8
#define CUSTOMLINEEDIT_H
9
10
#include <QLineEdit>
11
#include <qtmetamacros.h>
12
13
class
QTreeView;
14
class
QKeyEvent;
15
class
QWidget;
16
class
QString;
17
18
// Should be used when the there is a risk of conflict between line editor
19
// shortcuts and other shortcuts
20
class
LineEditUnfocusable
:
public
QLineEdit
21
{
22
Q_OBJECT
23
public
:
24
explicit
LineEditUnfocusable
(QWidget *parent =
nullptr
);
25
explicit
LineEditUnfocusable
(
const
QString &contents, QWidget *parent =
nullptr
);
26
27
private
:
28
static
bool
isUnfocusShortcut
(QKeyEvent *key);
29
30
protected
:
31
void
keyPressEvent
(QKeyEvent *event)
override
;
32
bool
eventFilter
(QObject *watched, QEvent *event)
override
;
33
};
34
35
class
SearchLineEdit
:
public
LineEditUnfocusable
36
{
37
private
:
38
QTreeView *
treeView
;
39
40
protected
:
41
void
keyPressEvent
(QKeyEvent *event)
override
;
42
43
public
:
44
SearchLineEdit
() :
treeView
(nullptr)
45
{
46
}
47
void
setTreeView
(QTreeView *_treeView)
48
{
49
treeView
= _treeView;
50
}
51
};
52
53
#endif
LineEditUnfocusable::isUnfocusShortcut
static bool isUnfocusShortcut(QKeyEvent *key)
Definition
custom_line_edit.cpp:28
LineEditUnfocusable::keyPressEvent
void keyPressEvent(QKeyEvent *event) override
Definition
custom_line_edit.cpp:59
LineEditUnfocusable::eventFilter
bool eventFilter(QObject *watched, QEvent *event) override
Definition
custom_line_edit.cpp:70
LineEditUnfocusable::LineEditUnfocusable
LineEditUnfocusable(QWidget *parent=nullptr)
Definition
custom_line_edit.cpp:18
SearchLineEdit::keyPressEvent
void keyPressEvent(QKeyEvent *event) override
Definition
custom_line_edit.cpp:85
SearchLineEdit::SearchLineEdit
SearchLineEdit()
Definition
custom_line_edit.h:44
SearchLineEdit::setTreeView
void setTreeView(QTreeView *_treeView)
Definition
custom_line_edit.h:47
SearchLineEdit::treeView
QTreeView * treeView
Definition
custom_line_edit.h:38
cockatrice
src
interface
widgets
utility
custom_line_edit.h
Generated by
1.18.0