mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[Move refactor] Reparent orphan classes (#6236)
* Move orphaned classes to their correct parent folders. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
1ef07309d6
commit
d9c65d4ae0
143 changed files with 171 additions and 169 deletions
52
cockatrice/src/interface/widgets/utility/custom_line_edit.h
Normal file
52
cockatrice/src/interface/widgets/utility/custom_line_edit.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/**
|
||||
* @file custom_line_edit.h
|
||||
* @ingroup UI
|
||||
* @brief TODO: Document this.
|
||||
*/
|
||||
|
||||
#ifndef CUSTOMLINEEDIT_H
|
||||
#define CUSTOMLINEEDIT_H
|
||||
|
||||
#include <QLineEdit>
|
||||
|
||||
class QTreeView;
|
||||
class QKeyEvent;
|
||||
class QWidget;
|
||||
class QString;
|
||||
|
||||
// Should be used when the there is a risk of conflict between line editor
|
||||
// shortcuts and other shortcuts
|
||||
class LineEditUnfocusable : public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LineEditUnfocusable(QWidget *parent = nullptr);
|
||||
explicit LineEditUnfocusable(const QString &contents, QWidget *parent = nullptr);
|
||||
|
||||
private:
|
||||
static bool isUnfocusShortcut(QKeyEvent *key);
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
};
|
||||
|
||||
class SearchLineEdit : public LineEditUnfocusable
|
||||
{
|
||||
private:
|
||||
QTreeView *treeView;
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
public:
|
||||
SearchLineEdit() : treeView(nullptr)
|
||||
{
|
||||
}
|
||||
void setTreeView(QTreeView *_treeView)
|
||||
{
|
||||
treeView = _treeView;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue