void DialogGui::initializeImageFileDialog(QFileDialog &fileDialog, QFileDialog::Options options, QFileDialog::FileMode fm)
{
fileDialog.setConfirmOverwrite( !(options & QFileDialog::DontConfirmOverwrite) );
- fileDialog.setResolveSymlinks( !(options & QFileDialog::DontResolveSymlinks) );
fileDialog.setIconProvider(ensureIconProvider());
fileDialog.setFileMode(fm);
}
dptr++;
}
break;
-# if defined(Q_WS_WIN)
- case QT_XFORM_TYPE_WINDOWSPIXMAP:
- while (dptr < maxp) {
- IWX_PIX(128);
- IWX_PIX(64);
- IWX_PIX(32);
- IWX_PIX(16);
- IWX_PIX(8);
- IWX_PIX(4);
- IWX_PIX(2);
- IWX_PIX(1);
- dptr++;
- }
- break;
-# endif
}
}
m21ydx += m21;
#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
result << QLatin1String("xim");
#endif
-#if defined(Q_WS_WIN) && !defined(QT_NO_XIM)
- result << QLatin1String("win");
-#endif
-#if defined(Q_WS_MAC)
- result << QLatin1String("mac");
-#endif
#ifndef QT_NO_LIBRARY
result += inputloader()->keys();
#endif // QT_NO_LIBRARY
if (key == QLatin1String("xim"))
return QStringList(QString());
#endif
-#if defined(Q_WS_WIN)
- if (key == QLatin1String("win"))
- return QStringList(QString());
-#endif
-#if defined(Q_WS_MAC)
- if (key == QLatin1String("mac"))
- return QStringList(QString());
-#endif
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
Q_UNUSED(key);
#else
if (key == QLatin1String("xim"))
return QInputContext::tr( "XIM input method" );
#endif
-#if defined(Q_WS_WIN) && !defined(QT_NO_XIM)
- if (key == QLatin1String("win"))
- return QInputContext::tr( "Windows input method" );
-#endif
-#if defined(Q_WS_MAC)
- if (key == QLatin1String("mac"))
- return QInputContext::tr( "Mac OS X input method" );
-#endif
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
Q_UNUSED(key);
#else
if (system.isEmpty()) {
system = QLatin1String("opengl");
}
-#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) || defined(Q_WS_X11)
+#elif defined (QT_GRAPHICSSYSTEM_RASTER) || defined(Q_WS_X11)
if (system.isEmpty()) {
system = QLatin1String("raster");
}
// expand the text beyond the edge.
if (sb_or_ws|breakany) {
QFixed rightBearing = lbh.rightBearing; // store previous right bearing
-#if !defined(Q_WS_MAC)
if (lbh.calculateNewWidth(line) - lbh.minimumRightBearing > line.width)
-#endif
lbh.adjustRightBearing();
if (lbh.checkFullOtherwiseExtend(line)) {
// we are too wide, fix right bearing
fontD->fontEngine = fontEngine;
fontD->fontEngine->ref.ref();
-#if defined(Q_WS_WIN)
- if (fontEngine->supportsSubPixelPositions())
- fontD->hintingPreference = QFont::PreferVerticalHinting;
- else
- fontD->hintingPreference = QFont::PreferFullHinting;
-#elif defined(Q_WS_MAC)
- fontD->hintingPreference = QFont::PreferNoHinting;
-#elif !defined(QT_NO_FREETYPE)
+#if !defined(QT_NO_FREETYPE)
if (fontEngine->type() == QFontEngine::Freetype) {
QFontEngineFT *freeTypeEngine = static_cast<QFontEngineFT *>(fontEngine);
switch (freeTypeEngine->defaultHintStyle()) {
#include "qdesktopservices_blackberry.cpp"
#elif defined(Q_WS_X11)
#include "qdesktopservices_x11.cpp"
-#elif defined(Q_WS_WIN)
-#include "qdesktopservices_win.cpp"
-#elif defined(Q_WS_MAC)
-#include "qdesktopservices_mac.cpp"
#endif
#include <qhash.h>
end(1);
}
else if (event == QKeySequence::MoveToNextChar) {
-#if !defined(Q_WS_WIN) || defined(QT_NO_COMPLETER)
+#if defined(QT_NO_COMPLETER)
if (hasSelectedText()) {
#else
if (hasSelectedText() && m_completer
cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
}
else if (event == QKeySequence::MoveToPreviousChar) {
-#if !defined(Q_WS_WIN) || defined(QT_NO_COMPLETER)
+#if defined(QT_NO_COMPLETER)
if (hasSelectedText()) {
#else
if (hasSelectedText() && m_completer
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
QRect QMenuPrivate::popupGeometry(const QWidget *widget) const
{
-#ifdef Q_WS_WIN
- return QApplication::desktop()->screenGeometry(widget);
-#elif defined Q_WS_X11
+#if defined Q_WS_X11
if (X11->desktopEnvironment == DE_KDE)
return QApplication::desktop()->screenGeometry(widget);
- else
- return QApplication::desktop()->availableGeometry(widget);
-#else
- return QApplication::desktop()->availableGeometry(widget);
#endif
+ return QApplication::desktop()->availableGeometry(widget);
}
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
QRect QMenuPrivate::popupGeometry(int screen) const
{
-#ifdef Q_WS_WIN
- return QApplication::desktop()->screenGeometry(screen);
-#elif defined Q_WS_X11
+#if defined Q_WS_X11
if (X11->desktopEnvironment == DE_KDE)
return QApplication::desktop()->screenGeometry(screen);
- else
- return QApplication::desktop()->availableGeometry(screen);
-#else
- return QApplication::desktop()->availableGeometry(screen);
#endif
+ return QApplication::desktop()->availableGeometry(screen);
}
QList<QPointer<QWidget> > QMenuPrivate::calcCausedStack() const
return actionRects.at(index);
}
-#if defined(Q_WS_MAC)
-static const qreal MenuFadeTimeInSec = 0.150;
-#endif
-
void QMenuPrivate::hideUpToMenuBar()
{
Q_Q(QMenu);
} else { caused = 0;
}
}
-#if defined(Q_WS_MAC)
- if (fadeMenus) {
- QEventLoop eventLoop;
- QTimer::singleShot(int(MenuFadeTimeInSec * 1000), &eventLoop, SLOT(quit()));
- QMacWindowFader::currentFader()->performFade();
- eventLoop.exec();
- }
-#endif
}
setCurrentAction(0);
}
// Should be something like: q->transitionWindow(Qt::FadeOutTransition, MenuFadeTimeInSec);
// Hopefully we'll integrate qt/research/windowtransitions into main before 4.4.
// Talk to Richard, Trenton or Bjoern.
-#if defined(Q_WS_MAC)
- if (justRegister) {
- QMacWindowFader::currentFader()->setFadeDuration(MenuFadeTimeInSec);
- QMacWindowFader::currentFader()->registerWindowToFade(menu);
- } else {
- macWindowFade(qt_mac_window_for(menu), MenuFadeTimeInSec);
- }
-
-#endif // Q_WS_MAC
}
aboutToHide = false;
menu->blockSignals(false);
else if (key == Qt::Key_Right)
key = Qt::Key_Left;
}
-#ifndef Q_WS_MAC
if (key == Qt::Key_Tab) //means down
key = Qt::Key_Down;
if (key == Qt::Key_Backtab) //means up
key = Qt::Key_Up;
-#endif
bool key_consumed = false;
switch(key) {
{
}
-
-#ifdef Q_WS_WIN
-static inline QRgb colorref2qrgb(COLORREF col)
-{
- return qRgb(GetRValue(col),GetGValue(col),GetBValue(col));
-}
-#endif
-
void QWorkspaceTitleBarPrivate::readColors()
{
Q_Q(QWorkspaceTitleBar);
QPalette pal = q->palette();
- bool colorsInitialized = false;
-
-#ifdef Q_WS_WIN // ask system properties on windows
-#ifndef SPI_GETGRADIENTCAPTIONS
-#define SPI_GETGRADIENTCAPTIONS 0x1008
-#endif
-#ifndef COLOR_GRADIENTACTIVECAPTION
-#define COLOR_GRADIENTACTIVECAPTION 27
-#endif
-#ifndef COLOR_GRADIENTINACTIVECAPTION
-#define COLOR_GRADIENTINACTIVECAPTION 28
-#endif
- if (QApplication::desktopSettingsAware()) {
- pal.setColor(QPalette::Active, QPalette::Highlight, colorref2qrgb(GetSysColor(COLOR_ACTIVECAPTION)));
- pal.setColor(QPalette::Inactive, QPalette::Highlight, colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTION)));
- pal.setColor(QPalette::Active, QPalette::HighlightedText, colorref2qrgb(GetSysColor(COLOR_CAPTIONTEXT)));
- pal.setColor(QPalette::Inactive, QPalette::HighlightedText, colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTIONTEXT)));
-
- colorsInitialized = true;
- BOOL gradient = false;
- SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &gradient, 0);
-
- if (gradient) {
- pal.setColor(QPalette::Active, QPalette::Base, colorref2qrgb(GetSysColor(COLOR_GRADIENTACTIVECAPTION)));
- pal.setColor(QPalette::Inactive, QPalette::Base, colorref2qrgb(GetSysColor(COLOR_GRADIENTINACTIVECAPTION)));
- } else {
- pal.setColor(QPalette::Active, QPalette::Base, pal.color(QPalette::Active, QPalette::Highlight));
- pal.setColor(QPalette::Inactive, QPalette::Base, pal.color(QPalette::Inactive, QPalette::Highlight));
- }
- }
-#endif // Q_WS_WIN
- if (!colorsInitialized) {
- pal.setColor(QPalette::Active, QPalette::Highlight,
- pal.color(QPalette::Active, QPalette::Highlight));
- pal.setColor(QPalette::Active, QPalette::Base,
- pal.color(QPalette::Active, QPalette::Highlight));
- pal.setColor(QPalette::Inactive, QPalette::Highlight,
- pal.color(QPalette::Inactive, QPalette::Dark));
- pal.setColor(QPalette::Inactive, QPalette::Base,
- pal.color(QPalette::Inactive, QPalette::Dark));
- pal.setColor(QPalette::Inactive, QPalette::HighlightedText,
- pal.color(QPalette::Inactive, QPalette::Window));
- }
+ pal.setColor(QPalette::Active, QPalette::Highlight,
+ pal.color(QPalette::Active, QPalette::Highlight));
+ pal.setColor(QPalette::Active, QPalette::Base,
+ pal.color(QPalette::Active, QPalette::Highlight));
+ pal.setColor(QPalette::Inactive, QPalette::Highlight,
+ pal.color(QPalette::Inactive, QPalette::Dark));
+ pal.setColor(QPalette::Inactive, QPalette::Base,
+ pal.color(QPalette::Inactive, QPalette::Dark));
+ pal.setColor(QPalette::Inactive, QPalette::HighlightedText,
+ pal.color(QPalette::Inactive, QPalette::Window));
q->setPalette(pal);
q->setActive(act);