16#include "private/qwidget_p.h"
93 p.drawPixmap(0, 0, pm);
115 qApp->installEventFilter(
this);
125 qApp->installEventFilter(
this);
135 if (!backImage.
isNull() && checkTime.
elapsed() < duration / 2) {
136 mixedImage = backImage.
copy();
173#ifndef QT_NO_SHORTCUT
214 int tempel = checkTime.
elapsed();
215 if (elapsed >= tempel)
221 alpha = tempel / double(duration);
226 if (
alpha >= 1 || !showWidget) {
228 qApp->removeEventFilter(
this);
236 if (
alpha >= 1 || !showWidget) {
238 qApp->removeEventFilter(
this);
267 const int ia = 256 -
a;
269 const int sw = frontImage.
width();
270 const int sh = frontImage.
height();
272 switch(frontImage.
depth()) {
276 const uchar *back_data = backImage.
bits();
277 const uchar *front_data = frontImage.
bits();
279 for (
int sy = 0; sy < sh; sy++) {
283 for (
int sx = 0; sx < sw; sx++) {
362 totalWidth = widget->
width();
363 totalHeight = widget->
height();
369 currentHeight = totalHeight;
370 currentWidth = totalWidth;
386 int y = orientation &
DownScroll ?
qMin(0, currentHeight - totalHeight) : 0;
389 p.drawPixmap(
x,
y, pm);
425 dist += totalWidth - currentWidth;
427 dist += totalHeight - currentHeight;
434 resize(
qMin(currentWidth, totalWidth),
qMin(currentHeight, totalHeight));
452void QRollEffect::scroll()
454 if (!done && widget) {
455 int tempel = checkTime.
elapsed();
456 if (elapsed >= tempel)
461 if (currentWidth != totalWidth) {
462 currentWidth = totalWidth * (elapsed/duration)
463 + (2 * totalWidth * (elapsed%duration) + duration)
467 if (currentHeight != totalHeight) {
468 currentHeight = totalHeight * (elapsed/duration)
469 + (2 * totalHeight * (elapsed%duration) + duration)
473 done = (currentHeight >= totalHeight) &&
474 (currentWidth >= totalWidth);
482 w =
qMin(currentWidth, totalWidth);
484 h =
qMin(currentHeight, totalHeight);
488 y = widget->
geometry().
y() +
qMax(0, totalHeight - currentHeight);
498 if (done || !widget) {
573#include "qeffects.moc"
The QCloseEvent class contains parameters that describe a close event.
static void sendPostedEvents(QObject *receiver=nullptr, int event_type=0)
Immediately dispatches all events which have been previously queued with QCoreApplication::postEvent(...
qint64 elapsed() const noexcept
Returns the number of milliseconds since this QElapsedTimer was last started.
void start() noexcept
Starts this timer.
QScreen * primaryScreen
the primary (or default) screen of the application.
qsizetype bytesPerLine() const
Returns the number of bytes per image scanline.
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
int width() const
Returns the width of the image.
uchar * bits()
Returns a pointer to the first pixel data.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
int height() const
Returns the height of the image.
The QKeyEvent class describes a key event.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events if this object has been installed as an event filter for the watched object.
void deleteLater()
\threadsafe
The QPaintEvent class contains event parameters for paint events.
The QPainter class performs low-level painting on widgets and other paint devices.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
QImage toImage() const
Converts the pixmap to a QImage.
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
QRollEffect(QWidget *w, Qt::WindowFlags f, DirFlags orient)
void closeEvent(QCloseEvent *) override
This event handler is called with the given event when Qt receives a window close request for a top-l...
QPixmap grabWindow(WId window=0, int x=0, int y=0, int w=-1, int h=-1)
Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by Q...
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
void stop()
Stops the timer.
Combined button and popup list for selecting options.
@ WA_WState_ExplicitShowHide
static QRollEffect * q_roll
static QAlphaWidget * q_blend
void qScrollEffect(QWidget *w, QEffects::DirFlags orient, int time)
void qFadeEffect(QWidget *w, int time)
int qRound(qfloat16 d) noexcept
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLbitfield GLuint64 timeout
[4]
GLfloat GLfloat GLfloat GLfloat h
GLfloat GLfloat GLfloat alpha
constexpr QRgb qRgb(int r, int g, int b)
constexpr int qRed(QRgb rgb)
constexpr int qGreen(QRgb rgb)
constexpr int qBlue(QRgb rgb)
std::uniform_real_distribution dist(1, 2.5)
[2]