Changeset 561 for trunk/src/gui/widgets/qeffects.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/widgets/qeffects.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 127 127 QAlphaWidget::~QAlphaWidget() 128 128 { 129 #if def Q_WS_WIN129 #if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) 130 130 // Restore user-defined opacity value 131 if (widget && QSysInfo::WindowsVersion >= QSysInfo::WV_2000 && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)131 if (widget) 132 132 widget->setWindowOpacity(windowOpacity); 133 133 #endif … … 161 161 162 162 showWidget = true; 163 #if defined(Q_OS_WIN) 164 if (QSysInfo::WindowsVersion >= QSysInfo::WV_2000 && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) { 165 qApp->installEventFilter(this); 166 widget->setWindowOpacity(0.0); 167 widget->show(); 163 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) 164 qApp->installEventFilter(this); 165 widget->setWindowOpacity(0.0); 166 widget->show(); 167 connect(&anim, SIGNAL(timeout()), this, SLOT(render())); 168 anim.start(1); 169 #else 170 //This is roughly equivalent to calling setVisible(true) without actually showing the widget 171 widget->setAttribute(Qt::WA_WState_ExplicitShowHide, true); 172 widget->setAttribute(Qt::WA_WState_Hidden, false); 173 174 qApp->installEventFilter(this); 175 176 move(widget->geometry().x(),widget->geometry().y()); 177 resize(widget->size().width(), widget->size().height()); 178 179 frontImage = QPixmap::grabWidget(widget).toImage(); 180 backImage = QPixmap::grabWindow(QApplication::desktop()->winId(), 181 widget->geometry().x(), widget->geometry().y(), 182 widget->geometry().width(), widget->geometry().height()).toImage(); 183 184 if (!backImage.isNull() && checkTime.elapsed() < duration / 2) { 185 mixedImage = backImage.copy(); 186 pm = QPixmap::fromImage(mixedImage); 187 show(); 188 setEnabled(false); 189 168 190 connect(&anim, SIGNAL(timeout()), this, SLOT(render())); 169 191 anim.start(1); 170 } else 192 } else { 193 duration = 0; 194 render(); 195 } 171 196 #endif 172 {173 //This is roughly equivalent to calling setVisible(true) without actually showing the widget174 widget->setAttribute(Qt::WA_WState_ExplicitShowHide, true);175 widget->setAttribute(Qt::WA_WState_Hidden, false);176 177 qApp->installEventFilter(this);178 179 move(widget->geometry().x(),widget->geometry().y());180 resize(widget->size().width(), widget->size().height());181 182 frontImage = QPixmap::grabWidget(widget).toImage();183 backImage = QPixmap::grabWindow(QApplication::desktop()->winId(),184 widget->geometry().x(), widget->geometry().y(),185 widget->geometry().width(), widget->geometry().height()).toImage();186 187 if (!backImage.isNull() && checkTime.elapsed() < duration / 2) {188 mixedImage = backImage.copy();189 pm = QPixmap::fromImage(mixedImage);190 show();191 setEnabled(false);192 193 connect(&anim, SIGNAL(timeout()), this, SLOT(render()));194 anim.start(1);195 } else {196 duration = 0;197 render();198 }199 }200 197 } 201 198 … … 271 268 alpha = 1; 272 269 273 #if defined(Q_OS_WIN) 274 if (QSysInfo::WindowsVersion >= QSysInfo::WV_2000 && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) { 275 if (alpha >= windowOpacity || !showWidget) { 276 anim.stop(); 277 qApp->removeEventFilter(this); 278 widget->setWindowOpacity(windowOpacity); 279 q_blend = 0; 280 deleteLater(); 281 } else { 282 widget->setWindowOpacity(alpha); 283 } 284 } else 285 #endif 270 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) 271 if (alpha >= windowOpacity || !showWidget) { 272 anim.stop(); 273 qApp->removeEventFilter(this); 274 widget->setWindowOpacity(windowOpacity); 275 q_blend = 0; 276 deleteLater(); 277 } else { 278 widget->setWindowOpacity(alpha); 279 } 280 #else 286 281 if (alpha >= 1 || !showWidget) { 287 282 anim.stop(); … … 293 288 setEnabled(true); 294 289 setFocus(); 295 #endif 290 #endif // Q_WS_WIN 296 291 widget->hide(); 297 292 } else { … … 310 305 repaint(); 311 306 } 307 #endif // defined(Q_OS_WIN) && !defined(Q_OS_WINCE) 312 308 } 313 309 … … 589 585 return; 590 586 591 qApp->sendPostedEvents(w, QEvent::Move);592 qApp->sendPostedEvents(w, QEvent::Resize);587 QApplication::sendPostedEvents(w, QEvent::Move); 588 QApplication::sendPostedEvents(w, QEvent::Resize); 593 589 Qt::WindowFlags flags = Qt::ToolTip; 594 590 … … 611 607 return; 612 608 613 qApp->sendPostedEvents(w, QEvent::Move);614 qApp->sendPostedEvents(w, QEvent::Resize);609 QApplication::sendPostedEvents(w, QEvent::Move); 610 QApplication::sendPostedEvents(w, QEvent::Resize); 615 611 616 612 Qt::WindowFlags flags = Qt::ToolTip;
Note:
See TracChangeset
for help on using the changeset viewer.