win and mac leftovers removal from gui component mostly

This commit is contained in:
Ivailo Monev 2016-09-16 18:30:11 +00:00
parent cf8f422032
commit 830e37f42e
17 changed files with 73 additions and 1069 deletions

View file

@ -64,11 +64,6 @@
#include "qdialogbuttonbox.h" #include "qdialogbuttonbox.h"
#include "qguiplatformplugin_p.h" #include "qguiplatformplugin_p.h"
#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
# define QT_SMALL_COLORDIALOG
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
//////////// QWellArray BEGIN //////////// QWellArray BEGIN
@ -1096,32 +1091,9 @@ QColorShower::QColorShower(QColorDialog *parent)
gl->setMargin(gl->spacing()); gl->setMargin(gl->spacing());
lab = new QColorShowLabel(this); lab = new QColorShowLabel(this);
#ifdef QT_SMALL_COLORDIALOG
# if defined Q_WS_MAEMO_5
const bool nonTouchUI = false;
# endif
#endif
#ifndef Q_WS_WINCE
#ifdef QT_SMALL_COLORDIALOG
lab->setMinimumHeight(60);
#endif
lab->setMinimumWidth(60); lab->setMinimumWidth(60);
#else
lab->setMinimumWidth(20);
#endif
// In S60, due to small screen and different screen layouts need to re-arrange the widgets.
// For QVGA screens only the comboboxes and color label are visible.
// For nHD screens only color and luminence pickers and color label are visible.
#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lab, 0, 0, -1, 1); gl->addWidget(lab, 0, 0, -1, 1);
#else
if (nonTouchUI)
gl->addWidget(lab, 0, 0, 1, -1);
else
gl->addWidget(lab, 0, 0, -1, 1);
#endif
connect(lab, SIGNAL(colorDropped(QRgb)), this, SIGNAL(newCol(QRgb))); connect(lab, SIGNAL(colorDropped(QRgb)), this, SIGNAL(newCol(QRgb)));
connect(lab, SIGNAL(colorDropped(QRgb)), this, SLOT(setRgb(QRgb))); connect(lab, SIGNAL(colorDropped(QRgb)), this, SLOT(setRgb(QRgb)));
@ -1132,18 +1104,8 @@ QColorShower::QColorShower(QColorDialog *parent)
lblHue->setBuddy(hEd); lblHue->setBuddy(hEd);
#endif #endif
lblHue->setAlignment(Qt::AlignRight|Qt::AlignVCenter); lblHue->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblHue, 0, 1); gl->addWidget(lblHue, 0, 1);
gl->addWidget(hEd, 0, 2); gl->addWidget(hEd, 0, 2);
#else
if (nonTouchUI) {
gl->addWidget(lblHue, 1, 0);
gl->addWidget(hEd, 2, 0);
} else {
lblHue->hide();
hEd->hide();
}
#endif
sEd = new QColSpinBox(this); sEd = new QColSpinBox(this);
lblSat = new QLabel(this); lblSat = new QLabel(this);
@ -1151,18 +1113,8 @@ QColorShower::QColorShower(QColorDialog *parent)
lblSat->setBuddy(sEd); lblSat->setBuddy(sEd);
#endif #endif
lblSat->setAlignment(Qt::AlignRight|Qt::AlignVCenter); lblSat->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblSat, 1, 1); gl->addWidget(lblSat, 1, 1);
gl->addWidget(sEd, 1, 2); gl->addWidget(sEd, 1, 2);
#else
if (nonTouchUI) {
gl->addWidget(lblSat, 1, 1);
gl->addWidget(sEd, 2, 1);
} else {
lblSat->hide();
sEd->hide();
}
#endif
vEd = new QColSpinBox(this); vEd = new QColSpinBox(this);
lblVal = new QLabel(this); lblVal = new QLabel(this);
@ -1170,18 +1122,8 @@ QColorShower::QColorShower(QColorDialog *parent)
lblVal->setBuddy(vEd); lblVal->setBuddy(vEd);
#endif #endif
lblVal->setAlignment(Qt::AlignRight|Qt::AlignVCenter); lblVal->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblVal, 2, 1); gl->addWidget(lblVal, 2, 1);
gl->addWidget(vEd, 2, 2); gl->addWidget(vEd, 2, 2);
#else
if (nonTouchUI) {
gl->addWidget(lblVal, 1, 2);
gl->addWidget(vEd, 2, 2);
} else {
lblVal->hide();
vEd->hide();
}
#endif
rEd = new QColSpinBox(this); rEd = new QColSpinBox(this);
lblRed = new QLabel(this); lblRed = new QLabel(this);
@ -1189,18 +1131,8 @@ QColorShower::QColorShower(QColorDialog *parent)
lblRed->setBuddy(rEd); lblRed->setBuddy(rEd);
#endif #endif
lblRed->setAlignment(Qt::AlignRight|Qt::AlignVCenter); lblRed->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblRed, 0, 3); gl->addWidget(lblRed, 0, 3);
gl->addWidget(rEd, 0, 4); gl->addWidget(rEd, 0, 4);
#else
if (nonTouchUI) {
gl->addWidget(lblRed, 3, 0);
gl->addWidget(rEd, 4, 0);
} else {
lblRed->hide();
rEd->hide();
}
#endif
gEd = new QColSpinBox(this); gEd = new QColSpinBox(this);
lblGreen = new QLabel(this); lblGreen = new QLabel(this);
@ -1208,18 +1140,8 @@ QColorShower::QColorShower(QColorDialog *parent)
lblGreen->setBuddy(gEd); lblGreen->setBuddy(gEd);
#endif #endif
lblGreen->setAlignment(Qt::AlignRight|Qt::AlignVCenter); lblGreen->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblGreen, 1, 3); gl->addWidget(lblGreen, 1, 3);
gl->addWidget(gEd, 1, 4); gl->addWidget(gEd, 1, 4);
#else
if (nonTouchUI) {
gl->addWidget(lblGreen, 3, 1);
gl->addWidget(gEd, 4, 1);
} else {
lblGreen->hide();
gEd->hide();
}
#endif
bEd = new QColSpinBox(this); bEd = new QColSpinBox(this);
lblBlue = new QLabel(this); lblBlue = new QLabel(this);
@ -1227,18 +1149,8 @@ QColorShower::QColorShower(QColorDialog *parent)
lblBlue->setBuddy(bEd); lblBlue->setBuddy(bEd);
#endif #endif
lblBlue->setAlignment(Qt::AlignRight|Qt::AlignVCenter); lblBlue->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(lblBlue, 2, 3); gl->addWidget(lblBlue, 2, 3);
gl->addWidget(bEd, 2, 4); gl->addWidget(bEd, 2, 4);
#else
if (nonTouchUI) {
gl->addWidget(lblBlue, 3, 2);
gl->addWidget(bEd, 4, 2);
} else {
lblBlue->hide();
bEd->hide();
}
#endif
alphaEd = new QColSpinBox(this); alphaEd = new QColSpinBox(this);
alphaLab = new QLabel(this); alphaLab = new QLabel(this);
@ -1246,18 +1158,8 @@ QColorShower::QColorShower(QColorDialog *parent)
alphaLab->setBuddy(alphaEd); alphaLab->setBuddy(alphaEd);
#endif #endif
alphaLab->setAlignment(Qt::AlignRight|Qt::AlignVCenter); alphaLab->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
#if !defined(QT_SMALL_COLORDIALOG)
gl->addWidget(alphaLab, 3, 1, 1, 3); gl->addWidget(alphaLab, 3, 1, 1, 3);
gl->addWidget(alphaEd, 3, 4); gl->addWidget(alphaEd, 3, 4);
#else
if (nonTouchUI) {
gl->addWidget(alphaLab, 1, 3, 3, 1);
gl->addWidget(alphaEd, 4, 3);
} else {
alphaLab->hide();
alphaEd->hide();
}
#endif
alphaEd->hide(); alphaEd->hide();
alphaLab->hide(); alphaLab->hide();
@ -1491,15 +1393,10 @@ void QColorDialogPrivate::init(const QColor &initial)
leftLay = 0; leftLay = 0;
#if defined(Q_WS_WINCE) || defined(QT_SMALL_COLORDIALOG)
smallDisplay = true;
const int lumSpace = 20;
#else
// small displays (e.g. PDAs) cannot fit the full color dialog, // small displays (e.g. PDAs) cannot fit the full color dialog,
// so just use the color picker. // so just use the color picker.
smallDisplay = (QApplication::desktop()->width() < 480 || QApplication::desktop()->height() < 350); smallDisplay = (QApplication::desktop()->width() < 480 || QApplication::desktop()->height() < 350);
const int lumSpace = topLay->spacing() / 2; const int lumSpace = topLay->spacing() / 2;
#endif
if (!smallDisplay) { if (!smallDisplay) {
leftLay = new QVBoxLayout; leftLay = new QVBoxLayout;
@ -1521,12 +1418,6 @@ void QColorDialogPrivate::init(const QColor &initial)
} }
#endif #endif
#if defined(QT_SMALL_COLORDIALOG)
# if defined(Q_WS_MAEMO_5)
const bool nonTouchUI = false;
# endif
#endif
if (!smallDisplay) { if (!smallDisplay) {
standard = new QColorWell(q, 6, 8, stdrgb); standard = new QColorWell(q, 6, 8, stdrgb);
lblBasicColors = new QLabel(q); lblBasicColors = new QLabel(q);
@ -1557,16 +1448,8 @@ void QColorDialogPrivate::init(const QColor &initial)
leftLay->addWidget(addCusBt); leftLay->addWidget(addCusBt);
} else { } else {
// better color picker size for small displays // better color picker size for small displays
#if defined(QT_SMALL_COLORDIALOG)
QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
pWidth = pHeight = qMin(screenSize.width(), screenSize.height());
pHeight -= 20;
if(screenSize.height() > screenSize.width())
pWidth -= 20;
#else
pWidth = 150; pWidth = 150;
pHeight = 100; pHeight = 100;
#endif
custom = 0; custom = 0;
standard = 0; standard = 0;
} }
@ -1583,34 +1466,13 @@ void QColorDialogPrivate::init(const QColor &initial)
cp->setFrameStyle(QFrame::Panel + QFrame::Sunken); cp->setFrameStyle(QFrame::Panel + QFrame::Sunken);
#if defined(QT_SMALL_COLORDIALOG)
if (!nonTouchUI) {
pickLay->addWidget(cp);
cLay->addSpacing(lumSpace);
} else {
cp->hide();
}
#else
cLay->addSpacing(lumSpace); cLay->addSpacing(lumSpace);
cLay->addWidget(cp); cLay->addWidget(cp);
#endif
cLay->addSpacing(lumSpace); cLay->addSpacing(lumSpace);
lp = new QColorLuminancePicker(q); lp = new QColorLuminancePicker(q);
#if defined(QT_SMALL_COLORDIALOG)
QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
const int minDimension = qMin(screenSize.height(), screenSize.width());
//set picker to be finger-usable
int pickerWidth = !nonTouchUI ? minDimension/9 : minDimension/12;
lp->setFixedWidth(pickerWidth);
if (!nonTouchUI)
pickLay->addWidget(lp);
else
lp->hide();
#else
lp->setFixedWidth(20); lp->setFixedWidth(20);
pickLay->addWidget(lp); pickLay->addWidget(lp);
#endif
QObject::connect(cp, SIGNAL(newCol(int,int)), lp, SLOT(setCol(int,int))); QObject::connect(cp, SIGNAL(newCol(int,int)), lp, SLOT(setCol(int,int)));
QObject::connect(lp, SIGNAL(newHsv(int,int,int)), q, SLOT(_q_newHsv(int,int,int))); QObject::connect(lp, SIGNAL(newHsv(int,int,int)), q, SLOT(_q_newHsv(int,int,int)));
@ -1621,13 +1483,7 @@ void QColorDialogPrivate::init(const QColor &initial)
QObject::connect(cs, SIGNAL(newCol(QRgb)), q, SLOT(_q_newColorTypedIn(QRgb))); QObject::connect(cs, SIGNAL(newCol(QRgb)), q, SLOT(_q_newColorTypedIn(QRgb)));
QObject::connect(cs, SIGNAL(currentColorChanged(QColor)), QObject::connect(cs, SIGNAL(currentColorChanged(QColor)),
q, SIGNAL(currentColorChanged(QColor))); q, SIGNAL(currentColorChanged(QColor)));
#if defined(QT_SMALL_COLORDIALOG)
if (!nonTouchUI)
pWidth -= cp->size().width();
topLay->addWidget(cs);
#else
rightLay->addWidget(cs); rightLay->addWidget(cs);
#endif
buttons = new QDialogButtonBox(q); buttons = new QDialogButtonBox(q);
mainLay->addWidget(buttons); mainLay->addWidget(buttons);
@ -1640,10 +1496,6 @@ void QColorDialogPrivate::init(const QColor &initial)
retranslateStrings(); retranslateStrings();
#ifdef Q_WS_MAC
delegate = 0;
#endif
q->setCurrentColor(initial); q->setCurrentColor(initial);
} }

View file

@ -108,42 +108,21 @@
#include "qlibrary.h" #include "qlibrary.h"
#endif #endif
#ifdef Q_WS_WINCE
#include "qdatetime.h" #include "qdatetime.h"
#include "qguifunctions_wince.h"
extern bool qt_wince_is_smartphone(); //qguifunctions_wince.cpp
extern bool qt_wince_is_mobile(); //qguifunctions_wince.cpp
extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp
#endif
#include "qdatetime.h"
#ifdef QT_MAC_USE_COCOA
#include <qt_cocoa_helpers_mac_p.h>
#endif
//#define ALIEN_DEBUG //#define ALIEN_DEBUG
static void initResources() static void initResources()
{ {
#if defined(Q_WS_WINCE)
Q_INIT_RESOURCE_EXTERN(qstyle_wince)
Q_INIT_RESOURCE(qstyle_wince);
#else
Q_INIT_RESOURCE_EXTERN(qstyle) Q_INIT_RESOURCE_EXTERN(qstyle)
Q_INIT_RESOURCE(qstyle); Q_INIT_RESOURCE(qstyle);
#endif
Q_INIT_RESOURCE_EXTERN(qmessagebox) Q_INIT_RESOURCE_EXTERN(qmessagebox)
Q_INIT_RESOURCE(qmessagebox); Q_INIT_RESOURCE(qmessagebox);
#if !defined(QT_NO_PRINTDIALOG) #if !defined(QT_NO_PRINTDIALOG)
Q_INIT_RESOURCE_EXTERN(qprintdialog) Q_INIT_RESOURCE_EXTERN(qprintdialog)
Q_INIT_RESOURCE(qprintdialog); Q_INIT_RESOURCE(qprintdialog);
#endif #endif
#ifdef Q_WS_MAC
Q_INIT_RESOURCE_EXTERN(macresources)
Q_INIT_RESOURCE(macresources);
#endif
} }
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -156,14 +135,7 @@ QApplicationPrivate *QApplicationPrivate::self = 0;
QInputContext *QApplicationPrivate::inputContext = 0; QInputContext *QApplicationPrivate::inputContext = 0;
bool QApplicationPrivate::quitOnLastWindowClosed = true; bool QApplicationPrivate::quitOnLastWindowClosed = true;
#ifdef Q_WS_WINCE
int QApplicationPrivate::autoMaximizeThreshold = -1;
bool QApplicationPrivate::autoSipEnabled = false;
#else
bool QApplicationPrivate::autoSipEnabled = true; bool QApplicationPrivate::autoSipEnabled = true;
#endif
QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::Type type, int flags) QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::Type type, int flags)
: QCoreApplicationPrivate(argc, argv, flags) : QCoreApplicationPrivate(argc, argv, flags)
@ -182,14 +154,11 @@ QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::T
gestureWidget = 0; gestureWidget = 0;
#endif // QT_NO_GESTURES #endif // QT_NO_GESTURES
#if defined(Q_WS_X11) || defined(Q_WS_WIN) #if defined(Q_WS_X11)
move_cursor = 0; move_cursor = 0;
copy_cursor = 0; copy_cursor = 0;
link_cursor = 0; link_cursor = 0;
#endif #endif
#if defined(Q_WS_WIN)
ignore_cursor = 0;
#endif
if (!self) if (!self)
self = this; self = this;
@ -859,17 +828,6 @@ void QApplicationPrivate::initialize()
if (qgetenv("QT_USE_NATIVE_WINDOWS").toInt() > 0) if (qgetenv("QT_USE_NATIVE_WINDOWS").toInt() > 0)
q->setAttribute(Qt::AA_NativeWindows); q->setAttribute(Qt::AA_NativeWindows);
#ifdef Q_WS_WINCE
#ifdef QT_AUTO_MAXIMIZE_THRESHOLD
autoMaximizeThreshold = QT_AUTO_MAXIMIZE_THRESHOLD;
#else
if (qt_wince_is_mobile())
autoMaximizeThreshold = 50;
else
autoMaximizeThreshold = -1;
#endif //QT_AUTO_MAXIMIZE_THRESHOLD
#endif //Q_WS_WINCE
// Set up which span functions should be used in raster engine... // Set up which span functions should be used in raster engine...
qInitDrawhelperAsm(); qInitDrawhelperAsm();
@ -989,14 +947,11 @@ QApplication::~QApplication()
qt_clipboard = 0; qt_clipboard = 0;
#endif #endif
#if defined(Q_WS_X11) || defined(Q_WS_WIN) #if defined(Q_WS_X11)
delete d->move_cursor; d->move_cursor = 0; delete d->move_cursor; d->move_cursor = 0;
delete d->copy_cursor; d->copy_cursor = 0; delete d->copy_cursor; d->copy_cursor = 0;
delete d->link_cursor; d->link_cursor = 0; delete d->link_cursor; d->link_cursor = 0;
#endif #endif
#if defined(Q_WS_WIN)
delete d->ignore_cursor; d->ignore_cursor = 0;
#endif
delete QApplicationPrivate::app_pal; delete QApplicationPrivate::app_pal;
QApplicationPrivate::app_pal = 0; QApplicationPrivate::app_pal = 0;
@ -1220,18 +1175,6 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis
The default is platform dependent. The default is platform dependent.
*/ */
#ifdef Q_WS_WINCE
void QApplication::setAutoMaximizeThreshold(const int threshold)
{
QApplicationPrivate::autoMaximizeThreshold = threshold;
}
int QApplication::autoMaximizeThreshold() const
{
return QApplicationPrivate::autoMaximizeThreshold;
}
#endif
void QApplication::setAutoSipEnabled(const bool enabled) void QApplication::setAutoSipEnabled(const bool enabled)
{ {
QApplicationPrivate::autoSipEnabled = enabled; QApplicationPrivate::autoSipEnabled = enabled;
@ -2236,9 +2179,6 @@ bool QApplication::event(QEvent *e)
} else if(e->type() == QEvent::LanguageChange) { } else if(e->type() == QEvent::LanguageChange) {
#ifndef QT_NO_TRANSLATION #ifndef QT_NO_TRANSLATION
setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight); setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);
#endif
#if defined(QT_MAC_USE_COCOA)
qt_mac_post_retranslateAppMenu();
#endif #endif
QWidgetList list = topLevelWidgets(); QWidgetList list = topLevelWidgets();
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
@ -2246,7 +2186,6 @@ bool QApplication::event(QEvent *e)
if (!(w->windowType() == Qt::Desktop)) if (!(w->windowType() == Qt::Desktop))
postEvent(w, new QEvent(QEvent::LanguageChange)); postEvent(w, new QEvent(QEvent::LanguageChange));
} }
#ifndef Q_OS_WIN
} else if (e->type() == QEvent::LocaleChange) { } else if (e->type() == QEvent::LocaleChange) {
// on Windows the event propagation is taken care by the // on Windows the event propagation is taken care by the
// WM_SETTINGCHANGE event handler. // WM_SETTINGCHANGE event handler.
@ -2258,7 +2197,6 @@ bool QApplication::event(QEvent *e)
w->d_func()->setLocale_helper(QLocale(), true); w->d_func()->setLocale_helper(QLocale(), true);
} }
} }
#endif
} else if (e->type() == QEvent::Timer) { } else if (e->type() == QEvent::Timer) {
QTimerEvent *te = static_cast<QTimerEvent*>(e); QTimerEvent *te = static_cast<QTimerEvent*>(e);
Q_ASSERT(te != 0); Q_ASSERT(te != 0);
@ -2350,9 +2288,7 @@ void QApplication::setActiveWindow(QWidget* act)
} }
} }
#if !defined(Q_WS_MAC)
QWidget *previousActiveWindow = QApplicationPrivate::active_window; QWidget *previousActiveWindow = QApplicationPrivate::active_window;
#endif
QApplicationPrivate::active_window = window; QApplicationPrivate::active_window = window;
if (QApplicationPrivate::active_window) { if (QApplicationPrivate::active_window) {
@ -2374,12 +2310,10 @@ void QApplication::setActiveWindow(QWidget* act)
QEvent windowActivate(QEvent::WindowActivate); QEvent windowActivate(QEvent::WindowActivate);
QEvent windowDeactivate(QEvent::WindowDeactivate); QEvent windowDeactivate(QEvent::WindowDeactivate);
#if !defined(Q_WS_MAC)
if (!previousActiveWindow) { if (!previousActiveWindow) {
QEvent appActivate(QEvent::ApplicationActivate); QEvent appActivate(QEvent::ApplicationActivate);
sendSpontaneousEvent(qApp, &appActivate); sendSpontaneousEvent(qApp, &appActivate);
} }
#endif
for (int i = 0; i < toBeActivated.size(); ++i) { for (int i = 0; i < toBeActivated.size(); ++i) {
QWidget *w = toBeActivated.at(i); QWidget *w = toBeActivated.at(i);
@ -2387,25 +2321,16 @@ void QApplication::setActiveWindow(QWidget* act)
sendSpontaneousEvent(w, &activationChange); sendSpontaneousEvent(w, &activationChange);
} }
#ifdef QT_MAC_USE_COCOA
// In case the user clicked on a child window, we need to
// reestablish the stacking order of the window so
// it pops in front of other child windows in cocoa:
qt_cocoaStackChildWindowOnTopOfOtherChildren(window);
#endif
for(int i = 0; i < toBeDeactivated.size(); ++i) { for(int i = 0; i < toBeDeactivated.size(); ++i) {
QWidget *w = toBeDeactivated.at(i); QWidget *w = toBeDeactivated.at(i);
sendSpontaneousEvent(w, &windowDeactivate); sendSpontaneousEvent(w, &windowDeactivate);
sendSpontaneousEvent(w, &activationChange); sendSpontaneousEvent(w, &activationChange);
} }
#if !defined(Q_WS_MAC)
if (!QApplicationPrivate::active_window) { if (!QApplicationPrivate::active_window) {
QEvent appDeactivate(QEvent::ApplicationDeactivate); QEvent appDeactivate(QEvent::ApplicationDeactivate);
sendSpontaneousEvent(qApp, &appDeactivate); sendSpontaneousEvent(qApp, &appDeactivate);
} }
#endif
if (QApplicationPrivate::popupWidgets == 0) { // !inPopupMode() if (QApplicationPrivate::popupWidgets == 0) { // !inPopupMode()
// then focus events // then focus events
@ -2551,7 +2476,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) {
for (int i = 0; i < leaveList.size(); ++i) { for (int i = 0; i < leaveList.size(); ++i) {
w = leaveList.at(i); w = leaveList.at(i);
if (!QApplication::activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) { if (!QApplication::activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) {
#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) #if defined(Q_WS_X11)
if (leaveAfterRelease == w) if (leaveAfterRelease == w)
leaveAfterRelease = 0; leaveAfterRelease = 0;
#endif #endif
@ -2626,9 +2551,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) {
} else } else
#endif #endif
{ {
#if defined(Q_WS_WIN) #if defined(Q_WS_X11)
qt_win_set_cursor(cursorWidget, true);
#elif defined(Q_WS_X11)
qt_x11_enforce_cursor(cursorWidget, true); qt_x11_enforce_cursor(cursorWidget, true);
#endif #endif
} }
@ -2664,12 +2587,6 @@ bool QApplicationPrivate::isBlockedByModal(QWidget *widget)
return false; return false;
w = w->parentWidget(); w = w->parentWidget();
} }
#ifdef Q_WS_WIN
if ((widget->testAttribute(Qt::WA_WState_Created) || widget->data->winid)
&& (modalWidget->testAttribute(Qt::WA_WState_Created) || modalWidget->data->winid)
&& IsChild(modalWidget->data->winid, widget->data->winid))
return false;
#endif
} }
Qt::WindowModality windowModality = modalWidget->windowModality(); Qt::WindowModality windowModality = modalWidget->windowModality();
@ -2932,7 +2849,7 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event,
return result; return result;
} }
#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) #if defined(Q_WS_X11)
/* /*
This function should only be called when the widget changes visibility, i.e. This function should only be called when the widget changes visibility, i.e.
when the \a widget is shown, hidden or deleted. This function does nothing when the \a widget is shown, hidden or deleted. This function does nothing
@ -2987,7 +2904,7 @@ void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget)
sendMouseEvent(widgetUnderCursor, &e, widgetUnderCursor, tlw, &qt_button_down, qt_last_mouse_receiver); sendMouseEvent(widgetUnderCursor, &e, widgetUnderCursor, tlw, &qt_button_down, qt_last_mouse_receiver);
#endif // QT_NO_CURSOR #endif // QT_NO_CURSOR
} }
#endif // Q_WS_WIN || Q_WS_X11 || Q_WS_MAC #endif // Q_WS_X11
/*! /*!
Returns the desktop widget (also called the root window). Returns the desktop widget (also called the root window).
@ -4240,14 +4157,12 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e)
if (receiver->isWidgetType()) { if (receiver->isWidgetType()) {
QWidget *widget = static_cast<QWidget *>(receiver); QWidget *widget = static_cast<QWidget *>(receiver);
#if !defined(Q_WS_WINCE) || (defined(GWES_ICONCURS) && !defined(QT_NO_CURSOR))
// toggle HasMouse widget state on enter and leave // toggle HasMouse widget state on enter and leave
if ((e->type() == QEvent::Enter || e->type() == QEvent::DragEnter) && if ((e->type() == QEvent::Enter || e->type() == QEvent::DragEnter) &&
(!QApplication::activePopupWidget() || QApplication::activePopupWidget() == widget->window())) (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == widget->window()))
widget->setAttribute(Qt::WA_UnderMouse, true); widget->setAttribute(Qt::WA_UnderMouse, true);
else if (e->type() == QEvent::Leave || e->type() == QEvent::DragLeave) else if (e->type() == QEvent::Leave || e->type() == QEvent::DragLeave)
widget->setAttribute(Qt::WA_UnderMouse, false); widget->setAttribute(Qt::WA_UnderMouse, false);
#endif
if (QLayout *layout=widget->d_func()->layout) { if (QLayout *layout=widget->d_func()->layout) {
layout->widgetEvent(e); layout->widgetEvent(e);
@ -4556,174 +4471,6 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e)
\sa isPhase2() \sa isPhase2()
*/ */
/*****************************************************************************
Stubbed session management support
*****************************************************************************/
#ifndef QT_NO_SESSIONMANAGER
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
#if defined(Q_OS_WINCE)
HRESULT qt_CoCreateGuid(GUID* guid)
{
// We will use the following information to create the GUID
// 1. absolute path to application
wchar_t tempFilename[MAX_PATH];
if (!GetModuleFileName(0, tempFilename, MAX_PATH))
return S_FALSE;
unsigned int hash = qHash(QString::fromWCharArray(tempFilename));
guid->Data1 = hash;
// 2. creation time of file
QFileInfo info(QString::fromWCharArray(tempFilename));
guid->Data2 = qHash(info.created().toTime_t());
// 3. current system time
guid->Data3 = qHash(QDateTime::currentDateTime().toTime_t());
return S_OK;
}
#if !defined(OLE32_MCOMGUID) || defined(QT_WINCE_FORCE_CREATE_GUID)
#define CoCreateGuid qt_CoCreateGuid
#endif
#endif
class QSessionManagerPrivate : public QObjectPrivate
{
public:
QStringList restartCommand;
QStringList discardCommand;
QString sessionId;
QString sessionKey;
QSessionManager::RestartHint restartHint;
};
QSessionManager* qt_session_manager_self = 0;
QSessionManager::QSessionManager(QApplication * app, QString &id, QString &key)
: QObject(*new QSessionManagerPrivate, app)
{
Q_D(QSessionManager);
setObjectName(QLatin1String("qt_sessionmanager"));
qt_session_manager_self = this;
#if defined(Q_WS_WIN)
wchar_t guidstr[40];
GUID guid;
CoCreateGuid(&guid);
StringFromGUID2(guid, guidstr, 40);
id = QString::fromWCharArray(guidstr);
CoCreateGuid(&guid);
StringFromGUID2(guid, guidstr, 40);
key = QString::fromWCharArray(guidstr);
#endif
d->sessionId = id;
d->sessionKey = key;
d->restartHint = RestartIfRunning;
}
QSessionManager::~QSessionManager()
{
qt_session_manager_self = 0;
}
QString QSessionManager::sessionId() const
{
Q_D(const QSessionManager);
return d->sessionId;
}
QString QSessionManager::sessionKey() const
{
Q_D(const QSessionManager);
return d->sessionKey;
}
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
void* QSessionManager::handle() const
{
return 0;
}
#endif
#if !defined(Q_WS_WIN)
bool QSessionManager::allowsInteraction()
{
return true;
}
bool QSessionManager::allowsErrorInteraction()
{
return true;
}
void QSessionManager::release()
{
}
void QSessionManager::cancel()
{
}
#endif
void QSessionManager::setRestartHint(QSessionManager::RestartHint hint)
{
Q_D(QSessionManager);
d->restartHint = hint;
}
QSessionManager::RestartHint QSessionManager::restartHint() const
{
Q_D(const QSessionManager);
return d->restartHint;
}
void QSessionManager::setRestartCommand(const QStringList& command)
{
Q_D(QSessionManager);
d->restartCommand = command;
}
QStringList QSessionManager::restartCommand() const
{
Q_D(const QSessionManager);
return d->restartCommand;
}
void QSessionManager::setDiscardCommand(const QStringList& command)
{
Q_D(QSessionManager);
d->discardCommand = command;
}
QStringList QSessionManager::discardCommand() const
{
Q_D(const QSessionManager);
return d->discardCommand;
}
void QSessionManager::setManagerProperty(const QString&, const QString&)
{
}
void QSessionManager::setManagerProperty(const QString&, const QStringList&)
{
}
bool QSessionManager::isPhase2() const
{
return false;
}
void QSessionManager::requestPhase2()
{
}
#endif
#endif // QT_NO_SESSIONMANAGER
/*!
\fn Qt::MacintoshVersion QApplication::macVersion()
Use QSysInfo::MacintoshVersion instead.
*/
/*! /*!
\fn bool QApplication::hasGlobalMouseTracking() \fn bool QApplication::hasGlobalMouseTracking()
@ -5186,7 +4933,7 @@ QInputContext *QApplication::inputContext() const
//Returns the current platform used by keyBindings //Returns the current platform used by keyBindings
uint QApplicationPrivate::currentPlatform(){ uint QApplicationPrivate::currentPlatform(){
uint platform = KB_Win; uint platform = KB_None;
#if defined Q_WS_X11 #if defined Q_WS_X11
platform = KB_X11; platform = KB_X11;
if (X11->desktopEnvironment == DE_KDE) if (X11->desktopEnvironment == DE_KDE)
@ -5621,17 +5368,12 @@ QGestureManager* QGestureManager::instance()
// These pixmaps approximate the images in the Windows User Interface Guidelines. // These pixmaps approximate the images in the Windows User Interface Guidelines.
// XPM // XPM
#if defined(Q_WS_X11) || defined(Q_WS_WIN) #if defined(Q_WS_X11)
static const char * const move_xpm[] = { static const char * const move_xpm[] = {
"11 20 3 1", "11 20 3 1",
". c None", ". c None",
#if defined(Q_WS_WIN)
"a c #000000",
"X c #FFFFFF", // Windows cursor is traditionally white
#else
"a c #FFFFFF", "a c #FFFFFF",
"X c #000000", // X11 cursor is traditionally black "X c #000000", // X11 cursor is traditionally black
#endif
"aa.........", "aa.........",
"aXa........", "aXa........",
"aXXa.......", "aXXa.......",
@ -5653,73 +5395,12 @@ static const char * const move_xpm[] = {
".......aXXa", ".......aXXa",
"........aa."}; "........aa."};
#ifdef Q_WS_WIN
/* XPM */
static const char * const ignore_xpm[] = {
"24 30 3 1",
". c None",
"a c #000000",
"X c #FFFFFF",
"aa......................",
"aXa.....................",
"aXXa....................",
"aXXXa...................",
"aXXXXa..................",
"aXXXXXa.................",
"aXXXXXXa................",
"aXXXXXXXa...............",
"aXXXXXXXXa..............",
"aXXXXXXXXXa.............",
"aXXXXXXaaaa.............",
"aXXXaXXa................",
"aXXaaXXa................",
"aXa..aXXa...............",
"aa...aXXa...............",
"a.....aXXa..............",
"......aXXa.....XXXX.....",
".......aXXa..XXaaaaXX...",
".......aXXa.XaaaaaaaaX..",
"........aa.XaaaXXXXaaaX.",
"...........XaaaaX..XaaX.",
"..........XaaXaaaX..XaaX",
"..........XaaXXaaaX.XaaX",
"..........XaaX.XaaaXXaaX",
"..........XaaX..XaaaXaaX",
"...........XaaX..XaaaaX.",
"...........XaaaXXXXaaaX.",
"............XaaaaaaaaX..",
".............XXaaaaXX...",
"...............XXXX....."};
#endif
/* XPM */ /* XPM */
static const char * const copy_xpm[] = { static const char * const copy_xpm[] = {
"24 30 3 1", "24 30 3 1",
". c None", ". c None",
"a c #000000", "a c #000000",
"X c #FFFFFF", "X c #FFFFFF",
#if defined(Q_WS_WIN) // Windows cursor is traditionally white
"aa......................",
"aXa.....................",
"aXXa....................",
"aXXXa...................",
"aXXXXa..................",
"aXXXXXa.................",
"aXXXXXXa................",
"aXXXXXXXa...............",
"aXXXXXXXXa..............",
"aXXXXXXXXXa.............",
"aXXXXXXaaaa.............",
"aXXXaXXa................",
"aXXaaXXa................",
"aXa..aXXa...............",
"aa...aXXa...............",
"a.....aXXa..............",
"......aXXa..............",
".......aXXa.............",
".......aXXa.............",
"........aa...aaaaaaaaaaa",
#else
"XX......................", "XX......................",
"XaX.....................", "XaX.....................",
"XaaX....................", "XaaX....................",
@ -5740,7 +5421,6 @@ static const char * const copy_xpm[] = {
".......XaaX.............", ".......XaaX.............",
".......XaaX.............", ".......XaaX.............",
"........XX...aaaaaaaaaaa", "........XX...aaaaaaaaaaa",
#endif
".............aXXXXXXXXXa", ".............aXXXXXXXXXa",
".............aXXXXXXXXXa", ".............aXXXXXXXXXa",
".............aXXXXaXXXXa", ".............aXXXXaXXXXa",
@ -5758,28 +5438,6 @@ static const char * const link_xpm[] = {
". c None", ". c None",
"a c #000000", "a c #000000",
"X c #FFFFFF", "X c #FFFFFF",
#if defined(Q_WS_WIN) // Windows cursor is traditionally white
"aa......................",
"aXa.....................",
"aXXa....................",
"aXXXa...................",
"aXXXXa..................",
"aXXXXXa.................",
"aXXXXXXa................",
"aXXXXXXXa...............",
"aXXXXXXXXa..............",
"aXXXXXXXXXa.............",
"aXXXXXXaaaa.............",
"aXXXaXXa................",
"aXXaaXXa................",
"aXa..aXXa...............",
"aa...aXXa...............",
"a.....aXXa..............",
"......aXXa..............",
".......aXXa.............",
".......aXXa.............",
"........aa...aaaaaaaaaaa",
#else
"XX......................", "XX......................",
"XaX.....................", "XaX.....................",
"XaaX....................", "XaaX....................",
@ -5800,7 +5458,6 @@ static const char * const link_xpm[] = {
".......XaaX.............", ".......XaaX.............",
".......XaaX.............", ".......XaaX.............",
"........XX...aaaaaaaaaaa", "........XX...aaaaaaaaaaa",
#endif
".............aXXXXXXXXXa", ".............aXXXXXXXXXa",
".............aXXXaaaaXXa", ".............aXXXaaaaXXa",
".............aXXXXaaaXXa", ".............aXXXXaaaXXa",
@ -5811,18 +5468,15 @@ static const char * const link_xpm[] = {
".............aXXXaXXXXXa", ".............aXXXaXXXXXa",
".............aXXXXXXXXXa", ".............aXXXXXXXXXa",
".............aaaaaaaaaaa"}; ".............aaaaaaaaaaa"};
#endif // defined(Q_WS_X11) || defined(Q_WS_WIN) #endif // defined(Q_WS_X11)
QPixmap QApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) QPixmap QApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape)
{ {
#if defined(Q_WS_X11) || defined(Q_WS_WIN) #if defined(Q_WS_X11)
if (!move_cursor) { if (!move_cursor) {
move_cursor = new QPixmap((const char **)move_xpm); move_cursor = new QPixmap((const char **)move_xpm);
copy_cursor = new QPixmap((const char **)copy_xpm); copy_cursor = new QPixmap((const char **)copy_xpm);
link_cursor = new QPixmap((const char **)link_xpm); link_cursor = new QPixmap((const char **)link_xpm);
#ifdef Q_WS_WIN
ignore_cursor = new QPixmap((const char **)ignore_xpm);
#endif
} }
switch (cshape) { switch (cshape) {
@ -5832,10 +5486,6 @@ QPixmap QApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape)
return *copy_cursor; return *copy_cursor;
case Qt::DragLinkCursor: case Qt::DragLinkCursor:
return *link_cursor; return *link_cursor;
#ifdef Q_WS_WIN
case Qt::ForbiddenCursor:
return *ignore_cursor;
#endif
default: default:
break; break;
} }

View file

@ -88,16 +88,6 @@ extern bool qt_is_gui_used;
extern QClipboard *qt_clipboard; extern QClipboard *qt_clipboard;
#endif #endif
#if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN) || defined(Q_OS_WINCE)
extern QSysInfo::WinVersion qt_winver;
enum { QT_TABLET_NPACKETQSIZE = 128 };
# ifdef Q_OS_WINCE
extern DWORD qt_cever;
# endif
#elif defined (Q_OS_MAC)
extern QSysInfo::MacVersion qt_macver;
#endif
#ifndef QT_NO_TABLET #ifndef QT_NO_TABLET
struct QTabletDeviceData struct QTabletDeviceData
{ {
@ -212,13 +202,11 @@ public:
#endif #endif
enum KeyPlatform { enum KeyPlatform {
KB_Win = 1, KB_None = 2,
KB_Mac = 2,
KB_X11 = 4, KB_X11 = 4,
KB_KDE = 8, KB_KDE = 8,
KB_Gnome = 16, KB_Gnome = 16,
KB_CDE = 32, KB_CDE = 32,
KB_S60 = 64,
KB_All = 0xffff KB_All = 0xffff
}; };

View file

@ -161,7 +161,6 @@ QClipboard::QClipboard(QObject *parent)
} }
#endif #endif
#ifndef Q_WS_WIN32
/*! /*!
\internal \internal
@ -173,7 +172,6 @@ QClipboard::QClipboard(QObject *parent)
QClipboard::~QClipboard() QClipboard::~QClipboard()
{ {
} }
#endif
/*! /*!
\fn void QClipboard::changed(QClipboard::Mode mode) \fn void QClipboard::changed(QClipboard::Mode mode)

View file

@ -52,9 +52,6 @@ QT_BEGIN_NAMESPACE
class QVariant; class QVariant;
/*
### The fake cursor has to go first with old qdoc.
*/
#ifdef QT_NO_CURSOR #ifdef QT_NO_CURSOR
class Q_GUI_EXPORT QCursor class Q_GUI_EXPORT QCursor
@ -67,18 +64,12 @@ private:
QCursor(); QCursor();
}; };
#endif // QT_NO_CURSOR #else // QT_NO_CURSOR
#ifndef QT_NO_CURSOR
class QCursorData; class QCursorData;
class QBitmap; class QBitmap;
class QPixmap; class QPixmap;
#if defined(Q_WS_MAC)
void qt_mac_set_cursor(const QCursor *c);
#endif
class Q_GUI_EXPORT QCursor class Q_GUI_EXPORT QCursor
{ {
public: public:
@ -107,25 +98,14 @@ public:
static void setPos(int x, int y); static void setPos(int x, int y);
inline static void setPos(const QPoint &p) { setPos(p.x(), p.y()); } inline static void setPos(const QPoint &p) { setPos(p.x(), p.y()); }
#if defined(Q_WS_X11)
#if defined(Q_WS_WIN)
HCURSOR handle() const;
QCursor(HCURSOR cursor);
#elif defined(Q_WS_X11)
Qt::HANDLE handle() const; Qt::HANDLE handle() const;
QCursor(Qt::HANDLE cursor); QCursor(Qt::HANDLE cursor);
static int x11Screen(); static int x11Screen();
#elif defined(Q_WS_MAC)
Qt::HANDLE handle() const;
#endif #endif
private: private:
QCursorData *d; QCursorData *d;
#if defined(Q_WS_MAC)
friend void *qt_mac_nsCursorForQCursor(const QCursor &c);
friend void qt_mac_set_cursor(const QCursor *c);
friend void qt_mac_updateCursorWithWidgetUnderMouse(QWidget *widgetUnderMouse);
#endif
}; };

View file

@ -58,21 +58,12 @@
#include "QtCore/qnamespace.h" #include "QtCore/qnamespace.h"
#include "QtGui/qpixmap.h" #include "QtGui/qpixmap.h"
# if defined (Q_WS_MAC) #if defined(Q_WS_X11)
# include "qt_mac_p.h"
# elif defined(Q_WS_X11)
# include "qt_x11_p.h" # include "qt_x11_p.h"
# elif defined(Q_WS_WIN)
# include "QtCore/qt_windows.h"
#endif #endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#if defined (Q_WS_MAC)
void *qt_mac_nsCursorForQCursor(const QCursor &c);
class QMacAnimateCursor;
#endif
class QBitmap; class QBitmap;
class QCursorData { class QCursorData {
public: public:
@ -87,29 +78,10 @@ public:
QBitmap *bm, *bmm; QBitmap *bm, *bmm;
QPixmap pixmap; QPixmap pixmap;
short hx, hy; short hx, hy;
#if defined (Q_WS_MAC) #if defined (Q_WS_X11)
int mId;
#endif
#if defined (Q_WS_WIN)
HCURSOR hcurs;
#elif defined (Q_WS_X11)
XColor fg, bg; XColor fg, bg;
Cursor hcurs; Cursor hcurs;
Pixmap pm, pmm; Pixmap pm, pmm;
#elif defined (Q_WS_MAC)
enum { TYPE_None, TYPE_ImageCursor, TYPE_ThemeCursor } type;
union {
struct {
uint my_cursor:1;
void *nscursor;
} cp;
struct {
QMacAnimateCursor *anim;
ThemeCursor curs;
} tc;
} curs;
void initCursorFromBitmap();
void initCursorFromPixmap();
#endif #endif
static bool initialized; static bool initialized;
void update(); void update();

View file

@ -643,41 +643,32 @@ static const struct {
const QKeyBinding QKeySequencePrivate::keyBindings[] = { const QKeyBinding QKeySequencePrivate::keyBindings[] = {
// StandardKey Priority Key Sequence Platforms // StandardKey Priority Key Sequence Platforms
{QKeySequence::Back, 0, Qt::Key_Backspace, QApplicationPrivate::KB_Win},
{QKeySequence::InsertParagraphSeparator,0, Qt::Key_Return, QApplicationPrivate::KB_All}, {QKeySequence::InsertParagraphSeparator,0, Qt::Key_Return, QApplicationPrivate::KB_All},
{QKeySequence::InsertParagraphSeparator,0, Qt::Key_Enter, QApplicationPrivate::KB_All}, {QKeySequence::InsertParagraphSeparator,0, Qt::Key_Enter, QApplicationPrivate::KB_All},
{QKeySequence::Delete, 1, Qt::Key_Delete, QApplicationPrivate::KB_All}, {QKeySequence::Delete, 1, Qt::Key_Delete, QApplicationPrivate::KB_All},
{QKeySequence::MoveToStartOfLine, 0, Qt::Key_Home, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60}, {QKeySequence::MoveToStartOfLine, 0, Qt::Key_Home, QApplicationPrivate::KB_X11},
{QKeySequence::MoveToStartOfDocument, 0, Qt::Key_Home, QApplicationPrivate::KB_Mac}, {QKeySequence::MoveToEndOfLine, 0, Qt::Key_End, QApplicationPrivate::KB_X11},
{QKeySequence::MoveToEndOfLine, 0, Qt::Key_End, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60},
{QKeySequence::MoveToEndOfDocument, 0, Qt::Key_End, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToPreviousChar, 0, Qt::Key_Left, QApplicationPrivate::KB_All}, {QKeySequence::MoveToPreviousChar, 0, Qt::Key_Left, QApplicationPrivate::KB_All},
{QKeySequence::MoveToPreviousLine, 0, Qt::Key_Up, QApplicationPrivate::KB_All}, {QKeySequence::MoveToPreviousLine, 0, Qt::Key_Up, QApplicationPrivate::KB_All},
{QKeySequence::MoveToNextChar, 0, Qt::Key_Right, QApplicationPrivate::KB_All}, {QKeySequence::MoveToNextChar, 0, Qt::Key_Right, QApplicationPrivate::KB_All},
{QKeySequence::MoveToNextLine, 0, Qt::Key_Down, QApplicationPrivate::KB_All}, {QKeySequence::MoveToNextLine, 0, Qt::Key_Down, QApplicationPrivate::KB_All},
{QKeySequence::MoveToPreviousPage, 1, Qt::Key_PageUp, QApplicationPrivate::KB_All}, {QKeySequence::MoveToPreviousPage, 1, Qt::Key_PageUp, QApplicationPrivate::KB_All},
{QKeySequence::MoveToNextPage, 1, Qt::Key_PageDown, QApplicationPrivate::KB_All}, {QKeySequence::MoveToNextPage, 1, Qt::Key_PageDown, QApplicationPrivate::KB_All},
{QKeySequence::HelpContents, 0, Qt::Key_F1, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::HelpContents, 0, Qt::Key_F1, QApplicationPrivate::KB_X11},
{QKeySequence::HelpContents, 0, Qt::Key_F2, QApplicationPrivate::KB_S60},
{QKeySequence::FindNext, 0, Qt::Key_F3, QApplicationPrivate::KB_X11}, {QKeySequence::FindNext, 0, Qt::Key_F3, QApplicationPrivate::KB_X11},
{QKeySequence::FindNext, 1, Qt::Key_F3, QApplicationPrivate::KB_Win}, {QKeySequence::Refresh, 0, Qt::Key_F5, QApplicationPrivate::KB_X11},
{QKeySequence::Refresh, 0, Qt::Key_F5, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11},
{QKeySequence::Undo, 0, Qt::Key_F14, QApplicationPrivate::KB_X11}, //Undo on sun keyboards {QKeySequence::Undo, 0, Qt::Key_F14, QApplicationPrivate::KB_X11}, //Undo on sun keyboards
{QKeySequence::Copy, 0, Qt::Key_F16, QApplicationPrivate::KB_X11}, //Copy on sun keyboards {QKeySequence::Copy, 0, Qt::Key_F16, QApplicationPrivate::KB_X11}, //Copy on sun keyboards
{QKeySequence::Paste, 0, Qt::Key_F18, QApplicationPrivate::KB_X11}, //Paste on sun keyboards {QKeySequence::Paste, 0, Qt::Key_F18, QApplicationPrivate::KB_X11}, //Paste on sun keyboards
{QKeySequence::Cut, 0, Qt::Key_F20, QApplicationPrivate::KB_X11}, //Cut on sun keyboards {QKeySequence::Cut, 0, Qt::Key_F20, QApplicationPrivate::KB_X11}, //Cut on sun keyboards
{QKeySequence::PreviousChild, 0, Qt::Key_Back, QApplicationPrivate::KB_All}, {QKeySequence::PreviousChild, 0, Qt::Key_Back, QApplicationPrivate::KB_All},
{QKeySequence::NextChild, 0, Qt::Key_Forward, QApplicationPrivate::KB_All}, {QKeySequence::NextChild, 0, Qt::Key_Forward, QApplicationPrivate::KB_All},
{QKeySequence::Forward, 0, Qt::SHIFT | Qt::Key_Backspace, QApplicationPrivate::KB_Win},
{QKeySequence::Delete, 0, Qt::SHIFT | Qt::Key_Backspace, QApplicationPrivate::KB_S60},
{QKeySequence::InsertLineSeparator, 0, Qt::SHIFT | Qt::Key_Return, QApplicationPrivate::KB_All}, {QKeySequence::InsertLineSeparator, 0, Qt::SHIFT | Qt::Key_Return, QApplicationPrivate::KB_All},
{QKeySequence::InsertLineSeparator, 0, Qt::SHIFT | Qt::Key_Enter, QApplicationPrivate::KB_All}, {QKeySequence::InsertLineSeparator, 0, Qt::SHIFT | Qt::Key_Enter, QApplicationPrivate::KB_All},
{QKeySequence::Paste, 0, Qt::SHIFT | Qt::Key_Insert, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::Paste, 0, Qt::SHIFT | Qt::Key_Insert, QApplicationPrivate::KB_X11},
{QKeySequence::Cut, 0, Qt::SHIFT | Qt::Key_Delete, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, //## Check if this should work on mac {QKeySequence::Cut, 0, Qt::SHIFT | Qt::Key_Delete, QApplicationPrivate::KB_X11}, //## Check if this should work on mac
{QKeySequence::SelectStartOfLine, 0, Qt::SHIFT | Qt::Key_Home, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60}, {QKeySequence::SelectStartOfLine, 0, Qt::SHIFT | Qt::Key_Home, QApplicationPrivate::KB_X11},
{QKeySequence::SelectStartOfDocument, 0, Qt::SHIFT | Qt::Key_Home, QApplicationPrivate::KB_Mac}, {QKeySequence::SelectEndOfLine, 0, Qt::SHIFT | Qt::Key_End, QApplicationPrivate::KB_X11},
{QKeySequence::SelectEndOfLine, 0, Qt::SHIFT | Qt::Key_End, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60},
{QKeySequence::SelectEndOfDocument, 0, Qt::SHIFT | Qt::Key_End, QApplicationPrivate::KB_Mac},
{QKeySequence::SelectPreviousChar, 0, Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_All}, {QKeySequence::SelectPreviousChar, 0, Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_All},
{QKeySequence::SelectPreviousLine, 0, Qt::SHIFT | Qt::Key_Up, QApplicationPrivate::KB_All}, {QKeySequence::SelectPreviousLine, 0, Qt::SHIFT | Qt::Key_Up, QApplicationPrivate::KB_All},
{QKeySequence::SelectNextChar, 0, Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_All}, {QKeySequence::SelectNextChar, 0, Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_All},
@ -686,110 +677,52 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::SelectNextPage, 0, Qt::SHIFT | Qt::Key_PageDown, QApplicationPrivate::KB_All}, {QKeySequence::SelectNextPage, 0, Qt::SHIFT | Qt::Key_PageDown, QApplicationPrivate::KB_All},
{QKeySequence::WhatsThis, 1, Qt::SHIFT | Qt::Key_F1, QApplicationPrivate::KB_All}, {QKeySequence::WhatsThis, 1, Qt::SHIFT | Qt::Key_F1, QApplicationPrivate::KB_All},
{QKeySequence::FindPrevious, 0, Qt::SHIFT | Qt::Key_F3, QApplicationPrivate::KB_X11}, {QKeySequence::FindPrevious, 0, Qt::SHIFT | Qt::Key_F3, QApplicationPrivate::KB_X11},
{QKeySequence::FindPrevious, 1, Qt::SHIFT | Qt::Key_F3, QApplicationPrivate::KB_Win},
{QKeySequence::ZoomIn, 1, Qt::CTRL | Qt::Key_Plus, QApplicationPrivate::KB_All}, {QKeySequence::ZoomIn, 1, Qt::CTRL | Qt::Key_Plus, QApplicationPrivate::KB_All},
{QKeySequence::NextChild, 0, Qt::CTRL | Qt::Key_Comma, QApplicationPrivate::KB_KDE}, {QKeySequence::NextChild, 0, Qt::CTRL | Qt::Key_Comma, QApplicationPrivate::KB_KDE},
{QKeySequence::Preferences, 0, Qt::CTRL | Qt::Key_Comma, QApplicationPrivate::KB_Mac},
{QKeySequence::ZoomOut, 1, Qt::CTRL | Qt::Key_Minus, QApplicationPrivate::KB_All}, {QKeySequence::ZoomOut, 1, Qt::CTRL | Qt::Key_Minus, QApplicationPrivate::KB_All},
{QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::Key_Period, QApplicationPrivate::KB_KDE}, {QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::Key_Period, QApplicationPrivate::KB_KDE},
{QKeySequence::HelpContents, 1, Qt::CTRL | Qt::Key_Question, QApplicationPrivate::KB_Mac},
{QKeySequence::SelectAll, 1, Qt::CTRL | Qt::Key_A, QApplicationPrivate::KB_All}, {QKeySequence::SelectAll, 1, Qt::CTRL | Qt::Key_A, QApplicationPrivate::KB_All},
{QKeySequence::Bold, 1, Qt::CTRL | Qt::Key_B, QApplicationPrivate::KB_All}, {QKeySequence::Bold, 1, Qt::CTRL | Qt::Key_B, QApplicationPrivate::KB_All},
{QKeySequence::Copy, 1, Qt::CTRL | Qt::Key_C, QApplicationPrivate::KB_All}, {QKeySequence::Copy, 1, Qt::CTRL | Qt::Key_C, QApplicationPrivate::KB_All},
{QKeySequence::Delete, 0, Qt::CTRL | Qt::Key_D, QApplicationPrivate::KB_X11}, //emacs (line edit only) {QKeySequence::Delete, 0, Qt::CTRL | Qt::Key_D, QApplicationPrivate::KB_X11}, //emacs (line edit only)
{QKeySequence::Find, 0, Qt::CTRL | Qt::Key_F, QApplicationPrivate::KB_All}, {QKeySequence::Find, 0, Qt::CTRL | Qt::Key_F, QApplicationPrivate::KB_All},
{QKeySequence::FindNext, 1, Qt::CTRL | Qt::Key_G, QApplicationPrivate::KB_Gnome | QApplicationPrivate::KB_Mac}, {QKeySequence::FindNext, 1, Qt::CTRL | Qt::Key_G, QApplicationPrivate::KB_Gnome},
{QKeySequence::FindNext, 0, Qt::CTRL | Qt::Key_G, QApplicationPrivate::KB_Win},
{QKeySequence::Replace, 0, Qt::CTRL | Qt::Key_H, QApplicationPrivate::KB_Win},
{QKeySequence::Replace, 0, Qt::CTRL | Qt::Key_H, QApplicationPrivate::KB_Gnome}, {QKeySequence::Replace, 0, Qt::CTRL | Qt::Key_H, QApplicationPrivate::KB_Gnome},
{QKeySequence::Italic, 0, Qt::CTRL | Qt::Key_I, QApplicationPrivate::KB_All}, {QKeySequence::Italic, 0, Qt::CTRL | Qt::Key_I, QApplicationPrivate::KB_All},
{QKeySequence::DeleteEndOfLine, 0, Qt::CTRL | Qt::Key_K, QApplicationPrivate::KB_X11}, //emacs (line edit only) {QKeySequence::DeleteEndOfLine, 0, Qt::CTRL | Qt::Key_K, QApplicationPrivate::KB_X11}, //emacs (line edit only)
{QKeySequence::New, 1, Qt::CTRL | Qt::Key_N, QApplicationPrivate::KB_All}, {QKeySequence::New, 1, Qt::CTRL | Qt::Key_N, QApplicationPrivate::KB_All},
{QKeySequence::Open, 1, Qt::CTRL | Qt::Key_O, QApplicationPrivate::KB_All}, {QKeySequence::Open, 1, Qt::CTRL | Qt::Key_O, QApplicationPrivate::KB_All},
{QKeySequence::Print, 1, Qt::CTRL | Qt::Key_P, QApplicationPrivate::KB_All}, {QKeySequence::Print, 1, Qt::CTRL | Qt::Key_P, QApplicationPrivate::KB_All},
{QKeySequence::Quit, 0, Qt::CTRL | Qt::Key_Q, QApplicationPrivate::KB_Gnome | QApplicationPrivate::KB_KDE | QApplicationPrivate::KB_Mac}, {QKeySequence::Quit, 0, Qt::CTRL | Qt::Key_Q, QApplicationPrivate::KB_Gnome | QApplicationPrivate::KB_KDE},
{QKeySequence::Refresh, 1, Qt::CTRL | Qt::Key_R, QApplicationPrivate::KB_Gnome | QApplicationPrivate::KB_Mac}, {QKeySequence::Refresh, 1, Qt::CTRL | Qt::Key_R, QApplicationPrivate::KB_Gnome},
{QKeySequence::Replace, 0, Qt::CTRL | Qt::Key_R, QApplicationPrivate::KB_KDE}, {QKeySequence::Replace, 0, Qt::CTRL | Qt::Key_R, QApplicationPrivate::KB_KDE},
{QKeySequence::Save, 1, Qt::CTRL | Qt::Key_S, QApplicationPrivate::KB_All}, {QKeySequence::Save, 1, Qt::CTRL | Qt::Key_S, QApplicationPrivate::KB_All},
{QKeySequence::AddTab, 0, Qt::CTRL | Qt::Key_T, QApplicationPrivate::KB_All}, {QKeySequence::AddTab, 0, Qt::CTRL | Qt::Key_T, QApplicationPrivate::KB_All},
{QKeySequence::Underline, 1, Qt::CTRL | Qt::Key_U, QApplicationPrivate::KB_All}, {QKeySequence::Underline, 1, Qt::CTRL | Qt::Key_U, QApplicationPrivate::KB_All},
{QKeySequence::Paste, 1, Qt::CTRL | Qt::Key_V, QApplicationPrivate::KB_All}, {QKeySequence::Paste, 1, Qt::CTRL | Qt::Key_V, QApplicationPrivate::KB_All},
{QKeySequence::Close, 0, Qt::CTRL | Qt::Key_W, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::Close, 0, Qt::CTRL | Qt::Key_W, QApplicationPrivate::KB_X11},
{QKeySequence::Close, 1, Qt::CTRL | Qt::Key_W, QApplicationPrivate::KB_Mac},
{QKeySequence::Cut, 1, Qt::CTRL | Qt::Key_X, QApplicationPrivate::KB_All}, {QKeySequence::Cut, 1, Qt::CTRL | Qt::Key_X, QApplicationPrivate::KB_All},
{QKeySequence::Redo, 1, Qt::CTRL | Qt::Key_Y, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_S60},
{QKeySequence::Undo, 1, Qt::CTRL | Qt::Key_Z, QApplicationPrivate::KB_All}, {QKeySequence::Undo, 1, Qt::CTRL | Qt::Key_Z, QApplicationPrivate::KB_All},
{QKeySequence::Back, 1, Qt::CTRL | Qt::Key_BracketLeft, QApplicationPrivate::KB_Mac}, {QKeySequence::NextChild, 1, Qt::CTRL | Qt::Key_Tab, QApplicationPrivate::KB_X11},
{QKeySequence::Forward, 1, Qt::CTRL | Qt::Key_BracketRight, QApplicationPrivate::KB_Mac}, {QKeySequence::DeleteStartOfWord, 0, Qt::CTRL | Qt::Key_Backspace, QApplicationPrivate::KB_X11},
{QKeySequence::PreviousChild, 1, Qt::CTRL | Qt::Key_BraceLeft, QApplicationPrivate::KB_Mac}, {QKeySequence::Copy, 0, Qt::CTRL | Qt::Key_Insert, QApplicationPrivate::KB_X11},
{QKeySequence::NextChild, 1, Qt::CTRL | Qt::Key_BraceRight, QApplicationPrivate::KB_Mac}, {QKeySequence::DeleteEndOfWord, 0, Qt::CTRL | Qt::Key_Delete, QApplicationPrivate::KB_X11},
{QKeySequence::NextChild, 1, Qt::CTRL | Qt::Key_Tab, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::MoveToStartOfDocument, 0, Qt::CTRL | Qt::Key_Home, QApplicationPrivate::KB_X11},
{QKeySequence::NextChild, 0, Qt::CTRL | Qt::Key_Tab, QApplicationPrivate::KB_Mac}, //different priority from above {QKeySequence::MoveToEndOfDocument, 0, Qt::CTRL | Qt::Key_End, QApplicationPrivate::KB_X11},
{QKeySequence::DeleteStartOfWord, 0, Qt::CTRL | Qt::Key_Backspace, QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_Win}, {QKeySequence::MoveToPreviousWord, 0, Qt::CTRL | Qt::Key_Left, QApplicationPrivate::KB_X11},
{QKeySequence::Copy, 0, Qt::CTRL | Qt::Key_Insert, QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_Win}, {QKeySequence::MoveToNextWord, 0, Qt::CTRL | Qt::Key_Right, QApplicationPrivate::KB_X11},
{QKeySequence::DeleteEndOfWord, 0, Qt::CTRL | Qt::Key_Delete, QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_Win}, {QKeySequence::FindPrevious, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_G, QApplicationPrivate::KB_Gnome},
{QKeySequence::MoveToStartOfDocument, 0, Qt::CTRL | Qt::Key_Home, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60},
{QKeySequence::MoveToEndOfDocument, 0, Qt::CTRL | Qt::Key_End, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60},
{QKeySequence::Back, 0, Qt::CTRL | Qt::Key_Left, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToPreviousWord, 0, Qt::CTRL | Qt::Key_Left, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60},
{QKeySequence::MoveToStartOfLine, 0, Qt::CTRL | Qt::Key_Left, QApplicationPrivate::KB_Mac },
{QKeySequence::MoveToStartOfDocument, 1, Qt::CTRL | Qt::Key_Up, QApplicationPrivate::KB_Mac},
{QKeySequence::Forward, 0, Qt::CTRL | Qt::Key_Right, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToEndOfLine, 0, Qt::CTRL | Qt::Key_Right, QApplicationPrivate::KB_Mac },
{QKeySequence::MoveToNextWord, 0, Qt::CTRL | Qt::Key_Right, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60},
{QKeySequence::MoveToEndOfDocument, 1, Qt::CTRL | Qt::Key_Down, QApplicationPrivate::KB_Mac},
{QKeySequence::Close, 1, Qt::CTRL | Qt::Key_F4, QApplicationPrivate::KB_Win},
{QKeySequence::Close, 0, Qt::CTRL | Qt::Key_F4, QApplicationPrivate::KB_Mac},
{QKeySequence::NextChild, 0, Qt::CTRL | Qt::Key_F6, QApplicationPrivate::KB_Win},
{QKeySequence::FindPrevious, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_G, QApplicationPrivate::KB_Gnome | QApplicationPrivate::KB_Mac},
{QKeySequence::FindPrevious, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_G, QApplicationPrivate::KB_Win},
{QKeySequence::AddTab, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_N, QApplicationPrivate::KB_KDE}, {QKeySequence::AddTab, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_N, QApplicationPrivate::KB_KDE},
{QKeySequence::SaveAs, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_S, QApplicationPrivate::KB_Gnome | QApplicationPrivate::KB_Mac}, {QKeySequence::SaveAs, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_S, QApplicationPrivate::KB_Gnome},
{QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60}, {QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_X11},
{QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_Mac}, {QKeySequence::PreviousChild, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Backtab, QApplicationPrivate::KB_X11},
{QKeySequence::PreviousChild, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Backtab, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11},
{QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Backtab, QApplicationPrivate::KB_Mac },//different priority from above
{QKeySequence::Paste, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Insert, QApplicationPrivate::KB_X11}, {QKeySequence::Paste, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Insert, QApplicationPrivate::KB_X11},
{QKeySequence::SelectStartOfDocument, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Home, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60}, {QKeySequence::SelectStartOfDocument, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Home, QApplicationPrivate::KB_X11},
{QKeySequence::SelectEndOfDocument, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_End, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60}, {QKeySequence::SelectEndOfDocument, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_End, QApplicationPrivate::KB_X11},
{QKeySequence::SelectPreviousWord, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60}, {QKeySequence::SelectPreviousWord, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_X11},
{QKeySequence::SelectStartOfLine, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_Mac }, {QKeySequence::SelectNextWord, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_X11},
{QKeySequence::SelectStartOfDocument, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Up, QApplicationPrivate::KB_Mac}, {QKeySequence::Back, 1, Qt::ALT | Qt::Key_Left, QApplicationPrivate::KB_X11},
{QKeySequence::SelectNextWord, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60}, {QKeySequence::Forward, 1, Qt::ALT | Qt::Key_Right, QApplicationPrivate::KB_X11},
{QKeySequence::SelectEndOfLine, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_Mac },
{QKeySequence::SelectEndOfDocument, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Down, QApplicationPrivate::KB_Mac},
{QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_F6, QApplicationPrivate::KB_Win},
{QKeySequence::Undo, 0, Qt::ALT | Qt::Key_Backspace, QApplicationPrivate::KB_Win},
{QKeySequence::DeleteStartOfWord, 0, Qt::ALT | Qt::Key_Backspace, QApplicationPrivate::KB_Mac},
{QKeySequence::DeleteEndOfWord, 0, Qt::ALT | Qt::Key_Delete, QApplicationPrivate::KB_Mac},
{QKeySequence::Back, 1, Qt::ALT | Qt::Key_Left, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11},
{QKeySequence::MoveToPreviousWord, 0, Qt::ALT | Qt::Key_Left, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToStartOfBlock, 0, Qt::ALT | Qt::Key_Up, QApplicationPrivate::KB_Mac}, //mac only
{QKeySequence::MoveToNextWord, 0, Qt::ALT | Qt::Key_Right, QApplicationPrivate::KB_Mac},
{QKeySequence::Forward, 1, Qt::ALT | Qt::Key_Right, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11},
{QKeySequence::MoveToEndOfBlock, 0, Qt::ALT | Qt::Key_Down, QApplicationPrivate::KB_Mac}, //mac only
{QKeySequence::MoveToPreviousPage, 0, Qt::ALT | Qt::Key_PageUp, QApplicationPrivate::KB_Mac },
{QKeySequence::MoveToNextPage, 0, Qt::ALT | Qt::Key_PageDown, QApplicationPrivate::KB_Mac },
{QKeySequence::Redo, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Backspace,QApplicationPrivate::KB_Win},
{QKeySequence::SelectPreviousWord, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_Mac},
{QKeySequence::SelectStartOfBlock, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Up, QApplicationPrivate::KB_Mac}, //mac only
{QKeySequence::SelectNextWord, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_Mac},
{QKeySequence::SelectEndOfBlock, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Down, QApplicationPrivate::KB_Mac}, //mac only
{QKeySequence::MoveToStartOfBlock, 0, Qt::META | Qt::Key_A, QApplicationPrivate::KB_Mac},
{QKeySequence::Delete, 0, Qt::META | Qt::Key_D, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToEndOfBlock, 0, Qt::META | Qt::Key_E, QApplicationPrivate::KB_Mac},
{QKeySequence::InsertLineSeparator, 0, Qt::META | Qt::Key_Return, QApplicationPrivate::KB_Mac},
{QKeySequence::InsertLineSeparator, 0, Qt::META | Qt::Key_Enter, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToStartOfLine, 0, Qt::META | Qt::Key_Left, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToPreviousPage, 0, Qt::META | Qt::Key_Up, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToEndOfLine, 0, Qt::META | Qt::Key_Right, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToNextPage, 0, Qt::META | Qt::Key_Down, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToPreviousPage, 0, Qt::META | Qt::Key_PageUp, QApplicationPrivate::KB_Mac},
{QKeySequence::MoveToNextPage, 0, Qt::META | Qt::Key_PageDown, QApplicationPrivate::KB_Mac},
{QKeySequence::SelectStartOfBlock, 0, Qt::META | Qt::SHIFT | Qt::Key_A, QApplicationPrivate::KB_Mac},
{QKeySequence::SelectEndOfBlock, 0, Qt::META | Qt::SHIFT | Qt::Key_E, QApplicationPrivate::KB_Mac},
{QKeySequence::SelectStartOfLine, 0, Qt::META | Qt::SHIFT | Qt::Key_Left, QApplicationPrivate::KB_Mac},
{QKeySequence::SelectEndOfLine, 0, Qt::META | Qt::SHIFT | Qt::Key_Right, QApplicationPrivate::KB_Mac}
}; };
const uint QKeySequencePrivate::numberOfKeyBindings = sizeof(QKeySequencePrivate::keyBindings)/(sizeof(QKeyBinding)); const uint QKeySequencePrivate::numberOfKeyBindings = sizeof(QKeySequencePrivate::keyBindings)/(sizeof(QKeyBinding));

View file

@ -116,41 +116,6 @@ static inline void qt_flush(QWidget *widget, const QRegion &region, QWindowSurfa
} }
#ifndef QT_NO_PAINT_DEBUG #ifndef QT_NO_PAINT_DEBUG
#ifdef Q_WS_WIN
static void showYellowThing_win(QWidget *widget, const QRegion &region, int msec)
{
HBRUSH brush;
static int i = 0;
switch (i) {
case 0:
brush = CreateSolidBrush(RGB(255, 255, 0));
break;
case 1:
brush = CreateSolidBrush(RGB(255, 200, 55));
break;
case 2:
brush = CreateSolidBrush(RGB(200, 255, 55));
break;
case 3:
brush = CreateSolidBrush(RGB(200, 200, 0));
break;
}
i = (i + 1) & 3;
HDC hdc = widget->getDC();
const QVector<QRect> &rects = region.rects();
foreach (QRect rect, rects) {
RECT winRect;
SetRect(&winRect, rect.left(), rect.top(), rect.right(), rect.bottom());
FillRect(hdc, &winRect, brush);
}
widget->releaseDC(hdc);
::Sleep(msec);
}
#endif
void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePainted, int msec, bool unclipped) void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePainted, int msec, bool unclipped)
{ {
QRegion paintRegion = toBePainted; QRegion paintRegion = toBePainted;
@ -164,10 +129,6 @@ void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePa
widget = nativeParent; widget = nativeParent;
} }
#ifdef Q_WS_WIN
Q_UNUSED(unclipped);
showYellowThing_win(widget, paintRegion, msec);
#else
//flags to fool painter //flags to fool painter
bool paintUnclipped = widget->testAttribute(Qt::WA_PaintUnclipped); bool paintUnclipped = widget->testAttribute(Qt::WA_PaintUnclipped);
if (unclipped && !widget->d_func()->paintOnScreen()) if (unclipped && !widget->d_func()->paintOnScreen())
@ -214,11 +175,7 @@ void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePa
pe->setSystemClip(QRegion()); pe->setSystemClip(QRegion());
QApplication::syncX(); QApplication::syncX();
#if defined(Q_OS_UNIX)
::usleep(1000 * msec); ::usleep(1000 * msec);
#endif
#endif // Q_WS_WIN
} }
bool QWidgetBackingStore::flushPaint(QWidget *widget, const QRegion &rgn) bool QWidgetBackingStore::flushPaint(QWidget *widget, const QRegion &rgn)
@ -646,12 +603,6 @@ void QWidgetBackingStore::markDirtyOnScreen(const QRegion &region, QWidget *widg
if (!widget || widget->d_func()->paintOnScreen() || region.isEmpty()) if (!widget || widget->d_func()->paintOnScreen() || region.isEmpty())
return; return;
#if defined(Q_WS_MAC)
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
dirtyOnScreen += region.translated(topLevelOffset);
return;
#endif
// Top-level. // Top-level.
if (widget == tlw) { if (widget == tlw) {
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent)) if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
@ -1436,12 +1387,6 @@ void QWidgetPrivate::repaint_sys(const QRegion &rgn)
&& (usesDoubleBufferedGLContext || q->autoFillBackground()); && (usesDoubleBufferedGLContext || q->autoFillBackground());
QRegion toBePainted(noPartialUpdateSupport ? q->rect() : rgn); QRegion toBePainted(noPartialUpdateSupport ? q->rect() : rgn);
#ifdef Q_WS_MAC
// No difference between update() and repaint() on the Mac.
update_sys(toBePainted);
return;
#endif
toBePainted &= clipRect(); toBePainted &= clipRect();
clipToEffectiveMask(toBePainted); clipToEffectiveMask(toBePainted);
if (toBePainted.isEmpty()) if (toBePainted.isEmpty())

View file

@ -80,10 +80,6 @@ public:
const QVector<QColor> colormap() const; const QVector<QColor> colormap() const;
#ifdef Q_WS_WIN
static HPALETTE hPal();
#endif
private: private:
QColormap(); QColormap();
QColormapPrivate *d; QColormapPrivate *d;

View file

@ -76,10 +76,6 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifdef Q_WS_WIN
extern HDC shared_dc();
#endif
#ifdef Q_WS_X11 #ifdef Q_WS_X11
extern const QX11Info *qt_x11Info(const QPaintDevice *pd); extern const QX11Info *qt_x11Info(const QPaintDevice *pd);
#endif #endif
@ -151,11 +147,6 @@ Q_GUI_EXPORT int qt_defaultDpiX()
#ifdef Q_WS_X11 #ifdef Q_WS_X11
return QX11Info::appDpiX(); return QX11Info::appDpiX();
#elif defined(Q_WS_WIN)
return GetDeviceCaps(shared_dc(),LOGPIXELSX);
#elif defined(Q_WS_MAC)
extern float qt_mac_defaultDpi_x(); //qpaintdevice_mac.cpp
return qt_mac_defaultDpi_x();
#endif // Q_WS_X11 #endif // Q_WS_X11
} }
@ -166,11 +157,6 @@ Q_GUI_EXPORT int qt_defaultDpiY()
#ifdef Q_WS_X11 #ifdef Q_WS_X11
return QX11Info::appDpiY(); return QX11Info::appDpiY();
#elif defined(Q_WS_WIN)
return GetDeviceCaps(shared_dc(),LOGPIXELSY);
#elif defined(Q_WS_MAC)
extern float qt_mac_defaultDpi_y(); //qpaintdevice_mac.cpp
return qt_mac_defaultDpi_y();
#endif // Q_WS_X11 #endif // Q_WS_X11
} }
@ -190,9 +176,6 @@ QFontPrivate::QFontPrivate()
else else
screen = 0; screen = 0;
#endif #endif
#ifdef Q_WS_WIN
hdc = 0;
#endif
} }
QFontPrivate::QFontPrivate(const QFontPrivate &other) QFontPrivate::QFontPrivate(const QFontPrivate &other)
@ -203,9 +186,6 @@ QFontPrivate::QFontPrivate(const QFontPrivate &other)
letterSpacing(other.letterSpacing), wordSpacing(other.wordSpacing), letterSpacing(other.letterSpacing), wordSpacing(other.wordSpacing),
scFont(other.scFont) scFont(other.scFont)
{ {
#ifdef Q_WS_WIN
hdc = other.hdc;
#endif
if (scFont && scFont != this) if (scFont && scFont != this)
scFont->ref.ref(); scFont->ref.ref();
} }
@ -222,12 +202,6 @@ QFontPrivate::~QFontPrivate()
extern QMutex *qt_fontdatabase_mutex(); extern QMutex *qt_fontdatabase_mutex();
#if !defined(Q_WS_MAC)
#define QT_FONT_ENGINE_FROM_DATA(data, script) data->engines[script]
#else
#define QT_FONT_ENGINE_FROM_DATA(data, script) data->engine
#endif
QFontEngine *QFontPrivate::engineForScript(int script) const QFontEngine *QFontPrivate::engineForScript(int script) const
{ {
QMutexLocker locker(qt_fontdatabase_mutex()); QMutexLocker locker(qt_fontdatabase_mutex());
@ -239,9 +213,9 @@ QFontEngine *QFontPrivate::engineForScript(int script) const
delete engineData; delete engineData;
engineData = 0; engineData = 0;
} }
if (!engineData || !QT_FONT_ENGINE_FROM_DATA(engineData, script)) if (!engineData || !engineData->engines[script])
QFontDatabase::load(this, script); QFontDatabase::load(this, script);
return QT_FONT_ENGINE_FROM_DATA(engineData, script); return engineData->engines[script];
} }
void QFontPrivate::alterCharForCapitalization(QChar &c) const { void QFontPrivate::alterCharForCapitalization(QChar &c) const {
@ -344,26 +318,16 @@ void QFontPrivate::resolve(uint mask, const QFontPrivate *other)
QFontEngineData::QFontEngineData() QFontEngineData::QFontEngineData()
: ref(1), fontCache(QFontCache::instance()) : ref(1), fontCache(QFontCache::instance())
{ {
#if !defined(Q_WS_MAC)
memset(engines, 0, QUnicodeTables::ScriptCount * sizeof(QFontEngine *)); memset(engines, 0, QUnicodeTables::ScriptCount * sizeof(QFontEngine *));
#else
engine = 0;
#endif
} }
QFontEngineData::~QFontEngineData() QFontEngineData::~QFontEngineData()
{ {
#if !defined(Q_WS_MAC)
for (int i = 0; i < QUnicodeTables::ScriptCount; ++i) { for (int i = 0; i < QUnicodeTables::ScriptCount; ++i) {
if (engines[i] && !engines[i]->ref.deref()) if (engines[i] && !engines[i]->ref.deref())
delete engines[i]; delete engines[i];
engines[i] = 0; engines[i] = 0;
} }
#else
if (engine && !engine->ref.deref())
delete engine;
engine = 0;
#endif // Q_WS_X11 || Q_WS_WIN || Q_WS_MAC
} }
@ -688,10 +652,6 @@ QFont::QFont(const QFont &font, QPaintDevice *pd)
} else { } else {
d = font.d.data(); d = font.d.data();
} }
#ifdef Q_WS_WIN
if (pd->devType() == QInternal::Printer && pd->getDC())
d->hdc = pd->getDC();
#endif
} }
/*! /*!
@ -1833,13 +1793,6 @@ static void initFontSubst()
"times new roman", "times", "times new roman", "times",
"courier new", "courier", "courier new", "courier",
"sans serif", "helvetica", "sans serif", "helvetica",
#elif defined(Q_WS_MAC)
".lucida grande ui", "lucida grande",
#elif defined(Q_WS_WIN)
"times", "times new roman",
"courier", "courier new",
"helvetica", "arial",
"sans serif", "arial",
#endif #endif
0, 0 0, 0
@ -2507,16 +2460,6 @@ bool QFontInfo::fixedPitch() const
{ {
QFontEngine *engine = d->engineForScript(QUnicodeTables::Common); QFontEngine *engine = d->engineForScript(QUnicodeTables::Common);
Q_ASSERT(engine != 0); Q_ASSERT(engine != 0);
#ifdef Q_OS_MAC
if (!engine->fontDef.fixedPitchComputed) {
QChar ch[2] = { QLatin1Char('i'), QLatin1Char('m') };
QGlyphLayoutArray<2> g;
int l = 2;
engine->stringToCMap(ch, 2, &g, &l, 0);
engine->fontDef.fixedPitch = g.advances_x[0] == g.advances_x[1];
engine->fontDef.fixedPitchComputed = true;
}
#endif
return engine->fontDef.fixedPitch; return engine->fontDef.fixedPitch;
} }
@ -2767,71 +2710,6 @@ void QFontCache::decreaseCost(uint cost)
cost, total_cost, max_cost); cost, total_cost, max_cost);
} }
#if defined(Q_WS_WIN)
void QFontCache::cleanupPrinterFonts()
{
FC_DEBUG("QFontCache::cleanupPrinterFonts");
{
FC_DEBUG(" CLEAN engine data:");
// clean out all unused engine data
EngineDataCache::Iterator it = engineDataCache.begin(),
end = engineDataCache.end();
while (it != end) {
if (it.key().screen == 0) {
++it;
continue;
}
if (it.value()->ref > 1) {
for (int i = 0; i < QUnicodeTables::ScriptCount; ++i) {
if (it.value()->engines[i] && !it.value()->engines[i]->ref.deref())
delete it.value()->engines[i];
it.value()->engines[i] = 0;
}
++it;
} else {
EngineDataCache::Iterator rem = it++;
decreaseCost(sizeof(QFontEngineData));
FC_DEBUG(" %p", rem.value());
if (!rem.value()->ref.deref())
delete rem.value();
engineDataCache.erase(rem);
}
}
}
EngineCache::Iterator it = engineCache.begin(),
end = engineCache.end();
while(it != end) {
if (it.value().data->ref != 1 || it.key().screen == 0) {
++it;
continue;
}
FC_DEBUG(" %p: timestamp %4u hits %2u ref %2d/%2d, type '%s'",
it.value().data, it.value().timestamp, it.value().hits,
int(it.value().data->ref), it.value().data->cache_count,
it.value().data->name());
if (--it.value().data->cache_count == 0) {
FC_DEBUG(" DELETE: last occurrence in cache");
decreaseCost(it.value().data->cache_cost);
if (!it.value().data->ref.deref())
delete it.value().data;
}
engineCache.erase(it++);
}
}
#endif
void QFontCache::timerEvent(QTimerEvent *) void QFontCache::timerEvent(QTimerEvent *)
{ {
FC_DEBUG("QFontCache::timerEvent: performing cache maintenance (timestamp %u)", FC_DEBUG("QFontCache::timerEvent: performing cache maintenance (timestamp %u)",
@ -2863,14 +2741,14 @@ void QFontCache::timerEvent(QTimerEvent *)
#ifdef QFONTCACHE_DEBUG #ifdef QFONTCACHE_DEBUG
FC_DEBUG(" %p: ref %2d", it.value(), int(it.value()->ref)); FC_DEBUG(" %p: ref %2d", it.value(), int(it.value()->ref));
# if defined(Q_WS_X11) || defined(Q_WS_WIN) # if defined(Q_WS_X11)
// print out all engines // print out all engines
for (int i = 0; i < QUnicodeTables::ScriptCount; ++i) { for (int i = 0; i < QUnicodeTables::ScriptCount; ++i) {
if (! it.value()->engines[i]) if (! it.value()->engines[i])
continue; continue;
FC_DEBUG(" contains %p", it.value()->engines[i]); FC_DEBUG(" contains %p", it.value()->engines[i]);
} }
# endif // Q_WS_X11 || Q_WS_WIN # endif // Q_WS_X11
#endif // QFONTCACHE_DEBUG #endif // QFONTCACHE_DEBUG
if (it.value()->ref > 1) if (it.value()->ref > 1)

View file

@ -244,14 +244,7 @@ public:
{ qSwap(d, other.d); qSwap(resolve_mask, other.resolve_mask); return *this; } { qSwap(d, other.d); qSwap(resolve_mask, other.resolve_mask); return *this; }
#endif #endif
#ifdef Q_WS_WIN
HFONT handle() const;
#else // !Q_WS_WIN
Qt::HANDLE handle() const; Qt::HANDLE handle() const;
#endif // Q_WS_WIN
#ifdef Q_WS_MAC
quint32 macFontID() const;
#endif
#if defined(Q_WS_X11) #if defined(Q_WS_X11)
FT_Face freetypeFace() const; FT_Face freetypeFace() const;
#endif #endif

View file

@ -180,10 +180,6 @@ public:
int dpi; int dpi;
int screen; int screen;
#ifdef Q_WS_WIN
HDC hdc;
#endif
uint rawMode : 1; uint rawMode : 1;
uint underline : 1; uint underline : 1;
uint overline : 1; uint overline : 1;
@ -266,10 +262,6 @@ public:
QFontEngine *findEngine(const Key &key); QFontEngine *findEngine(const Key &key);
void insertEngine(const Key &key, QFontEngine *engine); void insertEngine(const Key &key, QFontEngine *engine);
#if defined(Q_WS_WIN)
void cleanupPrinterFonts();
#endif
private: private:
void increaseCost(uint cost); void increaseCost(uint cost);
void decreaseCost(uint cost); void decreaseCost(uint cost);

View file

@ -705,7 +705,7 @@ int qt_script_for_writing_system(QFontDatabase::WritingSystem writingSystem)
} }
#if (defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG)) || defined(Q_WS_WIN) #if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG)
static inline bool requiresOpenType(int writingSystem) static inline bool requiresOpenType(int writingSystem)
{ {
return ((writingSystem >= QFontDatabase::Syriac && writingSystem <= QFontDatabase::Sinhala) return ((writingSystem >= QFontDatabase::Syriac && writingSystem <= QFontDatabase::Sinhala)
@ -863,14 +863,10 @@ QMutex *qt_fontdatabase_mutex()
QT_BEGIN_INCLUDE_NAMESPACE QT_BEGIN_INCLUDE_NAMESPACE
#if defined(Q_WS_X11) #if defined(Q_WS_X11)
# include "qfontdatabase_x11.h" # include "qfontdatabase_x11.h"
#elif defined(Q_WS_MAC)
# include "qfontdatabase_mac.h"
#elif defined(Q_WS_WIN)
# include "qfontdatabase_win.h"
#endif #endif
QT_END_INCLUDE_NAMESPACE QT_END_INCLUDE_NAMESPACE
#if !defined(Q_WS_X11) && !defined(Q_WS_MAC) #if !defined(Q_WS_X11)
QString QFontDatabase::resolveFontFamilyAlias(const QString &family) QString QFontDatabase::resolveFontFamilyAlias(const QString &family)
{ {
return family; return family;
@ -1206,11 +1202,7 @@ static void match(int script, const QFontDef &request,
test.familyIndex = x; test.familyIndex = x;
if (!family_name.isEmpty() if (!family_name.isEmpty()
&& test.family->name.compare(family_name, Qt::CaseInsensitive) != 0 && test.family->name.compare(family_name, Qt::CaseInsensitive) != 0)
#ifdef Q_WS_WIN
&& test.family->english_name.compare(family_name, Qt::CaseInsensitive) != 0
#endif
)
continue; continue;
if (family_name.isEmpty()) if (family_name.isEmpty())
@ -1690,13 +1682,6 @@ bool QFontDatabase::isScalable(const QString &family,
QList<int> QFontDatabase::pointSizes(const QString &family, QList<int> QFontDatabase::pointSizes(const QString &family,
const QString &styleName) const QString &styleName)
{ {
#if defined(Q_WS_WIN)
// windows and macosx are always smoothly scalable
Q_UNUSED(family);
Q_UNUSED(styleName);
return standardSizes();
#else
bool smoothScalable = false;
QString familyName, foundryName; QString familyName, foundryName;
parseFontName(family, foundryName, familyName); parseFontName(family, foundryName, familyName);
@ -1725,8 +1710,7 @@ QList<int> QFontDatabase::pointSizes(const QString &family,
if (!style) continue; if (!style) continue;
if (style->smoothScalable) { if (style->smoothScalable) {
smoothScalable = true; return standardSizes();
goto end;
} }
for (int l = 0; l < style->count; l++) { for (int l = 0; l < style->count; l++) {
const QtFontSize *size = style->pixelSizes + l; const QtFontSize *size = style->pixelSizes + l;
@ -1739,13 +1723,9 @@ QList<int> QFontDatabase::pointSizes(const QString &family,
} }
} }
} }
end:
if (smoothScalable)
return standardSizes();
qSort(sizes); qSort(sizes);
return sizes; return sizes;
#endif
} }
/*! /*!

View file

@ -52,16 +52,9 @@
#include "qboxlayout.h" #include "qboxlayout.h"
#include "qpainter.h" #include "qpainter.h"
#include "qmargins.h" #include "qmargins.h"
#include "qabstractscrollarea_p.h" #include "qabstractscrollarea_p.h"
#include <qwidget.h> #include "qwidget.h"
#include "qapplication_p.h"
#include <qapplication_p.h>
#ifdef Q_WS_MAC
#include <qt_mac_p.h>
#include <qt_cocoa_helpers_mac_p.h>
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -160,9 +153,6 @@ QAbstractScrollAreaPrivate::QAbstractScrollAreaPrivate()
:hbar(0), vbar(0), vbarpolicy(Qt::ScrollBarAsNeeded), hbarpolicy(Qt::ScrollBarAsNeeded), :hbar(0), vbar(0), vbarpolicy(Qt::ScrollBarAsNeeded), hbarpolicy(Qt::ScrollBarAsNeeded),
viewport(0), cornerWidget(0), left(0), top(0), right(0), bottom(0), viewport(0), cornerWidget(0), left(0), top(0), right(0), bottom(0),
xoffset(0), yoffset(0), viewportFilter(0) xoffset(0), yoffset(0), viewportFilter(0)
#ifdef Q_WS_WIN
, singleFingerPanEnabled(false)
#endif
{ {
} }
@ -294,64 +284,20 @@ void QAbstractScrollAreaPrivate::init()
q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
layoutChildren(); layoutChildren();
#ifndef Q_WS_MAC
#ifndef QT_NO_GESTURES #ifndef QT_NO_GESTURES
viewport->grabGesture(Qt::PanGesture); viewport->grabGesture(Qt::PanGesture);
#endif #endif
#endif
} }
#ifdef Q_WS_WIN
void QAbstractScrollAreaPrivate::setSingleFingerPanEnabled(bool on)
{
singleFingerPanEnabled = on;
QWidgetPrivate *dd = static_cast<QWidgetPrivate *>(QObjectPrivate::get(viewport));
if (dd)
dd->winSetupGestures();
}
#endif // Q_WS_WIN
void QAbstractScrollAreaPrivate::layoutChildren() void QAbstractScrollAreaPrivate::layoutChildren()
{ {
Q_Q(QAbstractScrollArea); Q_Q(QAbstractScrollArea);
bool needh = (hbarpolicy == Qt::ScrollBarAlwaysOn const bool needh = (hbarpolicy == Qt::ScrollBarAlwaysOn
|| (hbarpolicy == Qt::ScrollBarAsNeeded && hbar->minimum() < hbar->maximum())); || (hbarpolicy == Qt::ScrollBarAsNeeded && hbar->minimum() < hbar->maximum()));
bool needv = (vbarpolicy == Qt::ScrollBarAlwaysOn const bool needv = (vbarpolicy == Qt::ScrollBarAlwaysOn
|| (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum())); || (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum()));
#ifdef Q_WS_MAC
QWidget * const window = q->window();
// Use small scroll bars for tool windows, to match the native size grip.
bool hbarIsSmall = hbar->testAttribute(Qt::WA_MacSmallSize);
bool vbarIsSmall = vbar->testAttribute(Qt::WA_MacSmallSize);
const Qt::WindowType windowType = window->windowType();
if (windowType == Qt::Tool) {
if (!hbarIsSmall) {
hbar->setAttribute(Qt::WA_MacMiniSize, false);
hbar->setAttribute(Qt::WA_MacNormalSize, false);
hbar->setAttribute(Qt::WA_MacSmallSize, true);
}
if (!vbarIsSmall) {
vbar->setAttribute(Qt::WA_MacMiniSize, false);
vbar->setAttribute(Qt::WA_MacNormalSize, false);
vbar->setAttribute(Qt::WA_MacSmallSize, true);
}
} else {
if (hbarIsSmall) {
hbar->setAttribute(Qt::WA_MacMiniSize, false);
hbar->setAttribute(Qt::WA_MacNormalSize, false);
hbar->setAttribute(Qt::WA_MacSmallSize, false);
}
if (vbarIsSmall) {
vbar->setAttribute(Qt::WA_MacMiniSize, false);
vbar->setAttribute(Qt::WA_MacNormalSize, false);
vbar->setAttribute(Qt::WA_MacSmallSize, false);
}
}
#endif
const int hsbExt = hbar->sizeHint().height(); const int hsbExt = hbar->sizeHint().height();
const int vsbExt = vbar->sizeHint().width(); const int vsbExt = vbar->sizeHint().width();
const QPoint extPoint(vsbExt, hsbExt); const QPoint extPoint(vsbExt, hsbExt);
@ -363,30 +309,6 @@ void QAbstractScrollAreaPrivate::layoutChildren()
const bool hasCornerWidget = (cornerWidget != 0); const bool hasCornerWidget = (cornerWidget != 0);
// If the scroll bars are at the very right and bottom of the window we
// move their positions to be aligned with the size grip.
#ifdef Q_WS_MAC
// Check if a native sizegrip is present.
bool hasMacReverseSizeGrip = false;
bool hasMacSizeGrip = false;
bool nativeGripPresent = false;
if (q->testAttribute(Qt::WA_WState_Created))
nativeGripPresent = qt_mac_checkForNativeSizeGrip(q);
if (nativeGripPresent) {
// Look for a native size grip at the visual window bottom right and at the
// absolute window bottom right. In reverse mode, the native size grip does not
// swich side, so we need to check if it is on the "wrong side".
const QPoint scrollAreaBottomRight = q->mapTo(window, widgetRect.bottomRight() - QPoint(frameWidth, frameWidth));
const QPoint windowBottomRight = window->rect().bottomRight();
const QPoint visualWindowBottomRight = QStyle::visualPos(opt.direction, opt.rect, windowBottomRight);
const QPoint offset = windowBottomRight - scrollAreaBottomRight;
const QPoint visualOffset = visualWindowBottomRight - scrollAreaBottomRight;
hasMacSizeGrip = (visualOffset.manhattanLength() < vsbExt);
hasMacReverseSizeGrip = (hasMacSizeGrip == false && (offset.manhattanLength() < hsbExt));
}
#endif
QPoint cornerOffset(needv ? vsbExt : 0, needh ? hsbExt : 0); QPoint cornerOffset(needv ? vsbExt : 0, needh ? hsbExt : 0);
QRect controlsRect; QRect controlsRect;
QRect viewportRect; QRect viewportRect;
@ -416,12 +338,6 @@ void QAbstractScrollAreaPrivate::layoutChildren()
if (hasCornerWidget && (needv || needh)) if (hasCornerWidget && (needv || needh))
cornerOffset = extPoint; cornerOffset = extPoint;
#ifdef Q_WS_MAC
// Also move the scroll bars if they are covered by the native Mac size grip.
if (hasMacSizeGrip)
cornerOffset = extPoint;
#endif
// The corner point is where the scroll bar rects, the corner widget rect and the // The corner point is where the scroll bar rects, the corner widget rect and the
// viewport rect meets. // viewport rect meets.
const QPoint cornerPoint(controlsRect.bottomRight() + QPoint(1, 1) - cornerOffset); const QPoint cornerPoint(controlsRect.bottomRight() + QPoint(1, 1) - cornerOffset);
@ -429,31 +345,14 @@ void QAbstractScrollAreaPrivate::layoutChildren()
// Some styles paints the corner if both scorllbars are showing and there is // Some styles paints the corner if both scorllbars are showing and there is
// no corner widget. Also, on the Mac we paint if there is a native // no corner widget. Also, on the Mac we paint if there is a native
// (transparent) sizegrip in the area where a corner widget would be. // (transparent) sizegrip in the area where a corner widget would be.
if ((needv && needh && hasCornerWidget == false) if ((needv && needh && hasCornerWidget == false) || needv || needh) {
|| ((needv || needh)
#ifdef Q_WS_MAC
&& hasMacSizeGrip
#endif
)
) {
cornerPaintingRect = QStyle::visualRect(opt.direction, opt.rect, QRect(cornerPoint, extSize)); cornerPaintingRect = QStyle::visualRect(opt.direction, opt.rect, QRect(cornerPoint, extSize));
} else { } else {
cornerPaintingRect = QRect(); cornerPaintingRect = QRect();
} }
#ifdef Q_WS_MAC
if (hasMacReverseSizeGrip)
reverseCornerPaintingRect = QRect(controlsRect.bottomRight() + QPoint(1, 1) - extPoint, extSize);
else
reverseCornerPaintingRect = QRect();
#endif
if (needh) { if (needh) {
QRect horizontalScrollBarRect(QPoint(controlsRect.left(), cornerPoint.y()), QPoint(cornerPoint.x() - 1, controlsRect.bottom())); QRect horizontalScrollBarRect(QPoint(controlsRect.left(), cornerPoint.y()), QPoint(cornerPoint.x() - 1, controlsRect.bottom()));
#ifdef Q_WS_MAC
if (hasMacReverseSizeGrip)
horizontalScrollBarRect.adjust(vsbExt, 0, 0, 0);
#endif
scrollBarContainers[Qt::Horizontal]->setGeometry(QStyle::visualRect(opt.direction, opt.rect, horizontalScrollBarRect)); scrollBarContainers[Qt::Horizontal]->setGeometry(QStyle::visualRect(opt.direction, opt.rect, horizontalScrollBarRect));
scrollBarContainers[Qt::Horizontal]->raise(); scrollBarContainers[Qt::Horizontal]->raise();
} }
@ -547,10 +446,8 @@ void QAbstractScrollArea::setViewport(QWidget *widget)
d->viewport->setParent(this); d->viewport->setParent(this);
d->viewport->setFocusProxy(this); d->viewport->setFocusProxy(this);
d->viewport->installEventFilter(d->viewportFilter.data()); d->viewport->installEventFilter(d->viewportFilter.data());
#ifndef Q_WS_MAC
#ifndef QT_NO_GESTURES #ifndef QT_NO_GESTURES
d->viewport->grabGesture(Qt::PanGesture); d->viewport->grabGesture(Qt::PanGesture);
#endif
#endif #endif
d->layoutChildren(); d->layoutChildren();
if (isVisible()) if (isVisible())
@ -931,13 +828,6 @@ bool QAbstractScrollArea::event(QEvent *e)
QPainter p(this); QPainter p(this);
style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, &p, this); style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, &p, this);
} }
#ifdef Q_WS_MAC
if (d->reverseCornerPaintingRect.isValid()) {
option.rect = d->reverseCornerPaintingRect;
QPainter p(this);
style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, &p, this);
}
#endif
} }
QFrame::paintEvent((QPaintEvent*)e); QFrame::paintEvent((QPaintEvent*)e);
break; break;
@ -1322,13 +1212,6 @@ void QAbstractScrollAreaPrivate::_q_vslide(int y)
void QAbstractScrollAreaPrivate::_q_showOrHideScrollBars() void QAbstractScrollAreaPrivate::_q_showOrHideScrollBars()
{ {
layoutChildren(); layoutChildren();
#ifdef Q_WS_WIN
// Need to re-subscribe to gestures as the content changes to make sure we
// enable/disable panning when needed.
QWidgetPrivate *dd = static_cast<QWidgetPrivate *>(QObjectPrivate::get(viewport));
if (dd)
dd->winSetupGestures();
#endif // Q_WS_WIN
} }
QPoint QAbstractScrollAreaPrivate::contentsOffset() const QPoint QAbstractScrollAreaPrivate::contentsOffset() const

View file

@ -99,11 +99,6 @@ public:
inline bool viewportEvent(QEvent *event) inline bool viewportEvent(QEvent *event)
{ return q_func()->viewportEvent(event); } { return q_func()->viewportEvent(event); }
QScopedPointer<QObject> viewportFilter; QScopedPointer<QObject> viewportFilter;
#ifdef Q_WS_WIN
bool singleFingerPanEnabled;
void setSingleFingerPanEnabled(bool on = true);
#endif
}; };
class QAbstractScrollAreaFilter : public QObject class QAbstractScrollAreaFilter : public QObject

View file

@ -1157,8 +1157,6 @@ void QAbstractSpinBox::hideEvent(QHideEvent *event)
/*! /*!
\internal
Used when acceleration is turned on. We need to get the Used when acceleration is turned on. We need to get the
keyboard auto repeat rate from OS. This value is used as keyboard auto repeat rate from OS. This value is used as
argument when starting acceleration related timers. argument when starting acceleration related timers.
@ -1168,15 +1166,7 @@ void QAbstractSpinBox::hideEvent(QHideEvent *event)
Remember that time value should be given in msecs. Remember that time value should be given in msecs.
*/ */
static int getKeyboardAutoRepeatRate() { static const int keyboardAutoRepeatRate = 30;
int ret = 30;
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
DWORD time;
if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &time, 0) != FALSE)
ret = static_cast<int>(1000 / static_cast<int>(time)); // msecs
#endif
return ret; // msecs
}
/*! /*!
\reimp \reimp
@ -1191,7 +1181,7 @@ void QAbstractSpinBox::timerEvent(QTimerEvent *event)
killTimer(d->spinClickThresholdTimerId); killTimer(d->spinClickThresholdTimerId);
d->spinClickThresholdTimerId = -1; d->spinClickThresholdTimerId = -1;
d->effectiveSpinRepeatRate = d->buttonState & Keyboard d->effectiveSpinRepeatRate = d->buttonState & Keyboard
? getKeyboardAutoRepeatRate() ? keyboardAutoRepeatRate
: d->spinClickTimerInterval; : d->spinClickTimerInterval;
d->spinClickTimerId = startTimer(d->effectiveSpinRepeatRate); d->spinClickTimerId = startTimer(d->effectiveSpinRepeatRate);
doStep = true; doStep = true;

View file

@ -221,16 +221,11 @@ void QComboBoxPrivate::_q_modelDestroyed()
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't //Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
QRect QComboBoxPrivate::popupGeometry(int screen) const QRect QComboBoxPrivate::popupGeometry(int screen) const
{ {
#ifdef Q_WS_WIN #if defined Q_WS_X11
return QApplication::desktop()->screenGeometry(screen);
#elif defined Q_WS_X11
if (X11->desktopEnvironment == DE_KDE) if (X11->desktopEnvironment == DE_KDE)
return QApplication::desktop()->screenGeometry(screen); return QApplication::desktop()->screenGeometry(screen);
else
return QApplication::desktop()->availableGeometry(screen);
#else
return QApplication::desktop()->availableGeometry(screen);
#endif #endif
return QApplication::desktop()->availableGeometry(screen);
} }
bool QComboBoxPrivate::updateHoverControl(const QPoint &pos) bool QComboBoxPrivate::updateHoverControl(const QPoint &pos)
@ -2471,21 +2466,11 @@ void QComboBox::showPopup()
const bool updatesEnabled = container->updatesEnabled(); const bool updatesEnabled = container->updatesEnabled();
#endif #endif
#if defined(Q_WS_WIN) && !defined(QT_NO_EFFECTS) // indows are displayed immediately on this platform, which means that the window will
bool scrollDown = (listRect.topLeft() == below); // be visible before the call to container->show() returns. If updates are disabled at
if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo) // this point we'll miss our chance at painting the popup menu before it's shown, causing
&& !style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this) && !window()->testAttribute(Qt::WA_DontShowOnScreen)) // flicker since the window then displays the standard gray background.
qScrollEffect(container, scrollDown ? QEffects::DownScroll : QEffects::UpScroll, 150);
#endif
// Don't disable updates on Mac OS X. Windows are displayed immediately on this platform,
// which means that the window will be visible before the call to container->show() returns.
// If updates are disabled at this point we'll miss our chance at painting the popup
// menu before it's shown, causing flicker since the window then displays the standard gray
// background.
#ifndef Q_WS_MAC
container->setUpdatesEnabled(false); container->setUpdatesEnabled(false);
#endif
container->raise(); container->raise();
container->show(); container->show();
@ -2546,13 +2531,7 @@ void QComboBox::hidePopup()
} }
// Fade out. // Fade out.
bool needFade = style()->styleHint(QStyle::SH_Menu_FadeOutOnHide); const bool needFade = style()->styleHint(QStyle::SH_Menu_FadeOutOnHide);
if (needFade) {
#if defined(Q_WS_MAC)
macWindowFade(qt_mac_window_for(d->container));
#endif // Q_WS_MAC
// Other platform implementations welcome :-)
}
d->model->blockSignals(false); d->model->blockSignals(false);
d->container->itemView()->blockSignals(false); d->container->itemView()->blockSignals(false);
d->container->blockSignals(false); d->container->blockSignals(false);