Sayonara Player
Signals | Public Member Functions | Protected Member Functions | List of all members
Library::SearchBar Class Reference

The searchbar has a special context menu which allows to select the search mode. A special search mode is the invalid genre mode set by set_invalid_genre_mode, which actually is an empty string. But this wouldn't make any sense. More...

#include <Searchbar.h>

Inheritance diagram for Library::SearchBar:
Gui::WidgetTemplate< QLineEdit > Gui::WidgetTemplateParent

Signals

void sigCurrentModeChanged ()
 
void sigTextChanged (const QString &text)
 

Public Member Functions

 SearchBar (QWidget *parent=nullptr)
 
void setInvalidGenreMode (bool b)
 this method does not set the genre mode implicitly. You also have to use set_mode(). The invalid genre mode searchs for an empty genre. This is used to fetch tracks which do not have a genre.
 
bool hasInvalidGenreMode () const
 if the current state is the invalid genre mode
 
void setModes (const QList< Filter::Mode > &modes)
 Sets the supported modes. See Library::Filter::Mode.
 
QList< Filter::Mode > modes () const
 returns supported modes. See Library::Filter::Mode
 
void setCurrentMode (Filter::Mode mode)
 If mode is Filter::Mode::Genre but the genre should be empty, also use set_invalid_genre_mode()
 
void setPreviousMode ()
 fast toggling between modes by using arrow up key
 
void setNextMode ()
 fast toggling between modes by using arrow down key
 
Filter::Mode currentMode () const
 current selected mode
 
void reset ()
 Clears the input and sets mode back to Fulltext search.
 
virtual void showEvent (QShowEvent *e) override
 

Protected Member Functions

void keyPressEvent (QKeyEvent *e) override
 
void languageChanged () override
 
void skinChanged () override
 

Detailed Description

The searchbar has a special context menu which allows to select the search mode. A special search mode is the invalid genre mode set by set_invalid_genre_mode, which actually is an empty string. But this wouldn't make any sense.