MuseScore  3.4
Music composition and notation
searchbox.h
Go to the documentation of this file.
1 //=============================================================================
2 // SearchBox
3 //
4 // Copyright (C) 2018 Peter Jonas
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License version 2
8 // as published by the Free Software Foundation and appearing in
9 // the file LICENCE.GPL
10 //=============================================================================
11 
12 #ifndef __SEARCHBOX_H__
13 #define __SEARCHBOX_H__
14 
15 namespace Ms {
16 
17 class FilterableView;
18 
19 //---------------------------------------------------------
20 // SearchBox
21 // Extends QLineEdit to provide methods to search an item view.
22 //---------------------------------------------------------
23 
24 class SearchBox : public QLineEdit
25  {
26  Q_OBJECT
27 
28  FilterableView* _view = nullptr;
29 
30  protected:
31  virtual void keyPressEvent(QKeyEvent* event) override;
32 
33  public:
34  SearchBox(QWidget* parent = nullptr);
36  void search(const QString& str);
37  };
38 
39 }
40 
41 #endif // __SEARCHBOX_H__
FilterableView * _view
Definition: searchbox.h:28
virtual void keyPressEvent(QKeyEvent *event) override
Definition: searchbox.cpp:53
SearchBox(QWidget *parent=nullptr)
Definition: searchbox.cpp:21
Definition: aeolus.cpp:26
void setFilterableView(FilterableView *view)
Definition: searchbox.cpp:43
Definition: searchbox.h:24
void search(const QString &str)
Definition: searchbox.cpp:32
Definition: filterableview.h:24