21 : QWidget(parent, Qt::Popup | Qt::FramelessWindowHint), m_hideTimer(new QTimer(this))
23 setAttribute(Qt::WA_TranslucentBackground);
24 QBoxLayout *lo =
new QBoxLayout(QBoxLayout::LeftToRight,
this);
25 lo->setObjectName(
"WGSelectorPopupLayout");
26 lo->setSizeConstraint(QLayout::SetFixedSize);
55 QPoint cursorPos = QCursor::pos();
56 const QRect availRect = this->screen()->availableGeometry();
58 QRect popupRect(geometry());
60 : popupRect.center() - popupRect.topLeft();
62 popupRect.moveTopLeft(cursorPos - offset);
66 move(popupRect.topLeft());
75 QPainter painter(
this);
76 painter.setRenderHint(QPainter::Antialiasing);
77 painter.setPen(Qt::NoPen);
78 painter.setBrush(
palette().window());
82#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
89 if (m_hideTimer->isActive()) {
111 QWidget::hideEvent(event);
118 if (!active && !underMouse()) {
125 widget->setParent(
this);
126 while (QLayoutItem *child = layout()->takeAt(0)) {
127 delete child->widget();
130 layout()->addWidget(widget);
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
The KisVisualColorSelector class.
QRect kisEnsureInRect(QRect rc, const QRect &bounds)
rgba palette[MAX_PALETTE]