BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Utils::FadingWidget Class Reference
Inheritance diagram for Utils::FadingWidget:
[legend]
Collaboration diagram for Utils::FadingWidget:
[legend]

Public Member Functions

 FadingWidget (QWidget *parent=0)
 
void fadeTo (qreal value)
 
qreal opacity ()
 
void setOpacity (qreal value)
 

Protected Attributes

QGraphicsOpacityEffect * m_opacityEffect
 

Detailed Description

Definition at line 43 of file detailsbutton.h.

Constructor & Destructor Documentation

◆ FadingWidget()

FadingWidget::FadingWidget ( QWidget *  parent = 0)

Definition at line 43 of file detailsbutton.cpp.

44  : FadingPanel(parent), m_opacityEffect(new QGraphicsOpacityEffect)
45 {
46  m_opacityEffect->setOpacity(0);
47  setGraphicsEffect(m_opacityEffect);
48 
49  // Workaround for issue with QGraphicsEffect. GraphicsEffect
50  // currently clears with Window color. Remove if flickering
51  // no longer occurs on fade-in
52  QPalette pal;
53  pal.setBrush(QPalette::All, QPalette::Window, Qt::transparent);
54  setPalette(pal);
55 }
FadingPanel(QWidget *parent=0)
Definition: detailsbutton.h:38
QGraphicsOpacityEffect * m_opacityEffect
Definition: detailsbutton.h:52

References m_opacityEffect.

Member Function Documentation

◆ fadeTo()

void FadingWidget::fadeTo ( qreal  value)
virtual

Implements Utils::FadingPanel.

Definition at line 62 of file detailsbutton.cpp.

63 {
64  QPropertyAnimation* animation = new QPropertyAnimation(m_opacityEffect, "opacity");
65  animation->setDuration(200);
66  animation->setEndValue(value);
67  animation->start(QAbstractAnimation::DeleteWhenStopped);
68 }

References m_opacityEffect.

◆ opacity()

qreal FadingWidget::opacity ( )

Definition at line 70 of file detailsbutton.cpp.

71 {
72  return m_opacityEffect->opacity();
73 }

References m_opacityEffect.

◆ setOpacity()

void FadingWidget::setOpacity ( qreal  value)
virtual

Implements Utils::FadingPanel.

Definition at line 57 of file detailsbutton.cpp.

58 {
59  m_opacityEffect->setOpacity(value);
60 }

References m_opacityEffect.

Member Data Documentation

◆ m_opacityEffect

QGraphicsOpacityEffect* Utils::FadingWidget::m_opacityEffect
protected

Definition at line 52 of file detailsbutton.h.

Referenced by FadingWidget(), fadeTo(), opacity(), and setOpacity().


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