Sayonara Player
Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
Gui::LineInputDialog Class Reference

Dialog for entering one line. Listen for the sig_closed() signal for the Gui::Dialog class and request the text value afterwards if LineInputDialog::ReturnValue is set to LineInputDialog::ReturnValue::Ok. More...

#include <LineInputDialog.h>

Inheritance diagram for Gui::LineInputDialog:
Gui::Dialog Gui::WidgetTemplate< QDialog > Gui::WidgetTemplateParent

Public Types

enum  ReturnValue {
  Ok =0,
  Cancelled
}
 

Signals

void sig_closed ()
 emitted when closed
 

Public Member Functions

 LineInputDialog (const QString &window_title, const QString &info_text, const QString &input_text, QWidget *parent=nullptr)
 
 LineInputDialog (const QString &window_title, const QString &info_text, QWidget *parent=nullptr)
 
void set_header_text (const QString &text)
 
void set_info_text (const QString &text)
 
void set_completer_text (const QStringList &lst)
 
ReturnValue return_value () const
 returns if the dialog was closes by cancel or ok button More...
 
QString text () const
 Return the entered text. More...
 
void set_text (const QString &text)
 Prefill the QLineEdit widget. More...
 
bool was_accepted () const
 Convenience method for return_value() method. More...
 

Protected Member Functions

void showEvent (QShowEvent *e) override
 
void closeEvent (QCloseEvent *e) override
 
virtual void language_changed ()
 
virtual void skin_changed ()
 

Detailed Description

Dialog for entering one line. Listen for the sig_closed() signal for the Gui::Dialog class and request the text value afterwards if LineInputDialog::ReturnValue is set to LineInputDialog::ReturnValue::Ok.

Member Function Documentation

◆ return_value()

ReturnValue Gui::LineInputDialog::return_value ( ) const

returns if the dialog was closes by cancel or ok button

Returns
ReturnValue::Ok if ok button was pressed, ReturnValue::Cancelled else

◆ set_text()

void Gui::LineInputDialog::set_text ( const QString &  text)

Prefill the QLineEdit widget.

Parameters
text

◆ text()

QString Gui::LineInputDialog::text ( ) const

Return the entered text.

Returns
always returns the entered text no matter if Ok or Cancel was pressed

◆ was_accepted()

bool Gui::LineInputDialog::was_accepted ( ) const

Convenience method for return_value() method.

Returns