Changeset 561 for trunk/src/gui/kernel/qdnd_win.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/kernel/qdnd_win.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 ** … … 155 155 qDebug("QOleDataObject::GetData(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium)"); 156 156 #ifndef Q_OS_WINCE 157 charbuf[256] = {0};158 GetClipboardFormatName A(pformatetc->cfFormat, buf, 255);159 qDebug("CF = %d : %s", pformatetc->cfFormat, buf);157 wchar_t buf[256] = {0}; 158 GetClipboardFormatName(pformatetc->cfFormat, buf, 255); 159 qDebug("CF = %d : %s", pformatetc->cfFormat, QString::fromWCharArray(buf)); 160 160 #endif 161 161 #endif … … 399 399 400 400 if (!pm.isNull()) { 401 int x1 = qMin(-hotSpot.x(), 0);402 int x2 = qMax(pm.width() -hotSpot.x(),cpm.width());403 int y1 = qMin(-hotSpot.y(), 0);404 int y2 = qMax(pm.height() -hotSpot.y(),cpm.height());405 406 w = x2 -x1+1;407 h = y2 -y1+1;401 int x1 = qMin(-hotSpot.x(), 0); 402 int x2 = qMax(pm.width() - hotSpot.x(), cpm.width()); 403 int y1 = qMin(-hotSpot.y(), 0); 404 int y2 = qMax(pm.height() - hotSpot.y(), cpm.height()); 405 406 w = x2 - x1 + 1; 407 h = y2 - y1 + 1; 408 408 } 409 409 … … 412 412 QPoint newHotSpot = hotSpot; 413 413 414 #if !defined(Q_OS_WINCE) || defined(GWES_ICONCURS) 415 bool limitedCursorSize = (QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based) 416 || (QSysInfo::WindowsVersion == QSysInfo::WV_NT) 417 || (QSysInfo::WindowsVersion == QSysInfo::WV_CE); 418 419 if (limitedCursorSize) { 420 // Limited cursor size 421 int reqw = GetSystemMetrics(SM_CXCURSOR); 422 int reqh = GetSystemMetrics(SM_CYCURSOR); 423 424 QPoint hotspotInPM = newHotSpot - pmDest; 425 if (reqw < w) { 426 // Not wide enough - move objectpm right 427 qreal r = qreal(newHotSpot.x()) / w; 428 newHotSpot = QPoint(int(r * reqw), newHotSpot.y()); 429 if (newHotSpot.x() + cpm.width() > reqw) 430 newHotSpot.setX(reqw - cpm.width()); 431 432 srcRect = QRect(QPoint(hotspotInPM.x() - newHotSpot.x(), srcRect.top()), QSize(reqw, srcRect.height())); 433 } 434 if (reqh < h) { 435 qreal r = qreal(newHotSpot.y()) / h; 436 newHotSpot = QPoint(newHotSpot.x(), int(r * reqh)); 437 if (newHotSpot.y() + cpm.height() > reqh) 438 newHotSpot.setY(reqh - cpm.height()); 439 440 srcRect = QRect(QPoint(srcRect.left(), hotspotInPM.y() - newHotSpot.y()), QSize(srcRect.width(), reqh)); 441 } 442 // Always use system cursor size 443 w = reqw; 444 h = reqh; 414 #if defined(Q_OS_WINCE) 415 // Limited cursor size 416 int reqw = GetSystemMetrics(SM_CXCURSOR); 417 int reqh = GetSystemMetrics(SM_CYCURSOR); 418 419 QPoint hotspotInPM = newHotSpot - pmDest; 420 if (reqw < w) { 421 // Not wide enough - move objectpm right 422 qreal r = qreal(newHotSpot.x()) / w; 423 newHotSpot = QPoint(int(r * reqw), newHotSpot.y()); 424 if (newHotSpot.x() + cpm.width() > reqw) 425 newHotSpot.setX(reqw - cpm.width()); 426 427 srcRect = QRect(QPoint(hotspotInPM.x() - newHotSpot.x(), srcRect.top()), QSize(reqw, srcRect.height())); 445 428 } 446 #endif 429 if (reqh < h) { 430 qreal r = qreal(newHotSpot.y()) / h; 431 newHotSpot = QPoint(newHotSpot.x(), int(r * reqh)); 432 if (newHotSpot.y() + cpm.height() > reqh) 433 newHotSpot.setY(reqh - cpm.height()); 434 435 srcRect = QRect(QPoint(srcRect.left(), hotspotInPM.y() - newHotSpot.y()), QSize(srcRect.width(), reqh)); 436 } 437 // Always use system cursor size 438 w = reqw; 439 h = reqh; 440 #endif 441 447 442 QPixmap newCursor(w, h); 448 443 if (!pm.isNull()) { … … 550 545 } 551 546 #endif 552 qApp->processEvents();547 QApplication::processEvents(); 553 548 return NOERROR; 554 549 }
Note:
See TracChangeset
for help on using the changeset viewer.