digiKam
Digikam::DConfigDlgTitle Class Reference
+ Inheritance diagram for Digikam::DConfigDlgTitle:

Classes

class  Private
 

Public Types

enum  ImageAlignment { ImageLeft , ImageRight }
 
enum  MessageType { PlainMessage , InfoMessage , WarningMessage , ErrorMessage }
 

Public Slots

void setAutoHideTimeout (int msecs)
 
void setComment (const QString &comment, MessageType type=PlainMessage)
 
void setPixmap (const QIcon &icon, ImageAlignment alignment=ImageRight)
 
void setPixmap (const QPixmap &pixmap, ImageAlignment alignment=ImageRight)
 
void setPixmap (const QString &icon, ImageAlignment alignment=ImageRight)
 
void setPixmap (MessageType type, ImageAlignment alignment=ImageRight)
 
void setText (const QString &text, MessageType type)
 
void setText (const QString &text, Qt::Alignment alignment=Qt::AlignLeft|Qt::AlignVCenter)
 

Public Member Functions

int autoHideTimeout () const
 
QString comment () const
 
 DConfigDlgTitle (QWidget *const parent=nullptr)
 
QPixmap pixmap () const
 
void setBuddy (QWidget *const buddy)
 
void setWidget (QWidget *const widget)
 
QString text () const
 
 ~DConfigDlgTitle () override
 

Protected Member Functions

void changeEvent (QEvent *) override
 
bool eventFilter (QObject *, QEvent *) override
 
void showEvent (QShowEvent *) override
 

Properties

int autoHideTimeout
 
QString comment
 
QPixmap pixmap
 
QString text
 

Detailed Description

This class provides a widget often used for DConfigDlg titles.

DConfigDlgTitle uses the general application font at 1.4 times its size to style the text.

DConfigDlgTitle is very simple to use. You can either use its default text (and pixmap) properties or display your own widgets in the title widget.

Member Enumeration Documentation

◆ ImageAlignment

Possible title pixmap alignments.

  • ImageLeft: Display the pixmap left
  • ImageRight: Display the pixmap right (default)
Enumerator
ImageLeft 

Display the pixmap on the left.

ImageRight 

Display the pixmap on the right.

◆ MessageType

Comment message types

Enumerator
PlainMessage 

Normal comment.

InfoMessage 

Information the user should be alerted to.

WarningMessage 

A warning the user should be alerted to.

ErrorMessage 

An error message.

Constructor & Destructor Documentation

◆ DConfigDlgTitle()

Digikam::DConfigDlgTitle::DConfigDlgTitle ( QWidget *const  parent = nullptr)
explicit

◆ ~DConfigDlgTitle()

Digikam::DConfigDlgTitle::~DConfigDlgTitle ( )
override

Member Function Documentation

◆ autoHideTimeout()

int Digikam::DConfigDlgTitle::autoHideTimeout ( ) const

Get the current timeout value in milliseconds

Returns
timeout value in msecs

References Digikam::DConfigDlgTitle::Private::autoHideTimeout.

◆ changeEvent()

◆ comment()

QString Digikam::DConfigDlgTitle::comment ( ) const
Returns
the text displayed in the comment below the title, if any
See also
setComment()

References Digikam::DConfigDlgTitle::Private::commentLabel.

◆ eventFilter()

bool Digikam::DConfigDlgTitle::eventFilter ( QObject *  object,
QEvent *  event 
)
overrideprotected

◆ pixmap()

QPixmap Digikam::DConfigDlgTitle::pixmap ( ) const
Returns
the pixmap displayed in the title
See also
setPixmap()

References Digikam::DConfigDlgTitle::Private::imageLabel.

◆ setAutoHideTimeout

void Digikam::DConfigDlgTitle::setAutoHideTimeout ( int  msecs)
slot

Set the autohide timeout of the label Set value to 0 to disable autohide, which is the default.

Parameters
msecstimeout value in milliseconds

References Digikam::DConfigDlgTitle::Private::autoHideTimeout.

◆ setBuddy()

void Digikam::DConfigDlgTitle::setBuddy ( QWidget *const  buddy)

Sets this label's buddy to buddy. When the user presses the shortcut key indicated by the label in this title widget, the keyboard focus is transferred to the label's buddy widget.

Parameters
buddythe widget to activate when the shortcut key is activated

References Digikam::DConfigDlgTitle::Private::textLabel.

◆ setComment

void Digikam::DConfigDlgTitle::setComment ( const QString &  comment,
MessageType  type = PlainMessage 
)
slot
Parameters
commentText displayed beneath the main title as a comment. It can either be plain text or rich text.
typeThe sort of message it is.
See also
MessageType
comment()

References comment, Digikam::DConfigDlgTitle::Private::commentLabel, Digikam::DConfigDlgTitle::Private::commentStyleSheet(), and Digikam::DConfigDlgTitle::Private::messageType.

◆ setPixmap [1/4]

void Digikam::DConfigDlgTitle::setPixmap ( const QIcon &  icon,
ImageAlignment  alignment = ImageRight 
)
slot
Parameters
pixmapthe icon to display in the header. The pixmap is by default right, but
alignmentcan be used to display it also left.
See also
pixmap()

References setPixmap().

◆ setPixmap [2/4]

void Digikam::DConfigDlgTitle::setPixmap ( const QPixmap &  pixmap,
ImageAlignment  alignment = ImageRight 
)
slot
Parameters
pixmapPixmap displayed in the header. The pixmap is by default right, but
alignmentcan be used to display it also left.
See also
pixmap()

References Digikam::DConfigDlgTitle::Private::commentLabel, Digikam::DConfigDlgTitle::Private::headerLayout, Digikam::DConfigDlgTitle::Private::imageLabel, ImageLeft, pixmap, and Digikam::DConfigDlgTitle::Private::textLabel.

Referenced by setPixmap(), and setText().

◆ setPixmap [3/4]

void Digikam::DConfigDlgTitle::setPixmap ( const QString &  icon,
ImageAlignment  alignment = ImageRight 
)
slot
Parameters
iconname of the icon to display in the header. The pixmap is by default right, but
alignmentcan be used to display it also left.
See also
pixmap()

References setPixmap().

◆ setPixmap [4/4]

void Digikam::DConfigDlgTitle::setPixmap ( MessageType  type,
ImageAlignment  alignment = ImageRight 
)
slot
Parameters
pixmapthe icon to display in the header. The pixmap is by default right, but
alignmentcan be used to display it also left.
See also
pixmap()

References Digikam::DConfigDlgTitle::Private::iconTypeToIconName(), and setPixmap().

◆ setText [1/2]

void Digikam::DConfigDlgTitle::setText ( const QString &  text,
MessageType  type 
)
slot
Parameters
textText displayed on the label. It can either be plain text or rich text. If it is plain text, the text is displayed as a bold title text.
typeThe sort of message it is; will also set the icon accordingly
See also
MessageType
text()

References setPixmap(), setText(), and text.

◆ setText [2/2]

void Digikam::DConfigDlgTitle::setText ( const QString &  text,
Qt::Alignment  alignment = Qt::AlignLeft | Qt::AlignVCenter 
)
slot
Parameters
textText displayed on the label. It can either be plain text or rich text. If it is plain text, the text is displayed as a bold title text.
alignmentAlignment of the text. Default is left and vertical centered.
See also
text()

References text, Digikam::DConfigDlgTitle::Private::textLabel, and Digikam::DConfigDlgTitle::Private::textStyleSheet().

Referenced by setText(), and Digikam::DConfigDlgViewPrivate::updateTitleWidget().

◆ setWidget()

void Digikam::DConfigDlgTitle::setWidget ( QWidget *const  widget)
Parameters
widgetthe widget displayed on the title widget.

References Digikam::DConfigDlgTitle::Private::headerLayout.

◆ showEvent()

void Digikam::DConfigDlgTitle::showEvent ( QShowEvent *  event)
overrideprotected

◆ text()

QString Digikam::DConfigDlgTitle::text ( ) const
Returns
the text displayed in the title
See also
setText()

References Digikam::DConfigDlgTitle::Private::textLabel.

Property Documentation

◆ autoHideTimeout

int Digikam::DConfigDlgTitle::autoHideTimeout
readwrite

◆ comment

QString Digikam::DConfigDlgTitle::comment
readwrite

Referenced by setComment().

◆ pixmap

QPixmap Digikam::DConfigDlgTitle::pixmap
readwrite

Referenced by setPixmap().

◆ text

QString Digikam::DConfigDlgTitle::text
readwrite

Referenced by setText().


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