#include <basePopupWidget.h>
|
enum | AnimationEffect { WindowOpacityFadeEffect = 0
, ScrollEffect
, FadeEffect
} |
|
enum | VerticalDirection { TopToBottom = 1
, BottomToTop = 2
} |
|
typedef QFrame | Superclass |
|
|
void | popupOpened (bool open) |
|
|
| BasePopupWidget (QWidget *parent=0) |
|
QWidget * | baseWidget () const |
|
AnimationEffect | animationEffect () const |
|
void | setAnimationEffect (AnimationEffect effect) |
|
int | effectDuration () const |
|
void | setEffectDuration (int duration) |
|
QEasingCurve::Type | easingCurve () const |
|
void | setEasingCurve (QEasingCurve::Type easingCurve) |
|
Qt::Alignment | alignment () const |
|
void | setAlignment (Qt::Alignment alignment) |
|
Qt::Orientations | orientation () const |
|
void | setOrientation (Qt::Orientations orientation) |
|
| Q_ENUM (AnimationEffect) |
|
| Q_ENUM (VerticalDirection) |
|
VerticalDirection | verticalDirection () const |
|
void | setVerticalDirection (VerticalDirection direction) |
|
Qt::LayoutDirection | horizontalDirection () const |
|
void | setHorizontalDirection (Qt::LayoutDirection direction) |
|
|
virtual void | onEffectFinished () |
|
void | setEffectAlpha (double alpha) |
|
void | setEffectGeometry (QRect geometry) |
|
void | onBaseWidgetDestroyed () |
|
|
| BasePopupWidget (BasePopupWidgetPrivate *pimpl, QWidget *parent=0) |
|
double | effectAlpha () const |
|
QRect | effectGeometry () const |
|
virtual void | setBaseWidget (QWidget *baseWidget) |
|
virtual bool | event (QEvent *event) |
|
virtual void | paintEvent (QPaintEvent *) |
|
◆ BasePopupWidget()
BasePopupWidget::BasePopupWidget |
( |
QWidget * | parent = 0 | ) |
|
|
explicit |
Although a popup widget is a top-level widget, if a parent is passed the popup widget will be deleted when that parent is destroyed (as with any other QObject). BasePopupWidget is a top-level widget (Qt::ToolTip), so even if a parent is passed, the popup will display outside the possible parent layout.
- See also
- baseWidget().
◆ baseWidget()
QWidget * BasePopupWidget::baseWidget |
( |
| ) |
const |
Widget the popup is attached to. It opens right under baseWidget and if the BasePopupWidget sizepolicy contains the growFlag/shrinkFlag, it tries to resize itself to fit the same width of baseWidget. By default, baseWidget is the parent widget.
◆ hidePopup
void BasePopupWidget::hidePopup |
( |
| ) |
|
|
virtualslot |
Hide the popup if open or opening. It takes around 300ms for the fading effect to hide the popup.
Reimplemented in PopupWidget.
◆ setAnimationEffect()
void BasePopupWidget::setAnimationEffect |
( |
BasePopupWidget::AnimationEffect | effect | ) |
|
TODO: handle the case where there is an animation running
◆ setBaseWidget()
void BasePopupWidget::setBaseWidget |
( |
QWidget * | baseWidget | ) |
|
|
protectedvirtual |
◆ showPopup [1/2]
void BasePopupWidget::showPopup |
( |
| ) |
|
|
virtualslot |
Open the popup if closed or closing. It takes around 300ms for the fading effect to open the popup.
Maybe the popup doesn't allow the desiredOpenGeometry if the widget minimum size is larger than the desired size.
◆ showPopup [2/2]
void BasePopupWidget::showPopup |
( |
bool | show | ) |
|
|
inlineslot |
Show/hide the popup. It can be conveniently linked to a QPushButton signal.
◆ alignment
Qt::Alignment BasePopupWidget::alignment |
|
readwrite |
Where is the popup in relation to the BaseWidget To vertically justify, use Qt::AlignTop | Qt::AlignBottom Qt::AlignJustify | Qt::AlignBottom by default
◆ easingCurve
QEasingCurve::Type BasePopupWidget::easingCurve |
|
readwrite |
Opening/Closing curve QEasingCurve::InOutQuad by default
◆ effectDuration
int BasePopupWidget::effectDuration |
|
readwrite |
Effect duration in ms Default to 333ms
◆ horizontalDirection
Qt::LayoutDirection BasePopupWidget::horizontalDirection |
|
readwrite |
Control where the popup opens horizontally. LeftToRight by default
◆ orientation
Qt::Orientations BasePopupWidget::orientation |
|
readwrite |
Direction of the scrolling effect, can be Qt::Vertical, Qt::Horizontal or both Qt::Vertical|Qt::Horizontal. Vertical by default
◆ verticalDirection
BasePopupWidget::VerticalDirection BasePopupWidget::verticalDirection |
|
readwrite |
Control where the popup opens vertically. TopToBottom by default
The documentation for this class was generated from the following files:
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/itomWidgets/basePopupWidget.h
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/itomWidgets/basePopupWidget.cpp