3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-02-22 07:05:54 +00:00
Scare Crowe d2ebfd0519 QortalOS Titan 5.60.12
Screw the description like that inbred T3Q
2022-03-05 21:17:59 +05:00

51 lines
1.1 KiB
C++

/*
SPDX-FileCopyrightText: 2014-2015 Eike Hein <hein@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "rubberband.h"
#include <QApplication>
#include <QStyleOptionRubberBand>
RubberBand::RubberBand(QQuickItem *parent)
: QQuickPaintedItem(parent)
{
}
RubberBand::~RubberBand()
{
}
void RubberBand::paint(QPainter *painter)
{
if (!qApp || !qApp->style()) {
return;
}
QStyleOptionRubberBand opt;
opt.state = QStyle::State_None;
opt.direction = qApp->layoutDirection();
opt.styleObject = this;
opt.palette = qApp->palette();
opt.shape = QRubberBand::Rectangle;
opt.opaque = false;
opt.rect = contentsBoundingRect().toRect();
qApp->style()->drawControl(QStyle::CE_RubberBand, &opt, painter);
}
bool RubberBand::intersects(const QRectF &rect) const
{
return m_geometry.intersects(rect);
}
void RubberBand::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
{
Q_UNUSED(oldGeometry);
m_geometry = newGeometry;
QQuickItem::geometryChanged(newGeometry, oldGeometry);
}