Toolbox Qt
Loading...
Searching...
No Matches
tbq::WidgetHelper Class Reference

Class containing multiple helpful methods related to widgets. More...

Static Public Member Functions

static void labelSetPathDir (QLabel *label, const QDir &dir, bool verifyExist)
 Use to display a directory path inside a label.
 
static void labelSetPathFile (QLabel *label, const QFileInfo &fileInfo, bool verifyExist)
 Use to display a file info path inside a label.
 
static void lineEditSetAsInputPasswd (QLineEdit *lineEdit, const QIcon &iconShow, const QIcon &iconHide, const QString &txtShow="Show password", const QString &txtHide="Hide password")
 Use to initialize a line edit input as a password input.
 

Detailed Description

Class containing multiple helpful methods related to widgets.

This class group multiple methods that are simple enough to not have to create an inherited object.

Member Function Documentation

◆ labelSetPathDir()

void tbq::WidgetHelper::labelSetPathDir ( QLabel * label,
const QDir & dir,
bool verifyExist )
static

Use to display a directory path inside a label.

Latest directory path part will be displayed, the rest of it will be displayed as a tooltip.

Parameters
[out]labelLabel to use.
Must be not NULL.
[in]dirDirectory to display.
If directory is current working directory ("."), directory will be considered as not selected.
[in]verifyExistIf true, method will verify that directory exist : if not, we will consider that that directory has not been selected.
See also
labelSetPathFile()

◆ labelSetPathFile()

void tbq::WidgetHelper::labelSetPathFile ( QLabel * label,
const QFileInfo & fileInfo,
bool verifyExist )
static

Use to display a file info path inside a label.

Filaname will be displayed, the path will be displayed as a tooltip.

Parameters
[out]labelLabel to use.
Must be not NULL.
[in]fileInfoFile informations to use.
If empty, file will be considered as not selected.
[in]verifyExistIf true, method will verify that file exist : if not, we will consider that file has not been selected.
See also
labelSetPathDir()

◆ lineEditSetAsInputPasswd()

void tbq::WidgetHelper::lineEditSetAsInputPasswd ( QLineEdit * lineEdit,
const QIcon & iconShow,
const QIcon & iconHide,
const QString & txtShow = "Show password",
const QString & txtHide = "Hide password" )
static

Use to initialize a line edit input as a password input.

It allow to manage show/hide property of a password field input.

Parameters
[out]lineEditLine edit to set.
Must be not NULL.
[in]iconShowIcon to use to show password.
[in]iconHideIcon to use to hide password.
[in]txtShowTooltip to use to show password.
[in]txtHideTooltip to use to hide password.

The documentation for this class was generated from the following files: