#include <Libs/Widgets/ctkPopupWidget.h>
ctkPopupWidget is a specialization of ctkBasePopupWidget that handles the opening and closing of the popup. Below is an example of a popup slider that opens and closes next to a button
popup->
setAlignment(Qt::AlignRight | Qt::AlignTop | Qt::AlignBottom);
QHBoxLayout* popupLayout = new QHBoxLayout(popup);
QSlider* popupSlider = new QSlider(popup);
popupLayout->addWidget(popupSlider);
- See also
- ctkBasePopupWidget
Definition at line 43 of file ctkPopupWidget.h.
◆ Superclass
◆ ctkPopupWidget()
ctkPopupWidget::ctkPopupWidget |
( |
QWidget * |
parent = 0 | ) |
|
|
explicit |
By default, the parent is the baseWidget.
- See also
- baseWidget()
◆ ~ctkPopupWidget()
virtual ctkPopupWidget::~ctkPopupWidget |
( |
| ) |
|
|
virtual |
◆ autoHide()
bool ctkPopupWidget::autoHide |
( |
| ) |
const |
◆ autoShow()
bool ctkPopupWidget::autoShow |
( |
| ) |
const |
◆ enterEvent()
virtual void ctkPopupWidget::enterEvent |
( |
QEvent * |
event | ) |
|
|
protectedvirtual |
◆ eventFilter()
virtual bool ctkPopupWidget::eventFilter |
( |
QObject * |
obj, |
|
|
QEvent * |
event |
|
) |
| |
|
protectedvirtual |
◆ hideDelay()
int ctkPopupWidget::hideDelay |
( |
| ) |
const |
◆ hidePopup()
virtual void ctkPopupWidget::hidePopup |
( |
| ) |
|
|
virtual |
◆ isActive()
bool ctkPopupWidget::isActive |
( |
| ) |
const |
◆ leaveEvent()
virtual void ctkPopupWidget::leaveEvent |
( |
QEvent * |
event | ) |
|
|
protectedvirtual |
◆ onEffectFinished
virtual void ctkPopupWidget::onEffectFinished |
( |
| ) |
|
|
protectedvirtualslot |
◆ pinPopup
void ctkPopupWidget::pinPopup |
( |
bool |
pin | ) |
|
|
slot |
Convenient function that calls setAutoHide(!pin) and opens the popup if pin is true regardless of the value of AutoShow. It is typically connected with a checkable button to anchor the popup.
◆ setActive()
void ctkPopupWidget::setActive |
( |
bool |
| ) |
|
◆ setAutoHide()
void ctkPopupWidget::setAutoHide |
( |
bool |
autoHide | ) |
|
Don't automatically close the popup when leaving the widget. Calling setAutoHide automatically updates the state close the popup if the mouse is not over the popup nor the base widget.
◆ setAutoShow()
void ctkPopupWidget::setAutoShow |
( |
bool |
| ) |
|
Calling setAutoShow automatically updates opens the popup if the cursor is above the popup or the base widget.
◆ setBaseWidget()
virtual void ctkPopupWidget::setBaseWidget |
( |
QWidget * |
baseWidget | ) |
|
|
protectedvirtual |
Widget the popup is attached to. It opens right under baseWidget and if the ctkPopupWidget sizepolicy contains the growFlag/shrinkFlag, it tries to resize itself to fit the same width of baseWidget.
Reimplemented from ctkBasePopupWidget.
◆ setHideDelay()
void ctkPopupWidget::setHideDelay |
( |
int |
delay | ) |
|
◆ setShowDelay()
void ctkPopupWidget::setShowDelay |
( |
int |
delay | ) |
|
◆ showDelay()
int ctkPopupWidget::showDelay |
( |
| ) |
const |
◆ updatePopup
void ctkPopupWidget::updatePopup |
( |
| ) |
|
|
protectedslot |
◆ active
bool ctkPopupWidget::active |
|
readwrite |
Control whether the popup listens to the application and baseWidget events and decides if it needs to be permanently or temporarily hidden. You might want to setActive(false) when embedding the popup into a static layout intead of having it top-level (no parent). Consider also removing its windowFlags (Qt::ToolTip | Qt::FramelessWindowHint) and removing the baseWidget. True by default
- See also
- isActive(), setActive()
Definition at line 1 of file ctkPopupWidget.h.
◆ autoHide
bool ctkPopupWidget::autoHide |
|
readwrite |
◆ autoShow
bool ctkPopupWidget::autoShow |
|
readwrite |
◆ hideDelay
int ctkPopupWidget::hideDelay |
|
readwrite |
◆ showDelay
int ctkPopupWidget::showDelay |
|
readwrite |
The documentation for this class was generated from the following file: