Krita Source Code Documentation
Loading...
Searching...
No Matches
KDcrawIface::RSqueezedClickLabel Class Reference

#include <rexpanderbox.h>

+ Inheritance diagram for KDcrawIface::RSqueezedClickLabel:

Signals

void activated ()
 
void leftClicked ()
 

Public Member Functions

 RSqueezedClickLabel (const QString &text, QWidget *const parent=0)
 
 RSqueezedClickLabel (QWidget *const parent=0)
 
 ~RSqueezedClickLabel () override
 
- Public Member Functions inherited from KDcrawIface::RAdjustableLabel
QString adjustedText () const
 
QSize minimumSizeHint () const override
 
 Private ()
 
 RAdjustableLabel (QWidget *const parent=0)
 
void setAlignment (Qt::Alignment align)
 
void setElideMode (Qt::TextElideMode mode)
 
QSize sizeHint () const override
 
 ~RAdjustableLabel () override
 

Protected Member Functions

void keyPressEvent (QKeyEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 

Additional Inherited Members

- Public Slots inherited from KDcrawIface::RAdjustableLabel
void setAdjustedText (const QString &text=QString())
 
- Public Attributes inherited from KDcrawIface::RAdjustableLabel
QString ajdText
 
Qt::TextElideMode emode
 

Detailed Description

Definition at line 79 of file rexpanderbox.h.

Constructor & Destructor Documentation

◆ RSqueezedClickLabel() [1/2]

KDcrawIface::RSqueezedClickLabel::RSqueezedClickLabel ( QWidget *const parent = 0)

Definition at line 111 of file rexpanderbox.cpp.

112 : RAdjustableLabel(parent)
113{
114 setCursor(Qt::PointingHandCursor);
115}
RAdjustableLabel(QWidget *const parent=0)

◆ RSqueezedClickLabel() [2/2]

KDcrawIface::RSqueezedClickLabel::RSqueezedClickLabel ( const QString & text,
QWidget *const parent = 0 )
explicit

Definition at line 117 of file rexpanderbox.cpp.

118 : RAdjustableLabel(parent)
119{
121 setCursor(Qt::PointingHandCursor);
122}
void setAdjustedText(const QString &text=QString())

References KDcrawIface::RAdjustableLabel::setAdjustedText(), and KDcrawIface::RAdjustableLabel::text().

◆ ~RSqueezedClickLabel()

KDcrawIface::RSqueezedClickLabel::~RSqueezedClickLabel ( )
override

Definition at line 124 of file rexpanderbox.cpp.

125{
126}

Member Function Documentation

◆ activated

void KDcrawIface::RSqueezedClickLabel::activated ( )
signal

◆ keyPressEvent()

void KDcrawIface::RSqueezedClickLabel::keyPressEvent ( QKeyEvent * event)
overrideprotected

Definition at line 154 of file rexpanderbox.cpp.

155{
156 switch (e->key())
157 {
158 case Qt::Key_Down:
159 case Qt::Key_Right:
160 case Qt::Key_Space:
161 Q_EMIT activated();
162 return;
163 default:
164 break;
165 }
166
167 QLabel::keyPressEvent(e);
168}

References activated().

◆ leftClicked

void KDcrawIface::RSqueezedClickLabel::leftClicked ( )
signal

◆ mousePressEvent()

void KDcrawIface::RSqueezedClickLabel::mousePressEvent ( QMouseEvent * event)
overrideprotected

Definition at line 140 of file rexpanderbox.cpp.

141{
142 QLabel::mousePressEvent(event);
143
144 /*
145 * In some contexts, like QGraphicsView, there will be no
146 * release event if the press event was not accepted.
147 */
148 if (event->button() == Qt::LeftButton)
149 {
150 event->accept();
151 }
152}

◆ mouseReleaseEvent()

void KDcrawIface::RSqueezedClickLabel::mouseReleaseEvent ( QMouseEvent * event)
overrideprotected

Definition at line 128 of file rexpanderbox.cpp.

129{
130 QLabel::mouseReleaseEvent(event);
131
132 if (event->button() == Qt::LeftButton)
133 {
134 Q_EMIT leftClicked();
135 Q_EMIT activated();
136 event->accept();
137 }
138}

References activated(), and leftClicked().


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