QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
QPushButtonAsQRCode Class Reference

QPushButton that presents a text payload as a QR code action. More...

#include <qpushbuttonasqrcode.h>

Inheritance diagram for QPushButtonAsQRCode:
Collaboration diagram for QPushButtonAsQRCode:

Signals

void clicked (const QString &text)
 Emitted when the button is activated with the current text payload.

Public Member Functions

 QPushButtonAsQRCode (QString textToCopy="", QWidget *parent=nullptr)
 Construct a QPushButtonAsQRCode with an optional initial text.
auto getTextToCopy () const -> QString
 Return the stored text used for QR-code actions.
void setTextToCopy (const QString &value)
 Update the stored text used for QR-code actions.

Private Member Functions

void buttonClicked (bool checked)
 Connected to QPushButton::clicked(bool); re-emits the overload carrying the stored text so receivers do not need to look it up.

Private Attributes

QString textToCopy
 Text to be rendered as a QR code; set by the owning panel.
QIcon iconEdit
 The qrcode icon shown on the button.

Detailed Description

QPushButton that presents a text payload as a QR code action.

The button is icon-only (theme icon qrcode) and carries the text of the field it sits next to. It does not render the QR code itself: on activation it re-emits clicked(const QString&) with the stored text. The owning PasswordDisplayPanel passes that on, and QtPass::showTextAsQRCode() opens the QR dialog.

Definition at line 24 of file qpushbuttonasqrcode.h.

Constructor & Destructor Documentation

◆ QPushButtonAsQRCode()

QPushButtonAsQRCode::QPushButtonAsQRCode ( QString textToCopy = "",
QWidget * parent = nullptr )
explicit

Construct a QPushButtonAsQRCode with an optional initial text.

Parameters
textToCopyInitial text stored for QR-code use (may be empty).
parentOptional parent widget.

Definition at line 11 of file qpushbuttonasqrcode.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ buttonClicked()

void QPushButtonAsQRCode::buttonClicked ( bool checked)
private

Connected to QPushButton::clicked(bool); re-emits the overload carrying the stored text so receivers do not need to look it up.

Parameters
checkedUnused; the button is not checkable.

Definition at line 31 of file qpushbuttonasqrcode.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clicked

void QPushButtonAsQRCode::clicked ( const QString & text)
signal

Emitted when the button is activated with the current text payload.

Parameters
textThe stored text.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTextToCopy()

auto QPushButtonAsQRCode::getTextToCopy ( ) const -> QString
nodiscard

Return the stored text used for QR-code actions.

Returns
The current stored text.

Definition at line 23 of file qpushbuttonasqrcode.cpp.

◆ setTextToCopy()

void QPushButtonAsQRCode::setTextToCopy ( const QString & value)

Update the stored text used for QR-code actions.

Parameters
valueNew text to store.

Definition at line 27 of file qpushbuttonasqrcode.cpp.

Member Data Documentation

◆ iconEdit

QIcon QPushButtonAsQRCode::iconEdit
private

The qrcode icon shown on the button.

Definition at line 66 of file qpushbuttonasqrcode.h.

◆ textToCopy

QString QPushButtonAsQRCode::textToCopy
private

Text to be rendered as a QR code; set by the owning panel.

Definition at line 64 of file qpushbuttonasqrcode.h.


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