#include <WGSelectorPopup.h>
Definition at line 16 of file WGSelectorPopup.h.
◆ WGSelectorPopup()
| WGSelectorPopup::WGSelectorPopup |
( |
QWidget * | parent = nullptr | ) |
|
|
explicit |
Definition at line 20 of file WGSelectorPopup.cpp.
21 : QWidget(parent, Qt::Popup | Qt::FramelessWindowHint),
m_hideTimer(
new QTimer(
this))
22{
23 setAttribute(Qt::WA_TranslucentBackground);
24 QBoxLayout *lo = new QBoxLayout(QBoxLayout::LeftToRight, this);
25 lo->setObjectName("WGSelectorPopupLayout");
26 lo->setSizeConstraint(QLayout::SetFixedSize);
31
32}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
References connect(), m_hideTimer, and m_margin.
◆ enterEvent()
| void WGSelectorPopup::enterEvent |
( |
QEnterEvent * | event | ) |
|
|
overrideprotected |
◆ hideEvent()
| void WGSelectorPopup::hideEvent |
( |
QHideEvent * | event | ) |
|
|
overrideprotected |
◆ keyPressEvent()
| void WGSelectorPopup::keyPressEvent |
( |
QKeyEvent * | event | ) |
|
|
overrideprotected |
◆ leaveEvent()
| void WGSelectorPopup::leaveEvent |
( |
QEvent * | event | ) |
|
|
overrideprotected |
◆ paintEvent()
| void WGSelectorPopup::paintEvent |
( |
QPaintEvent * | event | ) |
|
|
overrideprotected |
Definition at line 72 of file WGSelectorPopup.cpp.
73{
74 Q_UNUSED(event);
75 QPainter painter(this);
76 painter.setRenderHint(QPainter::Antialiasing);
77 painter.setPen(Qt::NoPen);
78 painter.setBrush(
palette().window());
80}
rgba palette[MAX_PALETTE]
References m_margin, and palette.
◆ replaceCentranWidget()
| void WGSelectorPopup::replaceCentranWidget |
( |
QWidget * | widget | ) |
|
|
private |
Definition at line 123 of file WGSelectorPopup.cpp.
124{
125 widget->setParent(this);
126 while (QLayoutItem *child =
layout()->takeAt(0)) {
127 delete child->widget();
128 delete child;
129 }
130 layout()->addWidget(widget);
131 widget->show();
133 adjustSize();
134}
◆ selectorWidget()
◆ setSelectorWidget() [1/2]
◆ setSelectorWidget() [2/2]
◆ sigPopupClosed
◆ slotInteraction
| void WGSelectorPopup::slotInteraction |
( |
bool | active | ) |
|
|
privateslot |
◆ slotShowPopup
| void WGSelectorPopup::slotShowPopup |
( |
| ) |
|
|
slot |
Definition at line 53 of file WGSelectorPopup.cpp.
54{
55 QPoint cursorPos = QCursor::pos();
56 const QRect availRect = this->screen()->availableGeometry();
57
58 QRect popupRect(geometry());
60 : popupRect.center() - popupRect.topLeft();
61
62 popupRect.moveTopLeft(cursorPos - offset);
64
65
66 move(popupRect.topLeft());
67
68 show();
69
70}
QRect kisEnsureInRect(QRect rc, const QRect &bounds)
References kisEnsureInRect(), m_selectorWidget, and WGSelectorWidgetBase::popupOffset().
◆ m_hideTimer
| QTimer* WGSelectorPopup::m_hideTimer |
|
private |
◆ m_isInteracting
| bool WGSelectorPopup::m_isInteracting {false} |
|
private |
◆ m_margin
| int WGSelectorPopup::m_margin {10} |
|
private |
◆ m_selectorWidget
The documentation for this class was generated from the following files: