KritaWidgets
Go to the documentation of this file.
10 #include <QMouseEvent>
14 const char *
const _chain_broken_24[] = {
55 const char *
const _chain_24[] = {
96 class Q_DECL_HIDDEN KoAspectButton::
Private
101 brokenChain(_chain_broken_24),
105 const QPixmap chain, brokenChain;
109 KoAspectButton::KoAspectButton(
QWidget *parent)
118 KoAspectButton::~KoAspectButton()
123 void KoAspectButton::mouseReleaseEvent (
QMouseEvent *ev) {
124 if(! isEnabled() || ev->
button() != Qt::LeftButton)
126 setKeepAspectRatio(!d->keepAspect);
129 void KoAspectButton::setKeepAspectRatio(
bool on) {
130 if(d->keepAspect == on)
134 emit keepAspectRatioChanged(d->keepAspect);
139 painter.drawPixmap(0, (height() - 24) / 2, 9, 24, d->keepAspect ? d->chain : d->brokenChain, 0, 0, 9, 24);
147 void KoAspectButton::keyReleaseEvent (
QKeyEvent *e) {
148 if(e->
text() ==
" ") {
149 setKeepAspectRatio(! d->keepAspect);
154 bool KoAspectButton::keepAspectRatio()
const
156 return d->keepAspect;
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Jan 23 2021 11:48:22 by
doxygen 1.8.16 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.