Sayonara Player
Public Types | Signals | Public Member Functions | Static 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 sigClosed ()
 emitted when closed
 

Public Member Functions

 LineInputDialog (const QString &title, const QString &infoText, const QString &inputText, QWidget *parent=nullptr)
 
 LineInputDialog (const QString &title, const QString &infoText, QWidget *parent=nullptr)
 
void setHeaderText (const QString &text)
 
void setInfoText (const QString &text)
 
void setCompleterText (const QStringList &lst)
 
ReturnValue returnValue () const
 returns if the dialog was closes by cancel or ok button More...
 
QString text () const
 Return the entered text. More...
 
void setText (const QString &text)
 Prefill the QLineEdit widget. More...
 
void setPlaceholderText (const QString &text)
 
void showInfo (bool b, const QString &infoPrefix=QString())
 
bool wasAccepted () const
 Convenience method for return_value() method. More...
 
void setInvalidChars (const QList< QChar > &chars)
 
void resizeRelative (QWidget *widget, double percent, const QSize &maxSize)
 
bool isAccepted () const
 

Static Public Member Functions

static QString getRenameFilename (QWidget *parent, const QString &oldName, const QString &parentPath=QString())
 
static QString getNewFilename (QWidget *parent, const QString &info, const QString &parentPath=QString())
 

Protected Member Functions

void showEvent (QShowEvent *e) override
 
void closeEvent (QCloseEvent *e) override
 
virtual void paintEvent (QPaintEvent *e) override
 
virtual void languageChanged ()
 
virtual void skinChanged ()
 

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

◆ closeEvent()

void Gui::LineInputDialog::closeEvent ( QCloseEvent *  e)
overrideprotectedvirtual

Reimplemented from Gui::Dialog.

◆ returnValue()

ReturnValue Gui::LineInputDialog::returnValue ( ) const

returns if the dialog was closes by cancel or ok button

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

◆ setText()

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

Prefill the QLineEdit widget.

Parameters
text

◆ showEvent()

void Gui::LineInputDialog::showEvent ( QShowEvent *  e)
overrideprotectedvirtual

Reimplemented from Gui::WidgetTemplate< QDialog >.

◆ text()

QString Gui::LineInputDialog::text ( ) const

Return the entered text.

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

◆ wasAccepted()

bool Gui::LineInputDialog::wasAccepted ( ) const

Convenience method for return_value() method.

Returns