QtWidgets: Remove Windows CE.
Remove Windows CE-specific files, #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: I102745aaca9d9737f2108fe7618111743d5ae980 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
4cb795cbdb
commit
115d4fc8cc
@ -4,5 +4,3 @@ SUBDIRS = draggableicons \
|
||||
dropsite \
|
||||
fridgemagnets \
|
||||
puzzle
|
||||
|
||||
wince: SUBDIRS -= dropsite
|
||||
|
@ -14,9 +14,3 @@ QMAKE_PROJECT_NAME = dndpuzzle
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/draganddrop/puzzle
|
||||
INSTALLS += target
|
||||
|
||||
wince {
|
||||
addFile.files = example.jpg
|
||||
addFile.path = .
|
||||
INSTALLS += addFile
|
||||
}
|
||||
|
@ -24,7 +24,3 @@ RESOURCES += boxes.qrc
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/boxes
|
||||
INSTALLS += target
|
||||
|
||||
wince {
|
||||
DEPLOYMENT_PLUGIN += qjpeg
|
||||
}
|
||||
|
@ -62,11 +62,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
QGraphicsScene scene;
|
||||
scene.setStickyFocus(true);
|
||||
#ifndef Q_OS_WINCE
|
||||
const int gridSize = 10;
|
||||
#else
|
||||
const int gridSize = 5;
|
||||
#endif
|
||||
|
||||
for (int y = 0; y < gridSize; ++y) {
|
||||
for (int x = 0; x < gridSize; ++x) {
|
||||
|
@ -12,8 +12,3 @@ SOURCES = main.cpp \
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/itemviews/puzzle
|
||||
INSTALLS += target
|
||||
|
||||
|
||||
wince* {
|
||||
DEPLOYMENT_PLUGIN += qjpeg qgif
|
||||
}
|
||||
|
@ -16,7 +16,3 @@ RESOURCES += affine.qrc
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/affine
|
||||
INSTALLS += target
|
||||
|
||||
wince {
|
||||
DEPLOYMENT_PLUGIN += qjpeg
|
||||
}
|
||||
|
@ -15,7 +15,3 @@ QT += widgets
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/composition
|
||||
INSTALLS += target
|
||||
|
||||
wince* {
|
||||
DEPLOYMENT_PLUGIN += qjpeg
|
||||
}
|
||||
|
@ -9,10 +9,3 @@ SOURCES = highlighter.cpp \
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/richtext/syntaxhighlighter
|
||||
INSTALLS += target
|
||||
|
||||
|
||||
wince {
|
||||
addFiles.files = main.cpp mainwindow.cpp
|
||||
addFiles.path = .
|
||||
INSTALLS += addFiles
|
||||
}
|
||||
|
@ -17,14 +17,3 @@ EXAMPLE_FILES = images/*
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/icons
|
||||
INSTALLS += target
|
||||
|
||||
|
||||
wince {
|
||||
imageFiles.files = images/*
|
||||
wincewm*: {
|
||||
imageFiles.path = "/My Documents/My Pictures"
|
||||
} else {
|
||||
imageFiles.path = images
|
||||
}
|
||||
INSTALLS += imageFiles
|
||||
}
|
||||
|
@ -8,8 +8,3 @@ SOURCES = imageviewer.cpp \
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/imageviewer
|
||||
INSTALLS += target
|
||||
|
||||
|
||||
wince {
|
||||
DEPLOYMENT_PLUGIN += qjpeg qgif
|
||||
}
|
||||
|
@ -9,10 +9,3 @@ EXAMPLE_FILES = animation.gif
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/movie
|
||||
INSTALLS += target
|
||||
|
||||
|
||||
wince {
|
||||
addFiles.files += *.gif
|
||||
addFiles.path = .
|
||||
INSTALLS += addFiles
|
||||
}
|
||||
|
@ -1203,14 +1203,10 @@ QColorShower::QColorShower(QColorDialog *parent)
|
||||
gl->setMargin(gl->spacing());
|
||||
lab = new QColorShowLabel(this);
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
#ifdef QT_SMALL_COLORDIALOG
|
||||
lab->setMinimumHeight(60);
|
||||
#endif
|
||||
lab->setMinimumWidth(60);
|
||||
#else
|
||||
lab->setMinimumWidth(20);
|
||||
#endif
|
||||
|
||||
// For QVGA screens only the comboboxes and color label are visible.
|
||||
// For nHD screens only color and luminence pickers and color label are visible.
|
||||
@ -1725,7 +1721,7 @@ void QColorDialogPrivate::initWidgets()
|
||||
|
||||
leftLay = 0;
|
||||
|
||||
#if defined(Q_OS_WINCE) || defined(QT_SMALL_COLORDIALOG)
|
||||
#if defined(QT_SMALL_COLORDIALOG)
|
||||
smallDisplay = true;
|
||||
const int lumSpace = 20;
|
||||
#else
|
||||
@ -1748,7 +1744,7 @@ void QColorDialogPrivate::initWidgets()
|
||||
leftLay->addWidget(lblBasicColors);
|
||||
leftLay->addWidget(standard);
|
||||
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_SMALL_COLORDIALOG)
|
||||
#if !defined(QT_SMALL_COLORDIALOG)
|
||||
// The screen color picker button
|
||||
screenColorPickerButton = new QPushButton();
|
||||
leftLay->addWidget(screenColorPickerButton);
|
||||
@ -1757,9 +1753,7 @@ void QColorDialogPrivate::initWidgets()
|
||||
q->connect(screenColorPickerButton, SIGNAL(clicked()), SLOT(_q_pickScreenColor()));
|
||||
#endif
|
||||
|
||||
#if !defined(Q_OS_WINCE)
|
||||
leftLay->addStretch();
|
||||
#endif
|
||||
|
||||
custom = new QColorWell(q, customColorRows, colorColumns, QColorDialogOptions::customColors());
|
||||
custom->setAcceptDrops(true);
|
||||
|
@ -427,31 +427,6 @@ void QDialogPrivate::resetModalitySetByOpen()
|
||||
resetModalityTo = -1;
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
void QDialogPrivate::_q_doneAction()
|
||||
{
|
||||
//Done...
|
||||
QApplication::postEvent(q_func(), new QEvent(QEvent::OkRequest));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
bool QDialog::event(QEvent *e)
|
||||
{
|
||||
bool result = QWidget::event(e);
|
||||
#ifdef Q_OS_WINCE
|
||||
if (e->type() == QEvent::OkRequest) {
|
||||
accept();
|
||||
result = true;
|
||||
}
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
In general returns the modal dialog's result code, \c Accepted or
|
||||
\c Rejected.
|
||||
|
@ -98,9 +98,6 @@ public Q_SLOTS:
|
||||
protected:
|
||||
QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
bool event(QEvent *e);
|
||||
#endif
|
||||
void keyPressEvent(QKeyEvent *);
|
||||
void closeEvent(QCloseEvent *);
|
||||
void showEvent(QShowEvent *);
|
||||
@ -113,10 +110,6 @@ protected:
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QDialog)
|
||||
Q_DISABLE_COPY(QDialog)
|
||||
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_doneAction())
|
||||
#endif
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -99,10 +99,6 @@ public:
|
||||
void hideDefault();
|
||||
void resetModalitySetByOpen();
|
||||
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
void _q_doneAction();
|
||||
#endif
|
||||
|
||||
int rescode;
|
||||
int resetModalityTo;
|
||||
bool wasModalitySet;
|
||||
|
@ -60,11 +60,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
extern bool qt_wince_is_mobile(); //defined in qguifunctions_wince.cpp
|
||||
extern bool qt_wince_is_high_dpi(); //defined in qguifunctions_wince.cpp
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QErrorMessagePrivate : public QDialogPrivate
|
||||
@ -100,32 +95,12 @@ public:
|
||||
|
||||
QSize QErrorMessageTextView::minimumSizeHint() const
|
||||
{
|
||||
#ifdef Q_OS_WINCE
|
||||
if (qt_wince_is_mobile())
|
||||
if (qt_wince_is_high_dpi())
|
||||
return QSize(200, 200);
|
||||
else
|
||||
return QSize(100, 100);
|
||||
else
|
||||
return QSize(70, 70);
|
||||
#else
|
||||
return QSize(50, 50);
|
||||
#endif
|
||||
}
|
||||
|
||||
QSize QErrorMessageTextView::sizeHint() const
|
||||
{
|
||||
#ifdef Q_OS_WINCE
|
||||
if (qt_wince_is_mobile())
|
||||
if (qt_wince_is_high_dpi())
|
||||
return QSize(400, 200);
|
||||
else
|
||||
return QSize(320, 120);
|
||||
else
|
||||
return QSize(300, 100);
|
||||
#else
|
||||
return QSize(250, 75);
|
||||
#endif //Q_OS_WINCE
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -248,9 +223,6 @@ QErrorMessage::QErrorMessage(QWidget * parent)
|
||||
d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
|
||||
#endif
|
||||
d->again->setChecked(true);
|
||||
#if defined(Q_OS_WINCE)
|
||||
d->ok->setFixedSize(0,0);
|
||||
#endif
|
||||
d->ok->setFocus();
|
||||
|
||||
d->retranslateStrings();
|
||||
|
@ -60,15 +60,7 @@
|
||||
#include <qmimedatabase.h>
|
||||
#include <qapplication.h>
|
||||
#include <qstylepainter.h>
|
||||
#if !defined(Q_OS_WINCE)
|
||||
#include "ui_qfiledialog.h"
|
||||
#else
|
||||
#define Q_EMBEDDED_SMALLSCREEN
|
||||
#include "ui_qfiledialog_embedded.h"
|
||||
#if defined(Q_OS_WINCE)
|
||||
extern bool qt_priv_ptr_valid;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(Q_OS_UNIX)
|
||||
#include <pwd.h>
|
||||
#include <unistd.h> // for pathconf() on OS X
|
||||
@ -1750,7 +1742,7 @@ int QFileDialogPrivate::maxNameLength(const QString &path)
|
||||
{
|
||||
#if defined(Q_OS_UNIX)
|
||||
return ::pathconf(QFile::encodeName(path).data(), _PC_NAME_MAX);
|
||||
#elif defined(Q_OS_WINCE) || defined(Q_OS_WINRT)
|
||||
#elif defined(Q_OS_WINRT)
|
||||
Q_UNUSED(path);
|
||||
return MAX_PATH;
|
||||
#elif defined(Q_OS_WIN)
|
||||
@ -4015,7 +4007,7 @@ QString QFSCompleter::pathFromIndex(const QModelIndex &index) const
|
||||
QString currentLocation = dirModel->rootPath();
|
||||
QString path = index.data(QFileSystemModel::FilePathRole).toString();
|
||||
if (!currentLocation.isEmpty() && path.startsWith(currentLocation)) {
|
||||
#if defined(Q_OS_UNIX) || defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_UNIX)
|
||||
if (currentLocation == QDir::separator())
|
||||
return path.mid(currentLocation.length());
|
||||
#endif
|
||||
|
@ -177,10 +177,6 @@ public:
|
||||
#if defined(Q_OS_WIN)
|
||||
QString n(path);
|
||||
n.replace(QLatin1Char('\\'), QLatin1Char('/'));
|
||||
#if defined(Q_OS_WINCE)
|
||||
if ((n.size() > 1) && (n.startsWith(QLatin1String("//"))))
|
||||
n = n.mid(1);
|
||||
#endif
|
||||
return n;
|
||||
#else // the compile should optimize away this
|
||||
return path;
|
||||
|
@ -263,7 +263,7 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
|
||||
static QString translateDriveName(const QFileInfo &drive)
|
||||
{
|
||||
QString driveName = drive.absoluteFilePath();
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
if (driveName.startsWith(QLatin1Char('/'))) // UNC host
|
||||
return drive.fileName();
|
||||
if (driveName.endsWith(QLatin1Char('/')))
|
||||
|
@ -366,13 +366,13 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
|
||||
// ### TODO can we use bool QAbstractFileEngine::caseSensitive() const?
|
||||
QStringList pathElements = absolutePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
|
||||
if ((pathElements.isEmpty())
|
||||
#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
|
||||
#if !defined(Q_OS_WIN)
|
||||
&& QDir::fromNativeSeparators(longPath) != QLatin1String("/")
|
||||
#endif
|
||||
)
|
||||
return const_cast<QFileSystemModelPrivate::QFileSystemNode*>(&root);
|
||||
QModelIndex index = QModelIndex(); // start with "My Computer"
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
if (absolutePath.startsWith(QLatin1String("//"))) { // UNC path
|
||||
QString host = QLatin1String("\\\\") + pathElements.constFirst();
|
||||
if (absolutePath == QDir::fromNativeSeparators(host))
|
||||
@ -398,7 +398,7 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
|
||||
} else
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
{
|
||||
if (!pathElements.at(0).contains(QLatin1Char(':'))) {
|
||||
QString rootPath = QDir(longPath).rootPath();
|
||||
@ -831,7 +831,7 @@ QString QFileSystemModelPrivate::name(const QModelIndex &index) const
|
||||
*/
|
||||
QString QFileSystemModelPrivate::displayName(const QModelIndex &index) const
|
||||
{
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
QFileSystemNode *dirNode = node(index);
|
||||
if (!dirNode->volumeName.isNull())
|
||||
return dirNode->volumeName + QLatin1String(" (") + name(index) + QLatin1Char(')');
|
||||
@ -1281,11 +1281,10 @@ QString QFileSystemModelPrivate::filePath(const QModelIndex &index) const
|
||||
idx = idx.parent();
|
||||
}
|
||||
QString fullPath = QDir::fromNativeSeparators(path.join(QDir::separator()));
|
||||
#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
|
||||
#if !defined(Q_OS_WIN)
|
||||
if ((fullPath.length() > 2) && fullPath[0] == QLatin1Char('/') && fullPath[1] == QLatin1Char('/'))
|
||||
fullPath = fullPath.mid(1);
|
||||
#endif
|
||||
#if defined(Q_OS_WIN)
|
||||
#else
|
||||
if (fullPath.length() == 2 && fullPath.endsWith(QLatin1Char(':')))
|
||||
fullPath.append(QLatin1Char('/'));
|
||||
#endif
|
||||
@ -1676,7 +1675,7 @@ QFileSystemModelPrivate::QFileSystemNode* QFileSystemModelPrivate::addNode(QFile
|
||||
#else
|
||||
Q_UNUSED(info)
|
||||
#endif
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
//The parentNode is "" so we are listing the drives
|
||||
if (parentNode->fileName.isEmpty()) {
|
||||
wchar_t name[MAX_PATH + 1];
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
}
|
||||
|
||||
QString fileName;
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
QString volumeName;
|
||||
#endif
|
||||
|
||||
|
@ -321,11 +321,7 @@ void QFontDialogPrivate::init()
|
||||
buttonBox->addButton(QDialogButtonBox::Cancel);
|
||||
QObject::connect(buttonBox, SIGNAL(rejected()), q, SLOT(reject()));
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
q->resize(180, 120);
|
||||
#else
|
||||
q->resize(500, 360);
|
||||
#endif // Q_OS_WINCE
|
||||
|
||||
sizeEdit->installEventFilter(q);
|
||||
familyList->installEventFilter(q);
|
||||
|
@ -218,9 +218,6 @@ public:
|
||||
int layoutMinimumWidth();
|
||||
void retranslateStrings();
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
void hideSpecial();
|
||||
#endif
|
||||
static int showOldMessageBox(QWidget *parent, QMessageBox::Icon icon,
|
||||
const QString &title, const QString &text,
|
||||
int button0, int button1, int button2);
|
||||
@ -362,24 +359,15 @@ void QMessageBoxPrivate::updateSize()
|
||||
return;
|
||||
|
||||
QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
|
||||
#if defined(Q_OS_WINCE)
|
||||
// the width of the screen, less the window border.
|
||||
int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width());
|
||||
#else
|
||||
int hardLimit = qMin(screenSize.width() - 480, 1000); // can never get bigger than this
|
||||
// on small screens allows the messagebox be the same size as the screen
|
||||
if (screenSize.width() <= 1024)
|
||||
hardLimit = screenSize.width();
|
||||
#endif
|
||||
#ifdef Q_OS_MAC
|
||||
int softLimit = qMin(screenSize.width()/2, 420);
|
||||
#else
|
||||
// note: ideally on windows, hard and soft limits but it breaks compat
|
||||
#ifndef Q_OS_WINCE
|
||||
int softLimit = qMin(screenSize.width()/2, 500);
|
||||
#else
|
||||
int softLimit = qMin(screenSize.width() * 3 / 4, 500);
|
||||
#endif //Q_OS_WINCE
|
||||
#endif
|
||||
|
||||
if (informativeLabel)
|
||||
@ -436,28 +424,6 @@ void QMessageBoxPrivate::updateSize()
|
||||
QCoreApplication::removePostedEvents(q, QEvent::LayoutRequest);
|
||||
}
|
||||
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
/*!
|
||||
\internal
|
||||
Hides special buttons which are rather shown in the title bar
|
||||
on WinCE, to conserve screen space.
|
||||
*/
|
||||
|
||||
void QMessageBoxPrivate::hideSpecial()
|
||||
{
|
||||
Q_Q(QMessageBox);
|
||||
QList<QPushButton*> list = q->findChildren<QPushButton*>();
|
||||
for (int i=0; i<list.size(); ++i) {
|
||||
QPushButton *pb = list.at(i);
|
||||
QString text = pb->text();
|
||||
text.remove(QChar::fromLatin1('&'));
|
||||
if (text == QApplication::translate("QMessageBox", "OK" ))
|
||||
pb->setFixedSize(0,0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int oldButton(int button)
|
||||
{
|
||||
switch (button & QMessageBox::ButtonMask) {
|
||||
@ -1368,24 +1334,6 @@ bool QMessageBox::event(QEvent *e)
|
||||
case QEvent::LanguageChange:
|
||||
d_func()->retranslateStrings();
|
||||
break;
|
||||
#ifdef Q_OS_WINCE
|
||||
case QEvent::OkRequest:
|
||||
case QEvent::HelpRequest: {
|
||||
QString bName =
|
||||
(e->type() == QEvent::OkRequest)
|
||||
? QApplication::translate("QMessageBox", "OK")
|
||||
: QApplication::translate("QMessageBox", "Help");
|
||||
QList<QPushButton*> list = findChildren<QPushButton*>();
|
||||
for (int i=0; i<list.size(); ++i) {
|
||||
QPushButton *pb = list.at(i);
|
||||
if (pb->text() == bName) {
|
||||
if (pb->isEnabled())
|
||||
pb->click();
|
||||
return pb->isEnabled();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1525,20 +1473,6 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
|
||||
QDialog::keyPressEvent(e);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void QMessageBox::setVisible(bool visible)
|
||||
{
|
||||
Q_D(QMessageBox);
|
||||
if (visible)
|
||||
d->hideSpecial();
|
||||
QDialog::setVisible(visible);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*!
|
||||
\overload
|
||||
|
||||
@ -1596,9 +1530,6 @@ void QMessageBox::showEvent(QShowEvent *e)
|
||||
Q_D(QMessageBox);
|
||||
if (d->autoAddOkButton) {
|
||||
addButton(Ok);
|
||||
#if defined(Q_OS_WINCE)
|
||||
d->hideSpecial();
|
||||
#endif
|
||||
}
|
||||
if (d->detailsButton)
|
||||
addButton(d->detailsButton, QMessageBox::ActionRole);
|
||||
@ -1915,9 +1846,6 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
|
||||
QPixmap pm(QLatin1String(":/qt-project.org/qmessagebox/images/qtlogo-64.png"));
|
||||
if (!pm.isNull())
|
||||
msgBox->setIconPixmap(pm);
|
||||
#if defined(Q_OS_WINCE)
|
||||
msgBox->setDefaultButton(msgBox->addButton(QMessageBox::Ok));
|
||||
#endif
|
||||
|
||||
// should perhaps be a style hint
|
||||
#ifdef Q_OS_MAC
|
||||
|
@ -142,10 +142,6 @@ public:
|
||||
QPushButton *addButton(StandardButton button);
|
||||
void removeButton(QAbstractButton *button);
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
void setVisible(bool visible);
|
||||
#endif
|
||||
|
||||
using QDialog::open;
|
||||
void open(QObject *receiver, const char *member);
|
||||
|
||||
|
@ -69,10 +69,6 @@
|
||||
#include "private/qdialog_p.h"
|
||||
#include <qdebug.h>
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp
|
||||
#endif
|
||||
|
||||
#include <string.h> // for memset()
|
||||
#include <algorithm>
|
||||
|
||||
@ -2215,10 +2211,6 @@ QWizard::QWizard(QWidget *parent, Qt::WindowFlags flags)
|
||||
{
|
||||
Q_D(QWizard);
|
||||
d->init();
|
||||
#ifdef Q_OS_WINCE
|
||||
if (!qt_wince_is_mobile())
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowOkButtonHint);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -858,7 +858,7 @@ QModelIndex QDirModel::index(const QString &path, int column) const
|
||||
return QModelIndex();
|
||||
|
||||
QString absolutePath = QDir(path).absolutePath();
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
absolutePath = absolutePath.toLower();
|
||||
// On Windows, "filename......." and "filename" are equivalent
|
||||
if (absolutePath.endsWith(QLatin1Char('.'))) {
|
||||
@ -873,7 +873,7 @@ QModelIndex QDirModel::index(const QString &path, int column) const
|
||||
|
||||
QStringList pathElements = absolutePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
|
||||
if ((pathElements.isEmpty() || !QFileInfo::exists(path))
|
||||
#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
|
||||
#if !defined(Q_OS_WIN)
|
||||
&& path != QLatin1String("/")
|
||||
#endif
|
||||
)
|
||||
@ -883,7 +883,7 @@ QModelIndex QDirModel::index(const QString &path, int column) const
|
||||
if (!d->root.populated) // make sure the root is populated
|
||||
d->populate(&d->root);
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
if (absolutePath.startsWith(QLatin1String("//"))) { // UNC path
|
||||
QString host = pathElements.first();
|
||||
int r = 0;
|
||||
@ -901,7 +901,7 @@ QModelIndex QDirModel::index(const QString &path, int column) const
|
||||
emit const_cast<QDirModel*>(this)->layoutChanged();
|
||||
} else
|
||||
#endif
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
if (pathElements.at(0).endsWith(QLatin1Char(':'))) {
|
||||
pathElements[0] += QLatin1Char('/');
|
||||
}
|
||||
@ -925,7 +925,7 @@ QModelIndex QDirModel::index(const QString &path, int column) const
|
||||
const QFileInfo& fi = parent->children.at(j).info;
|
||||
QString childFileName;
|
||||
childFileName = idx.isValid() ? fi.fileName() : fi.absoluteFilePath();
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
childFileName = childFileName.toLower();
|
||||
#endif
|
||||
if (childFileName == element) {
|
||||
@ -938,15 +938,7 @@ QModelIndex QDirModel::index(const QString &path, int column) const
|
||||
|
||||
// we couldn't find the path element, we create a new node since we _know_ that the path is valid
|
||||
if (row == -1) {
|
||||
#if defined(Q_OS_WINCE)
|
||||
QString newPath;
|
||||
if (parent->info.isRoot())
|
||||
newPath = parent->info.absoluteFilePath() + element;
|
||||
else
|
||||
newPath = parent->info.absoluteFilePath() + QLatin1Char('/') + element;
|
||||
#else
|
||||
QString newPath = parent->info.absoluteFilePath() + QLatin1Char('/') + element;
|
||||
#endif
|
||||
if (!d->allowAppendChild || !QFileInfo(newPath).isDir())
|
||||
return QModelIndex();
|
||||
d->appendChild(parent, newPath);
|
||||
@ -1290,7 +1282,7 @@ QString QDirModelPrivate::name(const QModelIndex &index) const
|
||||
const QFileInfo info = n->info;
|
||||
if (info.isRoot()) {
|
||||
QString name = info.absoluteFilePath();
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
if (name.startsWith(QLatin1Char('/'))) // UNC host
|
||||
return info.fileName();
|
||||
if (name.endsWith(QLatin1Char('/')))
|
||||
|
@ -365,7 +365,7 @@ QIcon QFileIconProvider::icon(const QFileInfo &info) const
|
||||
return retIcon;
|
||||
|
||||
if (info.isRoot())
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
{
|
||||
UINT type = GetDriveType((wchar_t *)info.absoluteFilePath().utf16());
|
||||
|
||||
|
@ -101,23 +101,13 @@
|
||||
|
||||
#include "qdatetime.h"
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
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 <qpa/qplatformwindow.h>
|
||||
|
||||
//#define ALIEN_DEBUG
|
||||
|
||||
static void initResources()
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
Q_INIT_RESOURCE(qstyle_wince);
|
||||
#else
|
||||
Q_INIT_RESOURCE(qstyle);
|
||||
#endif
|
||||
Q_INIT_RESOURCE(qmessagebox);
|
||||
|
||||
}
|
||||
@ -171,12 +161,7 @@ static QByteArray nativeStyleClassName()
|
||||
return name;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
int QApplicationPrivate::autoMaximizeThreshold = -1;
|
||||
bool QApplicationPrivate::autoSipEnabled = false;
|
||||
#else
|
||||
bool QApplicationPrivate::autoSipEnabled = true;
|
||||
#endif
|
||||
|
||||
QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, int flags)
|
||||
: QApplicationPrivateBase(argc, argv, flags)
|
||||
@ -654,17 +639,6 @@ void QApplicationPrivate::initialize()
|
||||
if (qEnvironmentVariableIntValue("QT_USE_NATIVE_WINDOWS") > 0)
|
||||
QCoreApplication::setAttribute(Qt::AA_NativeWindows);
|
||||
|
||||
#ifdef Q_OS_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_OS_WINCE
|
||||
|
||||
#ifndef QT_NO_WHEELEVENT
|
||||
QApplicationPrivate::wheel_scroll_lines = 3;
|
||||
#endif
|
||||
@ -1058,19 +1032,6 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis
|
||||
|
||||
The default is platform dependent.
|
||||
*/
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
void QApplication::setAutoMaximizeThreshold(const int threshold)
|
||||
{
|
||||
QApplicationPrivate::autoMaximizeThreshold = threshold;
|
||||
}
|
||||
|
||||
int QApplication::autoMaximizeThreshold() const
|
||||
{
|
||||
return QApplicationPrivate::autoMaximizeThreshold;
|
||||
}
|
||||
#endif
|
||||
|
||||
void QApplication::setAutoSipEnabled(const bool enabled)
|
||||
{
|
||||
QApplicationPrivate::autoSipEnabled = enabled;
|
||||
@ -3777,7 +3738,7 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e)
|
||||
if (receiver->isWidgetType()) {
|
||||
QWidget *widget = static_cast<QWidget *>(receiver);
|
||||
|
||||
#if !defined(Q_OS_WINCE) || (defined(GWES_ICONCURS) && !defined(QT_NO_CURSOR))
|
||||
#if !defined(QT_NO_CURSOR)
|
||||
// toggle HasMouse widget state on enter and leave
|
||||
if ((e->type() == QEvent::Enter || e->type() == QEvent::DragEnter) &&
|
||||
(!QApplication::activePopupWidget() || QApplication::activePopupWidget() == widget->window()))
|
||||
|
@ -83,9 +83,6 @@ class Q_WIDGETS_EXPORT QApplication : public QGuiApplication
|
||||
Q_PROPERTY(int startDragDistance READ startDragDistance WRITE setStartDragDistance)
|
||||
#ifndef QT_NO_STYLE_STYLESHEET
|
||||
Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
|
||||
#endif
|
||||
#ifdef Q_OS_WINCE
|
||||
Q_PROPERTY(int autoMaximizeThreshold READ autoMaximizeThreshold WRITE setAutoMaximizeThreshold)
|
||||
#endif
|
||||
Q_PROPERTY(bool autoSipEnabled READ autoSipEnabled WRITE setAutoSipEnabled)
|
||||
|
||||
@ -194,10 +191,6 @@ public:
|
||||
public Q_SLOTS:
|
||||
#ifndef QT_NO_STYLE_STYLESHEET
|
||||
void setStyleSheet(const QString& sheet);
|
||||
#endif
|
||||
#ifdef Q_OS_WINCE
|
||||
void setAutoMaximizeThreshold(const int threshold);
|
||||
int autoMaximizeThreshold() const;
|
||||
#endif
|
||||
void setAutoSipEnabled(const bool enabled);
|
||||
bool autoSipEnabled() const;
|
||||
|
@ -90,11 +90,8 @@ extern Q_GUI_EXPORT bool qt_is_gui_used;
|
||||
extern QClipboard *qt_clipboard;
|
||||
#endif
|
||||
|
||||
#if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN) || defined(Q_OS_WINCE)
|
||||
#if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN)
|
||||
extern QSysInfo::WinVersion qt_winver;
|
||||
# ifdef Q_OS_WINCE
|
||||
extern DWORD qt_cever;
|
||||
# endif
|
||||
#elif defined (Q_OS_MAC)
|
||||
extern QSysInfo::MacVersion qt_macver;
|
||||
#endif
|
||||
@ -125,9 +122,6 @@ public:
|
||||
static bool x11_apply_settings();
|
||||
#endif
|
||||
static void reset_instance_pointer();
|
||||
#endif
|
||||
#ifdef Q_OS_WINCE
|
||||
static int autoMaximizeThreshold;
|
||||
#endif
|
||||
static bool autoSipEnabled;
|
||||
static QString desktopStyleKey();
|
||||
|
@ -945,12 +945,7 @@ void QLayout::addChildWidget(QWidget *w)
|
||||
void QLayout::setMenuBar(QWidget *widget)
|
||||
{
|
||||
Q_D(QLayout);
|
||||
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
if (widget && widget->size().height() > 0)
|
||||
#else
|
||||
if (widget)
|
||||
#endif
|
||||
addChildWidget(widget);
|
||||
d->menubar = widget;
|
||||
}
|
||||
|
@ -1107,11 +1107,7 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w)
|
||||
if (customize)
|
||||
; // don't modify window flags if the user explicitly set them.
|
||||
else if (type == Qt::Dialog || type == Qt::Sheet)
|
||||
#ifndef Q_OS_WINCE
|
||||
flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint;
|
||||
#else
|
||||
flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
|
||||
#endif
|
||||
else if (type == Qt::Tool)
|
||||
flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
|
||||
else
|
||||
@ -4551,7 +4547,7 @@ const QPalette &QWidget::palette() const
|
||||
if (!isEnabled()) {
|
||||
data->pal.setCurrentColorGroup(QPalette::Disabled);
|
||||
} else if ((!isVisible() || isActiveWindow())
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
&& !QApplicationPrivate::isBlockedByModal(const_cast<QWidget *>(this))
|
||||
#endif
|
||||
) {
|
||||
@ -8552,13 +8548,9 @@ QSize QWidgetPrivate::adjustedSize() const
|
||||
#else // all others
|
||||
QRect screen = QApplication::desktop()->screenGeometry(q->pos());
|
||||
#endif
|
||||
#if defined (Q_OS_WINCE)
|
||||
s.setWidth(qMin(s.width(), screen.width()));
|
||||
s.setHeight(qMin(s.height(), screen.height()));
|
||||
#else
|
||||
s.setWidth(qMin(s.width(), screen.width()*2/3));
|
||||
s.setHeight(qMin(s.height(), screen.height()*2/3));
|
||||
#endif
|
||||
|
||||
if (QTLWExtra *extra = maybeTopData())
|
||||
extra->sizeAdjusted = true;
|
||||
}
|
||||
|
@ -1,120 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtWidgets module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#include "qwidgetsfunctions_wince.h"
|
||||
#include <shellapi.h>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
#ifndef ShellExecute
|
||||
HINSTANCE qt_wince_ShellExecute(HWND hwnd, LPCWSTR, LPCWSTR file, LPCWSTR params, LPCWSTR dir, int showCmd)
|
||||
{
|
||||
SHELLEXECUTEINFO info;
|
||||
info.hwnd = hwnd;
|
||||
info.lpVerb = L"Open";
|
||||
info.lpFile = file;
|
||||
info.lpParameters = params;
|
||||
info.lpDirectory = dir;
|
||||
info.nShow = showCmd;
|
||||
info.cbSize = sizeof(info);
|
||||
ShellExecuteEx(&info);
|
||||
return info.hInstApp;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Internal Qt -----------------------------------------------------
|
||||
bool qt_wince_is_platform(const QString &platformString) {
|
||||
wchar_t tszPlatform[64];
|
||||
if (SystemParametersInfo(SPI_GETPLATFORMNAME, sizeof(tszPlatform) / sizeof(wchar_t), tszPlatform, 0))
|
||||
if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.utf16()), tszPlatform))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int qt_wince_get_build()
|
||||
{
|
||||
OSVERSIONINFO osvi;
|
||||
osvi.dwOSVersionInfoSize = sizeof(osvi);
|
||||
if (GetVersionEx(&osvi))
|
||||
return osvi.dwBuildNumber;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int qt_wince_get_version()
|
||||
{
|
||||
OSVERSIONINFO osvi;
|
||||
osvi.dwOSVersionInfoSize = sizeof(osvi);
|
||||
if (GetVersionEx(&osvi))
|
||||
return (osvi.dwMajorVersion * 10 + osvi.dwMinorVersion);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool qt_wince_is_windows_mobile_65()
|
||||
{
|
||||
const DWORD dwFirstWM65BuildNumber = 21139;
|
||||
OSVERSIONINFO osvi;
|
||||
osvi.dwOSVersionInfoSize = sizeof(osvi);
|
||||
if (!GetVersionEx(&osvi))
|
||||
return false;
|
||||
return osvi.dwMajorVersion > 5
|
||||
|| (osvi.dwMajorVersion == 5 && (osvi.dwMinorVersion > 2 ||
|
||||
(osvi.dwMinorVersion == 2 && osvi.dwBuildNumber >= dwFirstWM65BuildNumber)));
|
||||
}
|
||||
|
||||
bool qt_wince_is_pocket_pc() {
|
||||
return qt_wince_is_platform(QString::fromLatin1("PocketPC"));
|
||||
}
|
||||
|
||||
bool qt_wince_is_smartphone() {
|
||||
return qt_wince_is_platform(QString::fromLatin1("Smartphone"));
|
||||
}
|
||||
bool qt_wince_is_mobile() {
|
||||
return (qt_wince_is_smartphone() || qt_wince_is_pocket_pc());
|
||||
}
|
||||
|
||||
bool qt_wince_is_high_dpi() {
|
||||
if (!qt_wince_is_pocket_pc())
|
||||
return false;
|
||||
HDC deviceContext = GetDC(0);
|
||||
int dpi = GetDeviceCaps(deviceContext, LOGPIXELSX);
|
||||
ReleaseDC(0, deviceContext);
|
||||
if ((dpi < 1000) && (dpi > 0))
|
||||
return dpi > 96;
|
||||
else
|
||||
return false;
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtWidgets module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#ifndef QWIDGETSFUNCTIONS_WCE_H
|
||||
#define QWIDGETSFUNCTIONS_WCE_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
#include <QtCore/qfunctions_wince.h>
|
||||
|
||||
#ifdef QT_BUILD_GUI_LIB
|
||||
QT_BEGIN_NAMESPACE
|
||||
QT_END_NAMESPACE
|
||||
#endif
|
||||
|
||||
|
||||
//WinCe 7 has shell support
|
||||
#ifndef ShellExecute
|
||||
HINSTANCE qt_wince_ShellExecute(HWND hwnd, LPCWSTR operation, LPCWSTR file, LPCWSTR params, LPCWSTR dir, int showCmd);
|
||||
#define ShellExecute(a,b,c,d,e,f) qt_wince_ShellExecute(a,b,c,d,e,f)
|
||||
#endif
|
||||
|
||||
#endif // Q_OS_WINCE
|
||||
#endif // QWIDGETSFUNCTIONS_WCE_H
|
@ -2,6 +2,4 @@
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
INCLUDEPATH += ../3rdparty/wintab
|
||||
!wince:!winrt {
|
||||
LIBS_PRIVATE *= -lshell32
|
||||
}
|
||||
!winrt: LIBS_PRIVATE *= -lshell32
|
||||
|
@ -1,97 +0,0 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/qt-project.org/styles/commonstyle">
|
||||
<file>images/filelink-16.png</file>
|
||||
<file>images/filelink-32.png</file>
|
||||
<file>images/file-16.png</file>
|
||||
<file>images/file-32.png</file>
|
||||
<file>images/newdirectory-16.png</file>
|
||||
<file>images/newdirectory-32.png</file>
|
||||
<file>images/parentdir-16.png</file>
|
||||
<file>images/parentdir-32.png</file>
|
||||
<file>images/dvd-16.png</file>
|
||||
<file>images/dvd-32.png</file>
|
||||
<file>images/cdr-16.png</file>
|
||||
<file>images/cdr-32.png</file>
|
||||
<file>images/floppy-16.png</file>
|
||||
<file>images/floppy-32.png</file>
|
||||
<file>images/harddrive-16.png</file>
|
||||
<file>images/harddrive-32.png</file>
|
||||
<file>images/trash-16.png</file>
|
||||
<file>images/trash-32.png</file>
|
||||
<file>images/networkdrive-16.png</file>
|
||||
<file>images/networkdrive-32.png</file>
|
||||
<file>images/computer-16.png</file>
|
||||
<file>images/computer-32.png</file>
|
||||
<file>images/desktop-16.png</file>
|
||||
<file>images/desktop-32.png</file>
|
||||
<file>images/dirclosed-16.png</file>
|
||||
<file>images/dirclosed-32.png</file>
|
||||
<file>images/dirlink-16.png</file>
|
||||
<file>images/dirlink-32.png</file>
|
||||
<file>images/diropen-16.png</file>
|
||||
<file>images/diropen-32.png</file>
|
||||
<file>images/left-16.png</file>
|
||||
<file>images/left-32.png</file>
|
||||
<file>images/right-16.png</file>
|
||||
<file>images/right-32.png</file>
|
||||
<file>images/up-16.png</file>
|
||||
<file>images/up-32.png</file>
|
||||
<file>images/down-16.png</file>
|
||||
<file>images/down-32.png</file>
|
||||
<file>images/filecontents-16.png</file>
|
||||
<file>images/filecontents-32.png</file>
|
||||
<file>images/fileinfo-16.png</file>
|
||||
<file>images/fileinfo-32.png</file>
|
||||
<file>images/viewdetailed-16.png</file>
|
||||
<file>images/viewdetailed-32.png</file>
|
||||
<file>images/viewlist-16.png</file>
|
||||
<file>images/viewlist-32.png</file>
|
||||
<file>images/fontbitmap-16.png</file>
|
||||
<file>images/fonttruetype-16.png</file>
|
||||
<file>images/standardbutton-apply-16.png</file>
|
||||
<file>images/standardbutton-apply-32.png</file>
|
||||
<file>images/standardbutton-cancel-16.png</file>
|
||||
<file>images/standardbutton-cancel-32.png</file>
|
||||
<file>images/standardbutton-clear-16.png</file>
|
||||
<file>images/standardbutton-clear-32.png</file>
|
||||
<file>images/standardbutton-close-16.png</file>
|
||||
<file>images/standardbutton-close-32.png</file>
|
||||
<file>images/standardbutton-delete-16.png</file>
|
||||
<file>images/standardbutton-delete-32.png</file>
|
||||
<file>images/standardbutton-help-16.png</file>
|
||||
<file>images/standardbutton-help-32.png</file>
|
||||
<file>images/standardbutton-no-16.png</file>
|
||||
<file>images/standardbutton-no-32.png</file>
|
||||
<file>images/standardbutton-ok-16.png</file>
|
||||
<file>images/standardbutton-ok-32.png</file>
|
||||
<file>images/standardbutton-open-16.png</file>
|
||||
<file>images/standardbutton-open-32.png</file>
|
||||
<file>images/standardbutton-save-16.png</file>
|
||||
<file>images/standardbutton-save-32.png</file>
|
||||
<file>images/standardbutton-yes-16.png</file>
|
||||
<file>images/standardbutton-yes-32.png</file>
|
||||
<file>images/standardbutton-closetab-16.png</file>
|
||||
<file>images/standardbutton-closetab-down-16.png</file>
|
||||
<file>images/standardbutton-closetab-hover-16.png</file>
|
||||
<file>images/refresh-24.png</file>
|
||||
<file>images/refresh-32.png</file>
|
||||
<file>images/stop-24.png</file>
|
||||
<file>images/stop-32.png</file>
|
||||
<file>images/media-stop-16.png</file>
|
||||
<file>images/media-stop-32.png</file>
|
||||
<file>images/media-play-16.png</file>
|
||||
<file>images/media-play-32.png</file>
|
||||
<file>images/media-pause-16.png</file>
|
||||
<file>images/media-pause-32.png</file>
|
||||
<file>images/media-seek-forward-16.png</file>
|
||||
<file>images/media-seek-forward-32.png</file>
|
||||
<file>images/media-seek-backward-16.png</file>
|
||||
<file>images/media-seek-backward-32.png</file>
|
||||
<file>images/media-skip-forward-16.png</file>
|
||||
<file>images/media-skip-forward-32.png</file>
|
||||
<file>images/media-skip-backward-16.png</file>
|
||||
<file>images/media-skip-backward-32.png</file>
|
||||
<file>images/media-volume-16.png</file>
|
||||
<file>images/media-volume-muted-16.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -122,7 +122,7 @@ int QWindowsStylePrivate::m_appDevicePixelRatio = 0;
|
||||
QWindowsStylePrivate::QWindowsStylePrivate()
|
||||
: alt_down(false), menuBarTimer(0)
|
||||
{
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
|
||||
&& (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) {
|
||||
QSystemLibrary shellLib(QLatin1String("shell32"));
|
||||
@ -308,25 +308,15 @@ int QWindowsStylePrivate::pixelMetricFromSystemDp(QStyle::PixelMetric pm, const
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
switch (pm) {
|
||||
case QStyle::PM_DockWidgetFrameWidth:
|
||||
# ifndef Q_OS_WINCE
|
||||
return GetSystemMetrics(SM_CXFRAME);
|
||||
# else
|
||||
return GetSystemMetrics(SM_CXDLGFRAME);
|
||||
# endif
|
||||
break;
|
||||
|
||||
case QStyle::PM_TitleBarHeight:
|
||||
if (widget && (widget->windowType() == Qt::Tool)) {
|
||||
// MS always use one less than they say
|
||||
# ifndef Q_OS_WINCE
|
||||
return GetSystemMetrics(SM_CYSMCAPTION) - 1;
|
||||
# else
|
||||
return GetSystemMetrics(SM_CYCAPTION) - 1;
|
||||
# endif
|
||||
}
|
||||
return GetSystemMetrics(SM_CYCAPTION) - 1;
|
||||
|
||||
# ifndef Q_OS_WINCE
|
||||
case QStyle::PM_ScrollBarExtent:
|
||||
{
|
||||
NONCLIENTMETRICS ncm;
|
||||
@ -335,14 +325,9 @@ int QWindowsStylePrivate::pixelMetricFromSystemDp(QStyle::PixelMetric pm, const
|
||||
return qMax(ncm.iScrollHeight, ncm.iScrollWidth);
|
||||
}
|
||||
break;
|
||||
# endif // !Q_OS_WINCE
|
||||
|
||||
case QStyle::PM_MdiSubWindowFrameWidth:
|
||||
# ifndef Q_OS_WINCE
|
||||
return GetSystemMetrics(SM_CYFRAME);
|
||||
# else
|
||||
return GetSystemMetrics(SM_CYDLGFRAME);
|
||||
# endif
|
||||
|
||||
default:
|
||||
break;
|
||||
@ -479,7 +464,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
|
||||
QPixmap QWindowsStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
|
||||
const QWidget *widget) const
|
||||
{
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
QPixmap desktopIcon;
|
||||
switch(standardPixmap) {
|
||||
case SP_DriveCDIcon:
|
||||
@ -518,7 +503,7 @@ QPixmap QWindowsStyle::standardPixmap(StandardPixmap standardPixmap, const QStyl
|
||||
if (!desktopIcon.isNull()) {
|
||||
return desktopIcon;
|
||||
}
|
||||
#endif // Q_OS_WIN && !Q_OS_WINCE && !Q_OS_WINRT
|
||||
#endif // Q_OS_WIN && !Q_OS_WINRT
|
||||
return QCommonStyle::standardPixmap(standardPixmap, opt, widget);
|
||||
}
|
||||
|
||||
@ -595,12 +580,12 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
|
||||
#endif // Q_OS_WIN && !Q_OS_WINRT
|
||||
case SH_Menu_SubMenuSloppyCloseTimeout:
|
||||
case SH_Menu_SubMenuPopupDelay: {
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
DWORD delay;
|
||||
if (SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &delay, 0))
|
||||
ret = delay;
|
||||
else
|
||||
#endif // Q_OS_WIN && !Q_OS_WINCE && !Q_OS_WINRT
|
||||
#endif // Q_OS_WIN && !Q_OS_WINRT
|
||||
ret = 400;
|
||||
break;
|
||||
}
|
||||
|
@ -33,11 +33,7 @@ SOURCES += \
|
||||
styles/qstylesheetstyle_default.cpp \
|
||||
styles/qpixmapstyle.cpp
|
||||
|
||||
wince* {
|
||||
RESOURCES += styles/qstyle_wince.qrc
|
||||
} else {
|
||||
RESOURCES += styles/qstyle.qrc
|
||||
}
|
||||
RESOURCES += styles/qstyle.qrc
|
||||
|
||||
contains( styles, all ) {
|
||||
styles = fusion mac windows windowsxp windowsvista
|
||||
|
@ -480,7 +480,7 @@ QMatchData QCompletionEngine::filterHistory()
|
||||
for (int i = 0; i < source->rowCount(); i++) {
|
||||
QString str = source->index(i, c->column).data().toString();
|
||||
if (str.startsWith(c->prefix, c->cs)
|
||||
#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
|
||||
#if !defined(Q_OS_WIN)
|
||||
&& ((!isFsModel && !isDirModel) || QDir::toNativeSeparators(str) != QDir::separator())
|
||||
#endif
|
||||
)
|
||||
@ -1051,7 +1051,7 @@ void QCompleter::setModel(QAbstractItemModel *model)
|
||||
delete oldModel;
|
||||
#ifndef QT_NO_DIRMODEL
|
||||
if (qobject_cast<QDirModel *>(model)) {
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
setCaseSensitivity(Qt::CaseInsensitive);
|
||||
#else
|
||||
setCaseSensitivity(Qt::CaseSensitive);
|
||||
@ -1061,7 +1061,7 @@ void QCompleter::setModel(QAbstractItemModel *model)
|
||||
#ifndef QT_NO_FILESYSTEMMODEL
|
||||
QFileSystemModel *fsModel = qobject_cast<QFileSystemModel *>(model);
|
||||
if (fsModel) {
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
setCaseSensitivity(Qt::CaseInsensitive);
|
||||
#else
|
||||
setCaseSensitivity(Qt::CaseSensitive);
|
||||
@ -1786,7 +1786,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const
|
||||
idx = parent.sibling(parent.row(), index.column());
|
||||
} while (idx.isValid());
|
||||
|
||||
#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
|
||||
#if !defined(Q_OS_WIN)
|
||||
if (list.count() == 1) // only the separator or some other text
|
||||
return list[0];
|
||||
list[0].clear() ; // the join below will provide the separator
|
||||
@ -1826,7 +1826,7 @@ QStringList QCompleter::splitPath(const QString& path) const
|
||||
return QStringList(completionPrefix());
|
||||
|
||||
QString pathCopy = QDir::toNativeSeparators(path);
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\"))
|
||||
return QStringList(pathCopy);
|
||||
const bool startsWithDoubleSlash = pathCopy.startsWith(QLatin1String("\\\\"));
|
||||
@ -1837,7 +1837,7 @@ QStringList QCompleter::splitPath(const QString& path) const
|
||||
const QChar sep = QDir::separator();
|
||||
QStringList parts = pathCopy.split(sep);
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
if (startsWithDoubleSlash)
|
||||
parts[0].prepend(QLatin1String("\\\\"));
|
||||
#else
|
||||
|
@ -446,19 +446,11 @@ QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title
|
||||
titleLabel->setText(title);
|
||||
QFont f = titleLabel->font();
|
||||
f.setBold(true);
|
||||
#ifdef Q_OS_WINCE
|
||||
f.setPointSize(f.pointSize() - 2);
|
||||
#endif
|
||||
titleLabel->setFont(f);
|
||||
titleLabel->setTextFormat(Qt::PlainText); // to maintain compat with windows
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
const int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize);
|
||||
const int closeButtonSize = style()->pixelMetric(QStyle::PM_SmallIconSize) - 2;
|
||||
#else
|
||||
const int iconSize = 18;
|
||||
const int closeButtonSize = 15;
|
||||
#endif
|
||||
|
||||
QPushButton *closeButton = new QPushButton;
|
||||
closeButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarCloseButton));
|
||||
@ -468,21 +460,13 @@ QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title
|
||||
QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
||||
|
||||
QLabel *msgLabel = new QLabel;
|
||||
#ifdef Q_OS_WINCE
|
||||
f.setBold(false);
|
||||
msgLabel->setFont(f);
|
||||
#endif
|
||||
msgLabel->installEventFilter(this);
|
||||
msgLabel->setText(message);
|
||||
msgLabel->setTextFormat(Qt::PlainText);
|
||||
msgLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
|
||||
|
||||
// smart size for the message label
|
||||
#ifdef Q_OS_WINCE
|
||||
int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 2;
|
||||
#else
|
||||
int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 3;
|
||||
#endif
|
||||
if (msgLabel->sizeHint().width() > limit) {
|
||||
msgLabel->setWordWrap(true);
|
||||
if (msgLabel->sizeHint().width() > limit) {
|
||||
@ -493,15 +477,9 @@ QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title
|
||||
control->document()->setDefaultTextOption(opt);
|
||||
}
|
||||
}
|
||||
#ifdef Q_OS_WINCE
|
||||
// Make sure that the text isn't wrapped "somewhere" in the balloon widget
|
||||
// in the case that we have a long title label.
|
||||
setMaximumWidth(limit);
|
||||
#else
|
||||
// Here we allow the text being much smaller than the balloon widget
|
||||
// to emulate the weird standard windows behavior.
|
||||
msgLabel->setFixedSize(limit, msgLabel->heightForWidth(limit));
|
||||
#endif
|
||||
}
|
||||
|
||||
QIcon si;
|
||||
|
@ -1,301 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtWidgets module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qsystemtrayicon_p.h"
|
||||
#ifndef QT_NO_SYSTEMTRAYICON
|
||||
#define _WIN32_IE 0x0600 //required for NOTIFYICONDATA_V2_SIZE
|
||||
|
||||
#include <qt_windows.h>
|
||||
#include <shlwapi.h>
|
||||
#include <QApplication>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static const UINT q_uNOTIFYICONID = 13; // IDs from 0 to 12 are reserved on WinCE.
|
||||
#define MYWM_NOTIFYICON (WM_APP+101)
|
||||
|
||||
struct Q_NOTIFYICONIDENTIFIER {
|
||||
DWORD cbSize;
|
||||
HWND hWnd;
|
||||
UINT uID;
|
||||
GUID guidItem;
|
||||
};
|
||||
|
||||
class QSystemTrayIconSys : QWidget
|
||||
{
|
||||
public:
|
||||
QSystemTrayIconSys(QSystemTrayIcon *object);
|
||||
~QSystemTrayIconSys();
|
||||
bool winEvent( MSG *m, long *result );
|
||||
bool trayMessage(DWORD msg);
|
||||
void setIconContents(NOTIFYICONDATA &data);
|
||||
void createIcon();
|
||||
QRect findTrayGeometry();
|
||||
HICON hIcon;
|
||||
QPoint globalPos;
|
||||
QSystemTrayIcon *q;
|
||||
private:
|
||||
uint notifyIconSize;
|
||||
int maxTipLength;
|
||||
bool ignoreNextMouseRelease;
|
||||
};
|
||||
|
||||
QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *object)
|
||||
: hIcon(0), q(object), ignoreNextMouseRelease(false)
|
||||
|
||||
{
|
||||
notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, szTip[64]); // NOTIFYICONDATAW_V1_SIZE;
|
||||
maxTipLength = 64;
|
||||
}
|
||||
|
||||
QSystemTrayIconSys::~QSystemTrayIconSys()
|
||||
{
|
||||
if (hIcon)
|
||||
DestroyIcon(hIcon);
|
||||
}
|
||||
|
||||
QRect QSystemTrayIconSys::findTrayGeometry()
|
||||
{
|
||||
// Use lower right corner as fallback
|
||||
QPoint brCorner = qApp->desktop()->screenGeometry().bottomRight();
|
||||
QRect ret(brCorner.x() - 10, brCorner.y() - 10, 10, 10);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void QSystemTrayIconSys::setIconContents(NOTIFYICONDATA &tnd)
|
||||
{
|
||||
tnd.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
|
||||
tnd.uCallbackMessage = MYWM_NOTIFYICON;
|
||||
tnd.hIcon = hIcon;
|
||||
QString tip = q->toolTip();
|
||||
|
||||
if (!tip.isNull()) {
|
||||
tip = tip.left(maxTipLength - 1) + QChar();
|
||||
memcpy(tnd.szTip, tip.utf16(), qMin(tip.length() + 1, maxTipLength) * sizeof(wchar_t));
|
||||
}
|
||||
}
|
||||
|
||||
bool QSystemTrayIconSys::trayMessage(DWORD msg)
|
||||
{
|
||||
NOTIFYICONDATA tnd;
|
||||
memset(&tnd, 0, notifyIconSize);
|
||||
tnd.uID = q_uNOTIFYICONID;
|
||||
tnd.cbSize = notifyIconSize;
|
||||
tnd.hWnd = winId();
|
||||
|
||||
Q_ASSERT(testAttribute(Qt::WA_WState_Created));
|
||||
|
||||
if (msg != NIM_DELETE) {
|
||||
setIconContents(tnd);
|
||||
}
|
||||
|
||||
return Shell_NotifyIcon(msg, &tnd);
|
||||
}
|
||||
|
||||
void QSystemTrayIconSys::createIcon()
|
||||
{
|
||||
hIcon = 0;
|
||||
QIcon icon = q->icon();
|
||||
if (icon.isNull())
|
||||
return;
|
||||
|
||||
//const QSize preferredSize(GetSystemMetrics(SM_CXSMICON) * 2, GetSystemMetrics(SM_CYSMICON) * 2);
|
||||
const QSize preferredSize(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
|
||||
QPixmap pm = icon.pixmap(preferredSize);
|
||||
if (pm.isNull())
|
||||
return;
|
||||
|
||||
hIcon = pm.toWinHICON();
|
||||
}
|
||||
|
||||
bool QSystemTrayIconSys::winEvent( MSG *m, long *result )
|
||||
{
|
||||
switch(m->message) {
|
||||
case WM_CREATE:
|
||||
SetWindowLong(winId(), GWL_USERDATA, (LONG)((CREATESTRUCTW*)m->lParam)->lpCreateParams);
|
||||
break;
|
||||
|
||||
case MYWM_NOTIFYICON:
|
||||
{
|
||||
QPoint gpos = QCursor::pos();
|
||||
|
||||
switch (m->lParam) {
|
||||
case WM_LBUTTONUP:
|
||||
if (ignoreNextMouseRelease)
|
||||
ignoreNextMouseRelease = false;
|
||||
else
|
||||
emit q->activated(QSystemTrayIcon::Trigger);
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDBLCLK:
|
||||
ignoreNextMouseRelease = true; // Since DBLCLICK Generates a second mouse
|
||||
// release we must ignore it
|
||||
emit q->activated(QSystemTrayIcon::DoubleClick);
|
||||
break;
|
||||
|
||||
case WM_RBUTTONUP:
|
||||
if (q->contextMenu()) {
|
||||
q->contextMenu()->popup(gpos);
|
||||
|
||||
// We must ensure that the popup menu doesn't show up behind the task bar.
|
||||
QRect desktopRect = qApp->desktop()->availableGeometry();
|
||||
int maxY = desktopRect.y() + desktopRect.height() - q->contextMenu()->height();
|
||||
if (gpos.y() > maxY) {
|
||||
gpos.ry() = maxY;
|
||||
q->contextMenu()->move(gpos);
|
||||
}
|
||||
}
|
||||
emit q->activated(QSystemTrayIcon::Context);
|
||||
break;
|
||||
|
||||
case WM_MBUTTONUP:
|
||||
emit q->activated(QSystemTrayIcon::MiddleClick);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return QWidget::winEvent(m, result);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
QSystemTrayIconPrivate::QSystemTrayIconPrivate()
|
||||
: sys(0),
|
||||
visible(false)
|
||||
{
|
||||
}
|
||||
|
||||
QSystemTrayIconPrivate::~QSystemTrayIconPrivate()
|
||||
{
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::install_sys()
|
||||
{
|
||||
Q_Q(QSystemTrayIcon);
|
||||
if (!sys) {
|
||||
sys = new QSystemTrayIconSys(q);
|
||||
sys->createIcon();
|
||||
sys->trayMessage(NIM_ADD);
|
||||
}
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::showMessage_sys(const QString &title, const QString &message, QSystemTrayIcon::MessageIcon type, int timeOut)
|
||||
{
|
||||
if (!sys)
|
||||
return;
|
||||
|
||||
uint uSecs = 0;
|
||||
if ( timeOut < 0)
|
||||
uSecs = 10000; //10 sec default
|
||||
else uSecs = (int)timeOut;
|
||||
|
||||
//message is limited to 255 chars + NULL
|
||||
QString messageString;
|
||||
if (message.isEmpty() && !title.isEmpty())
|
||||
messageString = QLatin1Char(' '); //ensures that the message shows when only title is set
|
||||
else
|
||||
messageString = message.left(255) + QChar();
|
||||
|
||||
//title is limited to 63 chars + NULL
|
||||
QString titleString = title.left(63) + QChar();
|
||||
|
||||
//show QBalloonTip
|
||||
QRect trayRect = sys->findTrayGeometry();
|
||||
QBalloonTip::showBalloon(type, title, message, sys->q, QPoint(trayRect.left(),
|
||||
trayRect.center().y()), uSecs, false);
|
||||
}
|
||||
|
||||
QRect QSystemTrayIconPrivate::geometry_sys() const
|
||||
{
|
||||
return QRect();
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::remove_sys()
|
||||
{
|
||||
if (!sys)
|
||||
return;
|
||||
|
||||
sys->trayMessage(NIM_DELETE);
|
||||
delete sys;
|
||||
sys = 0;
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::updateIcon_sys()
|
||||
{
|
||||
if (!sys)
|
||||
return;
|
||||
|
||||
HICON hIconToDestroy = sys->hIcon;
|
||||
|
||||
sys->createIcon();
|
||||
sys->trayMessage(NIM_MODIFY);
|
||||
|
||||
if (hIconToDestroy)
|
||||
DestroyIcon(hIconToDestroy);
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::updateMenu_sys()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::updateToolTip_sys()
|
||||
{
|
||||
// Calling sys->trayMessage(NIM_MODIFY) on an existing icon is broken on Windows CE.
|
||||
// So we need to call updateIcon_sys() which creates a new icon handle.
|
||||
updateIcon_sys();
|
||||
}
|
||||
|
||||
bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QSystemTrayIconPrivate::supportsMessages_sys()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif
|
@ -27,7 +27,7 @@ SOURCES += \
|
||||
util/qundostack.cpp \
|
||||
util/qundoview.cpp
|
||||
|
||||
win32:!wince:!winrt {
|
||||
win32:!winrt {
|
||||
SOURCES += util/qsystemtrayicon_win.cpp
|
||||
} else:contains(QT_CONFIG, xcb) {
|
||||
SOURCES += util/qsystemtrayicon_x11.cpp
|
||||
|
@ -1,5 +1,4 @@
|
||||
TARGET = QtWidgets
|
||||
wince: ORIG_TARGET = $$TARGET
|
||||
QT = core-private gui-private
|
||||
MODULE_CONFIG = uic
|
||||
|
||||
|
@ -230,7 +230,7 @@ bool QDockWidgetLayout::nativeWindowDeco() const
|
||||
*/
|
||||
bool QDockWidgetLayout::wmSupportsNativeWindowDeco()
|
||||
{
|
||||
#if defined(Q_OS_WINCE) || defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_ANDROID)
|
||||
return false;
|
||||
#else
|
||||
static const bool xcb = !QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive);
|
||||
|
@ -110,7 +110,7 @@ QAlphaWidget::QAlphaWidget(QWidget* w, Qt::WindowFlags f)
|
||||
|
||||
QAlphaWidget::~QAlphaWidget()
|
||||
{
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
// Restore user-defined opacity value
|
||||
if (widget)
|
||||
widget->setWindowOpacity(1);
|
||||
@ -144,7 +144,7 @@ void QAlphaWidget::run(int time)
|
||||
checkTime.start();
|
||||
|
||||
showWidget = true;
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
qApp->installEventFilter(this);
|
||||
widget->setWindowOpacity(0.0);
|
||||
widget->show();
|
||||
@ -251,7 +251,7 @@ void QAlphaWidget::render()
|
||||
else
|
||||
alpha = 1;
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
if (alpha >= 1 || !showWidget) {
|
||||
anim.stop();
|
||||
qApp->removeEventFilter(this);
|
||||
@ -268,10 +268,6 @@ void QAlphaWidget::render()
|
||||
|
||||
if (widget) {
|
||||
if (!showWidget) {
|
||||
#ifdef Q_OS_WIN
|
||||
setEnabled(true);
|
||||
setFocus();
|
||||
#endif // Q_OS_WIN
|
||||
widget->hide();
|
||||
} else {
|
||||
//Since we are faking the visibility of the widget
|
||||
@ -288,7 +284,7 @@ void QAlphaWidget::render()
|
||||
pm = QPixmap::fromImage(mixedImage);
|
||||
repaint();
|
||||
}
|
||||
#endif // defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#endif // defined(Q_OS_WIN)
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1769,7 +1769,7 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const
|
||||
if (isChildOfTabbedQMdiArea(q))
|
||||
return false;
|
||||
|
||||
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) || defined(Q_OS_WINCE_WM)
|
||||
#if defined(Q_OS_DARWIN) && !defined(QT_NO_STYLE_MAC)
|
||||
Q_UNUSED(isChildOfQMdiSubWindow);
|
||||
return true;
|
||||
#else
|
||||
|
@ -3353,17 +3353,6 @@ void QMenu::actionEvent(QActionEvent *e)
|
||||
d->platformMenu->syncSeparatorsCollapsible(d->collapsibleSeparators);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WINCE) && !defined(QT_NO_MENUBAR)
|
||||
if (!d->wce_menu)
|
||||
d->wce_menu = new QMenuPrivate::QWceMenuPrivate;
|
||||
if (e->type() == QEvent::ActionAdded)
|
||||
d->wce_menu->addAction(e->action(), d->wce_menu->findAction(e->before()));
|
||||
else if (e->type() == QEvent::ActionRemoved)
|
||||
d->wce_menu->removeAction(e->action());
|
||||
else if (e->type() == QEvent::ActionChanged)
|
||||
d->wce_menu->syncAction(e->action());
|
||||
#endif
|
||||
|
||||
if (isVisible()) {
|
||||
d->updateActionRects();
|
||||
resize(sizeHint());
|
||||
|
@ -45,9 +45,6 @@
|
||||
#include <QtGui/qicon.h>
|
||||
#include <QtWidgets/qaction.h>
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
#include <windef.h> // for HMENU
|
||||
#endif
|
||||
#ifdef Q_OS_OSX
|
||||
Q_FORWARD_DECLARE_OBJC_CLASS(NSMenu);
|
||||
#endif
|
||||
@ -214,9 +211,6 @@ public:
|
||||
QPlatformMenu *platformMenu();
|
||||
void setPlatformMenu(QPlatformMenu *platformMenu);
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
HMENU wceMenu();
|
||||
#endif
|
||||
#ifdef Q_OS_OSX
|
||||
NSMenu* toNSMenu();
|
||||
void setAsDockMenu();
|
||||
@ -255,10 +249,6 @@ protected:
|
||||
bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
|
||||
void initStyleOption(QStyleOptionMenuItem *option, const QAction *action) const;
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
QAction* wceCommands(uint command);
|
||||
#endif
|
||||
|
||||
private Q_SLOTS:
|
||||
void internalDelayedPopup();
|
||||
|
||||
|
@ -68,15 +68,6 @@ QT_BEGIN_NAMESPACE
|
||||
class QTornOffMenu;
|
||||
class QEventLoop;
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
struct QWceMenuAction {
|
||||
uint command;
|
||||
QPointer<QAction> action;
|
||||
HMENU menuHandle;
|
||||
QWceMenuAction() : menuHandle(0), command(0) {}
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
class QSetValueOnDestroy
|
||||
{
|
||||
@ -301,19 +292,13 @@ public:
|
||||
#endif
|
||||
scroll(0), eventLoop(0), tearoff(0), tornoff(0), tearoffHighlighted(0),
|
||||
hasCheckableItems(0), doChildEffects(false), platformMenu(0)
|
||||
|
||||
#if defined(Q_OS_WINCE) && !defined(QT_NO_MENUBAR)
|
||||
,wce_menu(0)
|
||||
#endif
|
||||
{ }
|
||||
|
||||
~QMenuPrivate()
|
||||
{
|
||||
delete scroll;
|
||||
if (!platformMenu.isNull() && !platformMenu->parent())
|
||||
delete platformMenu.data();
|
||||
#if defined(Q_OS_WINCE) && !defined(QT_NO_MENUBAR)
|
||||
delete wce_menu;
|
||||
#endif
|
||||
}
|
||||
void init();
|
||||
void setPlatformMenu(QPlatformMenu *menu);
|
||||
@ -473,31 +458,6 @@ public:
|
||||
|
||||
QPointer<QAction> actionAboutToTrigger;
|
||||
|
||||
#if defined(Q_OS_WINCE) && !defined(QT_NO_MENUBAR)
|
||||
struct QWceMenuPrivate {
|
||||
QList<QWceMenuAction*> actionItems;
|
||||
HMENU menuHandle;
|
||||
QWceMenuPrivate();
|
||||
~QWceMenuPrivate();
|
||||
void addAction(QAction *, QWceMenuAction* =0);
|
||||
void addAction(QWceMenuAction *, QWceMenuAction* =0);
|
||||
void syncAction(QWceMenuAction *);
|
||||
inline void syncAction(QAction *a) { syncAction(findAction(a)); }
|
||||
void removeAction(QWceMenuAction *);
|
||||
void rebuild();
|
||||
inline void removeAction(QAction *a) { removeAction(findAction(a)); }
|
||||
inline QWceMenuAction *findAction(QAction *a) {
|
||||
for(int i = 0; i < actionItems.size(); i++) {
|
||||
QWceMenuAction *act = actionItems[i];
|
||||
if(a == act->action)
|
||||
return act;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} *wce_menu;
|
||||
HMENU wceMenu();
|
||||
QAction* wceCommands(uint command);
|
||||
#endif
|
||||
QPointer<QWidget> noReplayFor;
|
||||
static QPointer<QMenu> previousMouseMenu;
|
||||
};
|
||||
|
@ -1,666 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtWidgets module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
//Native menubars are only supported for Windows Mobile not the standard SDK/generic WinCE
|
||||
#ifdef Q_OS_WINCE
|
||||
#include "qmenu.h"
|
||||
#include "qt_windows.h"
|
||||
#include "qapplication.h"
|
||||
#include "qmainwindow.h"
|
||||
#include "qtoolbar.h"
|
||||
#include "qevent.h"
|
||||
#include "qstyle.h"
|
||||
#include "qdebug.h"
|
||||
#include "qwidgetaction.h"
|
||||
#include <private/qapplication_p.h>
|
||||
#include <private/qmenu_p.h>
|
||||
#include <private/qmenubar_p.h>
|
||||
|
||||
#include "qmenu_wince_resource_p.h"
|
||||
|
||||
#include <QtCore/qlibrary.h>
|
||||
#include <commctrl.h>
|
||||
#if Q_OS_WINCE_WM
|
||||
# include <windowsm.h>
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_MENUBAR
|
||||
|
||||
#ifndef SHCMBF_EMPTYBAR
|
||||
#define SHCMBF_EMPTYBAR 0x0001
|
||||
#endif
|
||||
|
||||
#ifndef SHCMBM_GETSUBMENU
|
||||
#define SHCMBM_GETSUBMENU (WM_USER + 401)
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
# define SHMBOF_NODEFAULT 0x00000001
|
||||
# define SHMBOF_NOTIFY 0x00000002
|
||||
# define SHCMBM_OVERRIDEKEY (WM_USER + 0x193)
|
||||
#endif
|
||||
|
||||
extern bool qt_wince_is_smartphone();//defined in qguifunctions_wce.cpp
|
||||
extern bool qt_wince_is_pocket_pc(); //defined in qguifunctions_wce.cpp
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static uint qt_wce_menu_static_cmd_id = 200;
|
||||
static QList<QMenuBar*> nativeMenuBars;
|
||||
|
||||
struct qt_SHMENUBARINFO
|
||||
{
|
||||
DWORD cbSize;
|
||||
HWND hwndParent;
|
||||
DWORD dwFlags;
|
||||
UINT nToolBarId;
|
||||
HINSTANCE hInstRes;
|
||||
int nBmpId;
|
||||
int cBmpImages;
|
||||
HWND hwndMB;
|
||||
COLORREF clrBk;
|
||||
};
|
||||
|
||||
typedef BOOL (WINAPI *AygCreateMenuBar)(qt_SHMENUBARINFO*);
|
||||
typedef HRESULT (WINAPI *AygEnableSoftKey)(HWND,UINT,BOOL,BOOL);
|
||||
|
||||
static bool aygResolved = false;
|
||||
static AygCreateMenuBar ptrCreateMenuBar = 0;
|
||||
static AygEnableSoftKey ptrEnableSoftKey = 0;
|
||||
|
||||
static void resolveAygLibs()
|
||||
{
|
||||
if (!aygResolved) {
|
||||
aygResolved = true;
|
||||
QLibrary aygLib(QLatin1String("aygshell"));
|
||||
ptrCreateMenuBar = (AygCreateMenuBar) aygLib.resolve("SHCreateMenuBar");
|
||||
ptrEnableSoftKey = (AygEnableSoftKey) aygLib.resolve("SHEnableSoftkey");
|
||||
}
|
||||
}
|
||||
|
||||
static void qt_wce_enable_soft_key(HWND handle, uint command)
|
||||
{
|
||||
resolveAygLibs();
|
||||
if (ptrEnableSoftKey)
|
||||
ptrEnableSoftKey(handle, command, false, true);
|
||||
}
|
||||
|
||||
static void qt_wce_disable_soft_key(HWND handle, uint command)
|
||||
{
|
||||
resolveAygLibs();
|
||||
if (ptrEnableSoftKey)
|
||||
ptrEnableSoftKey(handle, command, false, false);
|
||||
}
|
||||
|
||||
static void qt_wce_delete_action_list(QList<QWceMenuAction*> *list)
|
||||
{
|
||||
for(QList<QWceMenuAction*>::Iterator it = list->begin(); it != list->end(); ++it) {
|
||||
QWceMenuAction *action = (*it);
|
||||
delete action;
|
||||
action = 0;
|
||||
}
|
||||
list->clear();
|
||||
}
|
||||
|
||||
//search for first QuitRole in QMenuBar
|
||||
static QAction* qt_wce_get_quit_action(QList<QAction *> actionItems)
|
||||
{
|
||||
QAction *returnAction = 0;
|
||||
for (int i = 0; i < actionItems.size(); ++i) {
|
||||
QAction *action = actionItems.at(i);
|
||||
if (action->menuRole() == QAction::QuitRole)
|
||||
returnAction = action;
|
||||
else
|
||||
if (action->menu())
|
||||
returnAction = qt_wce_get_quit_action(action->menu()->actions());
|
||||
if (returnAction)
|
||||
return returnAction; //return first action found
|
||||
}
|
||||
return 0; //nothing found;
|
||||
}
|
||||
|
||||
static QAction* qt_wce_get_quit_action(QList<QWceMenuAction*> actionItems)
|
||||
{
|
||||
for (int i = 0; i < actionItems.size(); ++i) {
|
||||
if (actionItems.at(i)->action->menuRole() == QAction::QuitRole)
|
||||
return actionItems.at(i)->action;
|
||||
else if (actionItems.at(i)->action->menu()) {
|
||||
QAction *returnAction = qt_wce_get_quit_action(actionItems.at(i)->action->menu()->actions());
|
||||
if (returnAction)
|
||||
return returnAction;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HMODULE qt_wce_get_module_handle()
|
||||
{
|
||||
HMODULE module = 0; //handle to resources
|
||||
if (!(module = GetModuleHandle(L"QtGui4"))) //release dynamic
|
||||
if (!(module = GetModuleHandle(L"QtGuid4"))) //debug dynamic
|
||||
module = (HINSTANCE)qWinAppInst(); //static
|
||||
Q_ASSERT_X(module, "qt_wce_get_module_handle()", "cannot get handle to module?");
|
||||
return module;
|
||||
}
|
||||
|
||||
static void qt_wce_change_command(HWND menuHandle, int item, int command)
|
||||
{
|
||||
TBBUTTONINFOA tbbi;
|
||||
memset(&tbbi,0,sizeof(tbbi));
|
||||
tbbi.cbSize = sizeof(tbbi);
|
||||
tbbi.dwMask = TBIF_COMMAND;
|
||||
tbbi.idCommand = command;
|
||||
SendMessage(menuHandle, TB_SETBUTTONINFO, item, (LPARAM)&tbbi);
|
||||
}
|
||||
|
||||
static void qt_wce_rename_menu_item(HWND menuHandle, int item, const QString &newText)
|
||||
{
|
||||
TBBUTTONINFOA tbbi;
|
||||
memset(&tbbi,0,sizeof(tbbi));
|
||||
tbbi.cbSize = sizeof(tbbi);
|
||||
tbbi.dwMask = TBIF_TEXT;
|
||||
QString text = newText;
|
||||
text.remove(QChar::fromLatin1('&'));
|
||||
tbbi.pszText = (LPSTR) text.utf16();
|
||||
SendMessage(menuHandle, TB_SETBUTTONINFO, item, (LPARAM)&tbbi);
|
||||
}
|
||||
|
||||
static HWND qt_wce_create_menubar(HWND parentHandle, HINSTANCE resourceHandle, int toolbarID, int flags = 0)
|
||||
{
|
||||
resolveAygLibs();
|
||||
|
||||
if (ptrCreateMenuBar) {
|
||||
qt_SHMENUBARINFO mbi;
|
||||
memset(&mbi, 0, sizeof(qt_SHMENUBARINFO));
|
||||
mbi.cbSize = sizeof(qt_SHMENUBARINFO);
|
||||
mbi.hwndParent = parentHandle;
|
||||
mbi.hInstRes = resourceHandle;
|
||||
mbi.dwFlags = flags;
|
||||
mbi.nToolBarId = toolbarID;
|
||||
|
||||
if (ptrCreateMenuBar(&mbi)) {
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
// Tell the menu bar that we want to override hot key behaviour.
|
||||
LPARAM lparam = MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY,
|
||||
SHMBOF_NODEFAULT | SHMBOF_NOTIFY);
|
||||
SendMessage(mbi.hwndMB, SHCMBM_OVERRIDEKEY, VK_TBACK, lparam);
|
||||
#endif
|
||||
return mbi.hwndMB;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void qt_wce_insert_action(HMENU menu, QWceMenuAction *action)
|
||||
{
|
||||
Q_ASSERT_X(menu, "AppendMenu", "menu is 0");
|
||||
if (action->action->isVisible()) {
|
||||
int flags;
|
||||
action->action->isEnabled() ? flags = MF_ENABLED : flags = MF_GRAYED;
|
||||
|
||||
QString text = action->action->iconText();
|
||||
text.remove(QChar::fromLatin1('&'));
|
||||
if (action->action->isSeparator()) {
|
||||
AppendMenu (menu, MF_SEPARATOR , 0, 0);
|
||||
}
|
||||
else if (action->action->menu()) {
|
||||
text.remove(QChar::fromLatin1('&'));
|
||||
AppendMenu (menu, MF_STRING | flags | MF_POPUP,
|
||||
(UINT) action->action->menu()->wceMenu(), reinterpret_cast<const wchar_t *> (text.utf16()));
|
||||
}
|
||||
else {
|
||||
AppendMenu (menu, MF_STRING | flags, action->command, reinterpret_cast<const wchar_t *> (text.utf16()));
|
||||
}
|
||||
if (action->action->isCheckable())
|
||||
if (action->action->isChecked())
|
||||
CheckMenuItem(menu, action->command, MF_BYCOMMAND | MF_CHECKED);
|
||||
else
|
||||
CheckMenuItem(menu, action->command, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
}
|
||||
}
|
||||
|
||||
// Removes all items from the menu without destroying the handles.
|
||||
static void qt_wce_clear_menu(HMENU hMenu)
|
||||
{
|
||||
while (RemoveMenu(hMenu, 0, MF_BYPOSITION));
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
This function refreshes the native Windows CE menu.
|
||||
*/
|
||||
|
||||
void QMenuBar::wceRefresh()
|
||||
{
|
||||
for (int i = 0; i < nativeMenuBars.size(); ++i)
|
||||
nativeMenuBars.at(i)->d_func()->wceRefresh();
|
||||
}
|
||||
|
||||
void QMenuBarPrivate::wceRefresh()
|
||||
{
|
||||
DrawMenuBar(wce_menubar->menubarHandle);
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
This function sends native Windows CE commands to Qt menus.
|
||||
*/
|
||||
|
||||
QAction* QMenu::wceCommands(uint command)
|
||||
{
|
||||
Q_D(QMenu);
|
||||
return d->wceCommands(command);
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
This function sends native Windows CE commands to Qt menu bars
|
||||
and all their child menus.
|
||||
*/
|
||||
|
||||
void QMenuBar::wceCommands(uint command)
|
||||
{
|
||||
const HWND hwndActiveWindow = GetActiveWindow();
|
||||
for (int i = 0; i < nativeMenuBars.size(); ++i) {
|
||||
QMenuBarPrivate* nativeMenuBar = nativeMenuBars.at(i)->d_func();
|
||||
if (hwndActiveWindow == nativeMenuBar->wce_menubar->parentWindowHandle)
|
||||
nativeMenuBar->wceCommands(command);
|
||||
}
|
||||
}
|
||||
|
||||
bool QMenuBarPrivate::wceEmitSignals(QList<QWceMenuAction*> actions, uint command)
|
||||
{
|
||||
QAction *foundAction = 0;
|
||||
for (int i = 0; i < actions.size(); ++i) {
|
||||
QWceMenuAction *action = actions.at(i);
|
||||
if (action->action->menu()) {
|
||||
foundAction = action->action->menu()->wceCommands(command);
|
||||
if (foundAction)
|
||||
break;
|
||||
}
|
||||
else if (action->command == command) {
|
||||
action->action->activate(QAction::Trigger);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (foundAction) {
|
||||
emit q_func()->triggered(foundAction);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void QMenuBarPrivate::wceCommands(uint command)
|
||||
{
|
||||
if (wceClassicMenu) {
|
||||
for (int i = 0; i < wce_menubar->actionItemsClassic.size(); ++i)
|
||||
wceEmitSignals(wce_menubar->actionItemsClassic.at(i), command);
|
||||
} else {
|
||||
if (wceEmitSignals(wce_menubar->actionItems, command)) {
|
||||
return;
|
||||
}
|
||||
else if (wce_menubar->leftButtonIsMenu) {//check if command is on the left quick button
|
||||
wceEmitSignals(wce_menubar->actionItemsLeftButton, command);
|
||||
}
|
||||
else if ((wce_menubar->leftButtonAction) && (command == wce_menubar->leftButtonCommand)) {
|
||||
emit q_func()->triggered(wce_menubar->leftButtonAction);
|
||||
wce_menubar->leftButtonAction->activate(QAction::Trigger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QAction *QMenuPrivate::wceCommands(uint command)
|
||||
{
|
||||
QAction *foundAction = 0;
|
||||
for (int i = 0; i < wce_menu->actionItems.size(); ++i) {
|
||||
if (foundAction)
|
||||
break;
|
||||
QWceMenuAction *action = wce_menu->actionItems.at(i);
|
||||
if (action->action->menu()) {
|
||||
foundAction = action->action->menu()->d_func()->wceCommands(command);
|
||||
}
|
||||
else if (action->command == command) {
|
||||
activateAction(action->action, QAction::Trigger);
|
||||
return action->action;
|
||||
}
|
||||
}
|
||||
if (foundAction)
|
||||
emit q_func()->triggered(foundAction);
|
||||
return foundAction;
|
||||
}
|
||||
|
||||
void QMenuBarPrivate::wceCreateMenuBar(QWidget *parent)
|
||||
{
|
||||
Q_Q(QMenuBar);
|
||||
wce_menubar = new QWceMenuBarPrivate(this);
|
||||
|
||||
wce_menubar->parentWindowHandle = parent ? QApplicationPrivate::getHWNDForWidget(parent) :
|
||||
QApplicationPrivate::getHWNDForWidget(q);
|
||||
wce_menubar->leftButtonAction = defaultAction;
|
||||
|
||||
wce_menubar->menubarHandle = qt_wce_create_menubar(wce_menubar->parentWindowHandle, (HINSTANCE)qWinAppInst(), 0, SHCMBF_EMPTYBAR);
|
||||
Q_ASSERT_X(wce_menubar->menubarHandle, "wceCreateMenuBar", "cannot create empty menu bar");
|
||||
DrawMenuBar(wce_menubar->menubarHandle);
|
||||
nativeMenuBars.append(q);
|
||||
wceClassicMenu = (!qt_wince_is_smartphone() && !qt_wince_is_pocket_pc());
|
||||
}
|
||||
|
||||
void QMenuBarPrivate::wceDestroyMenuBar()
|
||||
{
|
||||
Q_Q(QMenuBar);
|
||||
int index = nativeMenuBars.indexOf(q);
|
||||
nativeMenuBars.removeAt(index);
|
||||
if (wce_menubar) {
|
||||
delete wce_menubar;
|
||||
wce_menubar = 0;
|
||||
}
|
||||
}
|
||||
|
||||
QMenuBarPrivate::QWceMenuBarPrivate::QWceMenuBarPrivate(QMenuBarPrivate *menubar)
|
||||
: menubarHandle(0), menuHandle(0), leftButtonMenuHandle(0),
|
||||
leftButtonAction(0), leftButtonIsMenu(false), d(menubar)
|
||||
{
|
||||
}
|
||||
|
||||
QMenuBarPrivate::QWceMenuBarPrivate::~QWceMenuBarPrivate()
|
||||
{
|
||||
if (menubarHandle)
|
||||
DestroyWindow(menubarHandle);
|
||||
qt_wce_delete_action_list(&actionItems);
|
||||
qt_wce_delete_action_list(&actionItemsLeftButton);
|
||||
|
||||
for (int i=0; i<actionItemsClassic.size(); ++i)
|
||||
if (!actionItemsClassic.value(i).empty())
|
||||
qt_wce_delete_action_list(&actionItemsClassic[i]);
|
||||
actionItemsClassic.clear();
|
||||
|
||||
menubarHandle = 0;
|
||||
menuHandle = 0;
|
||||
leftButtonMenuHandle = 0;
|
||||
leftButtonCommand = 0;
|
||||
QMenuBar::wceRefresh();
|
||||
}
|
||||
|
||||
QMenuPrivate::QWceMenuPrivate::QWceMenuPrivate()
|
||||
: menuHandle(0)
|
||||
{
|
||||
}
|
||||
|
||||
QMenuPrivate::QWceMenuPrivate::~QWceMenuPrivate()
|
||||
{
|
||||
qt_wce_delete_action_list(&actionItems);
|
||||
if (menuHandle)
|
||||
DestroyMenu(menuHandle);
|
||||
}
|
||||
|
||||
void QMenuPrivate::QWceMenuPrivate::addAction(QAction *a, QWceMenuAction *before)
|
||||
{
|
||||
QWceMenuAction *action = new QWceMenuAction;
|
||||
action->action = a;
|
||||
action->command = qt_wce_menu_static_cmd_id++;
|
||||
addAction(action, before);
|
||||
}
|
||||
|
||||
void QMenuPrivate::QWceMenuPrivate::addAction(QWceMenuAction *action, QWceMenuAction *before)
|
||||
{
|
||||
if (!action)
|
||||
return;
|
||||
int before_index = actionItems.indexOf(before);
|
||||
if (before_index < 0) {
|
||||
before = 0;
|
||||
before_index = actionItems.size();
|
||||
}
|
||||
actionItems.insert(before_index, action);
|
||||
rebuild();
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
||||
This function will return the HMENU used to create the native
|
||||
Windows CE menu bar bindings.
|
||||
*/
|
||||
|
||||
HMENU QMenu::wceMenu()
|
||||
{
|
||||
return d_func()->wceMenu();
|
||||
}
|
||||
|
||||
HMENU QMenuPrivate::wceMenu()
|
||||
{
|
||||
if (!wce_menu)
|
||||
wce_menu = new QWceMenuPrivate;
|
||||
if (!wce_menu->menuHandle)
|
||||
wce_menu->rebuild();
|
||||
return wce_menu->menuHandle;
|
||||
}
|
||||
|
||||
void QMenuPrivate::QWceMenuPrivate::rebuild()
|
||||
{
|
||||
if (!menuHandle)
|
||||
menuHandle = CreatePopupMenu();
|
||||
else
|
||||
qt_wce_clear_menu(menuHandle);
|
||||
|
||||
for (int i = 0; i < actionItems.size(); ++i) {
|
||||
QWceMenuAction *action = actionItems.at(i);
|
||||
action->menuHandle = menuHandle;
|
||||
qt_wce_insert_action(menuHandle, action);
|
||||
}
|
||||
QMenuBar::wceRefresh();
|
||||
}
|
||||
|
||||
void QMenuPrivate::QWceMenuPrivate::syncAction(QWceMenuAction *)
|
||||
{
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void QMenuPrivate::QWceMenuPrivate::removeAction(QWceMenuAction *action)
|
||||
{
|
||||
actionItems.removeAll(action);
|
||||
delete action;
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void QMenuBarPrivate::QWceMenuBarPrivate::addAction(QAction *a, QAction *before)
|
||||
{
|
||||
QWceMenuAction *action = new QWceMenuAction;
|
||||
action->action = a;
|
||||
action->command = qt_wce_menu_static_cmd_id++;
|
||||
addAction(action, findAction(before));
|
||||
}
|
||||
|
||||
void QMenuBarPrivate::QWceMenuBarPrivate::addAction(QWceMenuAction *action, QWceMenuAction *before)
|
||||
{
|
||||
if (!action)
|
||||
return;
|
||||
int before_index = actionItems.indexOf(before);
|
||||
if (before_index < 0) {
|
||||
before = 0;
|
||||
before_index = actionItems.size();
|
||||
}
|
||||
actionItems.insert(before_index, action);
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void QMenuBarPrivate::QWceMenuBarPrivate::syncAction(QWceMenuAction*)
|
||||
{
|
||||
QMenuBar::wceRefresh();
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void QMenuBarPrivate::QWceMenuBarPrivate::removeAction(QWceMenuAction *action)
|
||||
{
|
||||
actionItems.removeAll(action);
|
||||
delete action;
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void QMenuBarPrivate::_q_updateDefaultAction()
|
||||
{
|
||||
if (wce_menubar)
|
||||
wce_menubar->rebuild();
|
||||
}
|
||||
|
||||
void QMenuBarPrivate::QWceMenuBarPrivate::rebuild()
|
||||
{
|
||||
d->q_func()->resize(0,0);
|
||||
parentWindowHandle = d->q_func()->parentWidget() ? QApplicationPrivate::getHWNDForWidget(d->q_func()->parentWidget()) :
|
||||
QApplicationPrivate::getHWNDForWidget(d->q_func());
|
||||
if (d->wceClassicMenu) {
|
||||
QList<QAction*> actions = d->actions;
|
||||
int maxEntries;
|
||||
int resourceHandle;
|
||||
if (actions.size() < 5) {
|
||||
maxEntries = 4;
|
||||
resourceHandle = IDR_MAIN_MENU3;
|
||||
} else if (actions.size() < 7) {
|
||||
maxEntries = 6;
|
||||
resourceHandle = IDR_MAIN_MENU4;
|
||||
}
|
||||
else {
|
||||
maxEntries = 8;
|
||||
resourceHandle = IDR_MAIN_MENU5;
|
||||
}
|
||||
Q_ASSERT_X(menubarHandle, "rebuild !created", "menubar already deleted");
|
||||
qt_wce_clear_menu(menuHandle);
|
||||
DestroyWindow(menubarHandle);
|
||||
menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), resourceHandle);
|
||||
Q_ASSERT_X(menubarHandle, "rebuild classic menu", "cannot create menubar from resource");
|
||||
DrawMenuBar(menubarHandle);
|
||||
QList<int> menu_ids;
|
||||
QList<int> item_ids;
|
||||
menu_ids << IDM_MENU1 << IDM_MENU2 << IDM_MENU3 << IDM_MENU4 << IDM_MENU5 << IDM_MENU6 << IDM_MENU7 << IDM_MENU8;
|
||||
item_ids << IDM_ITEM1 << IDM_ITEM2 << IDM_ITEM3 << IDM_ITEM4 << IDM_ITEM5 << IDM_ITEM6 << IDM_ITEM7 << IDM_ITEM8;
|
||||
|
||||
for (int i = 0; i < actionItemsClassic.size(); ++i)
|
||||
if (!actionItemsClassic.value(i).empty())
|
||||
qt_wce_delete_action_list(&actionItemsClassic[i]);
|
||||
actionItemsClassic.clear();
|
||||
|
||||
for (int i = 0; i < actions.size(); ++i) {
|
||||
qt_wce_rename_menu_item(menubarHandle, menu_ids.at(i), actions.at(i)->text());
|
||||
QList<QAction *> subActions = actions.at(i)->menu()->actions();
|
||||
HMENU subMenuHandle = (HMENU) SendMessage(menubarHandle, SHCMBM_GETSUBMENU,0 , menu_ids.at(i));
|
||||
DeleteMenu(subMenuHandle, item_ids.at(i), MF_BYCOMMAND);
|
||||
for (int c = 0; c < subActions.size(); ++c) {
|
||||
QList<QWceMenuAction*> list;
|
||||
actionItemsClassic.append(list);
|
||||
QWceMenuAction *action = new QWceMenuAction;
|
||||
action->action = subActions.at(c);
|
||||
action->command = qt_wce_menu_static_cmd_id++;
|
||||
action->menuHandle = subMenuHandle;
|
||||
actionItemsClassic.last().append(action);
|
||||
qt_wce_insert_action(subMenuHandle, action);
|
||||
}
|
||||
}
|
||||
for (int i = actions.size();i<maxEntries;++i) {
|
||||
qt_wce_rename_menu_item(menubarHandle, menu_ids.at(i), QString());
|
||||
qt_wce_disable_soft_key(menubarHandle, menu_ids.at(i));
|
||||
}
|
||||
} else {
|
||||
leftButtonAction = d->defaultAction;
|
||||
if (!leftButtonAction)
|
||||
leftButtonAction = qt_wce_get_quit_action(actionItems);
|
||||
|
||||
leftButtonIsMenu = (leftButtonAction && leftButtonAction->menu());
|
||||
Q_ASSERT_X(menubarHandle, "rebuild !created", "menubar already deleted");
|
||||
qt_wce_clear_menu(menuHandle);
|
||||
DestroyWindow(menubarHandle);
|
||||
if (leftButtonIsMenu) {
|
||||
menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), IDR_MAIN_MENU2);
|
||||
Q_ASSERT_X(menubarHandle, "rebuild !created left menubar", "cannot create menubar from resource");
|
||||
menuHandle = (HMENU) SendMessage(menubarHandle, SHCMBM_GETSUBMENU,0,IDM_MENU);
|
||||
Q_ASSERT_X(menuHandle, "rebuild !created", "IDM_MENU not found - invalid resource?");
|
||||
DeleteMenu(menuHandle, IDM_ABOUT, MF_BYCOMMAND);
|
||||
leftButtonMenuHandle = (HMENU) SendMessage(menubarHandle, SHCMBM_GETSUBMENU,0,IDM_LEFTMENU);
|
||||
Q_ASSERT_X(leftButtonMenuHandle, "rebuild !created", "IDM_LEFTMENU not found - invalid resource?");
|
||||
DeleteMenu(leftButtonMenuHandle, IDM_VIEW, MF_BYCOMMAND);
|
||||
} else {
|
||||
menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), IDR_MAIN_MENU);
|
||||
Q_ASSERT_X(menubarHandle, "rebuild !created no left menubar", "cannot create menubar from resource");
|
||||
menuHandle = (HMENU) SendMessage(menubarHandle, SHCMBM_GETSUBMENU,0,IDM_MENU);
|
||||
Q_ASSERT_X(menuHandle, "rebuild !created", "IDM_MENU not found - invalid resource?");
|
||||
DeleteMenu(menuHandle, IDM_ABOUT, MF_BYCOMMAND);
|
||||
leftButtonMenuHandle = 0;
|
||||
leftButtonCommand = qt_wce_menu_static_cmd_id++;
|
||||
qt_wce_change_command(menubarHandle, IDM_EXIT, leftButtonCommand);
|
||||
}
|
||||
|
||||
if (actionItems.size() == 0) {
|
||||
qt_wce_rename_menu_item(menubarHandle, IDM_MENU, QLatin1String(""));
|
||||
qt_wce_disable_soft_key(menubarHandle, IDM_MENU);
|
||||
}
|
||||
for (int i = 0; i < actionItems.size(); ++i) {
|
||||
QWceMenuAction *action = actionItems.at(i);
|
||||
action->menuHandle = menuHandle;
|
||||
qt_wce_insert_action(menuHandle, action);
|
||||
}
|
||||
if (!leftButtonIsMenu) {
|
||||
if (leftButtonAction) {
|
||||
qt_wce_rename_menu_item(menubarHandle, leftButtonCommand, leftButtonAction->text());
|
||||
qt_wce_enable_soft_key(menubarHandle, leftButtonCommand);
|
||||
} else {
|
||||
qt_wce_rename_menu_item(menubarHandle, leftButtonCommand, QLatin1String(""));
|
||||
qt_wce_disable_soft_key(menubarHandle, leftButtonCommand);
|
||||
}
|
||||
} else {
|
||||
qt_wce_rename_menu_item(menubarHandle, IDM_LEFTMENU, leftButtonAction->text());
|
||||
QList<QAction *> actions = leftButtonAction->menu()->actions();
|
||||
qt_wce_delete_action_list(&actionItemsLeftButton);
|
||||
for (int i=0; i<actions.size(); ++i) {
|
||||
QWceMenuAction *action = new QWceMenuAction;
|
||||
action->action = actions.at(i);
|
||||
action->command = qt_wce_menu_static_cmd_id++;
|
||||
action->menuHandle = leftButtonMenuHandle;
|
||||
actionItemsLeftButton.append(action);
|
||||
qt_wce_insert_action(leftButtonMenuHandle, action);
|
||||
}
|
||||
}
|
||||
}
|
||||
DrawMenuBar(menubarHandle);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QT_NO_MENUBAR
|
||||
#endif //Q_OS_WINCE
|
@ -1,231 +0,0 @@
|
||||
#include "qmenu_wince_resource_p.h"
|
||||
|
||||
#include <commctrl.h>
|
||||
#include "winuser.h"
|
||||
|
||||
#if defined (_DEBUG) && defined(QT_SHARED)
|
||||
#include "Qt5Widgetsd_resource.rc"
|
||||
#elif defined(QT_SHARED)
|
||||
#include "Qt5Widgets_resource.rc"
|
||||
#endif
|
||||
|
||||
#define DIALOGEX DIALOG DISCARDABLE
|
||||
#define SHMENUBAR RCDATA
|
||||
#define I_IMAGENONE (-2)
|
||||
#define NOMENU 0xFFFF
|
||||
|
||||
IDR_MAIN_MENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "Menu"
|
||||
BEGIN
|
||||
MENUITEM "About", IDM_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
IDR_MAIN_MENU2 MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "Menu"
|
||||
BEGIN
|
||||
MENUITEM "About", IDM_ABOUT
|
||||
END
|
||||
POPUP "Display"
|
||||
BEGIN
|
||||
MENUITEM "View", IDM_VIEW
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
IDR_MAIN_MENU3 MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "Menu1"
|
||||
BEGIN
|
||||
MENUITEM "Item1", IDM_ITEM1
|
||||
END
|
||||
POPUP "Menu2"
|
||||
BEGIN
|
||||
MENUITEM "Item2", IDM_ITEM2
|
||||
END
|
||||
POPUP "Menu3"
|
||||
BEGIN
|
||||
MENUITEM "Item3", IDM_ITEM3
|
||||
END
|
||||
POPUP "Menu4"
|
||||
BEGIN
|
||||
MENUITEM "Item4", IDM_ITEM4
|
||||
END
|
||||
END
|
||||
|
||||
IDR_MAIN_MENU4 MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "Menu1"
|
||||
BEGIN
|
||||
MENUITEM "Item1", IDM_ITEM1
|
||||
END
|
||||
POPUP "Menu2"
|
||||
BEGIN
|
||||
MENUITEM "Item2", IDM_ITEM2
|
||||
END
|
||||
POPUP "Menu3"
|
||||
BEGIN
|
||||
MENUITEM "Item3", IDM_ITEM3
|
||||
END
|
||||
POPUP "Menu4"
|
||||
BEGIN
|
||||
MENUITEM "Item4", IDM_ITEM4
|
||||
END
|
||||
POPUP "Menu5"
|
||||
BEGIN
|
||||
MENUITEM "Item5", IDM_ITEM5
|
||||
END
|
||||
POPUP "Menu6"
|
||||
BEGIN
|
||||
MENUITEM "Item6", IDM_ITEM6
|
||||
END
|
||||
END
|
||||
|
||||
IDR_MAIN_MENU5 MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "Menu1"
|
||||
BEGIN
|
||||
MENUITEM "Item1", IDM_ITEM1
|
||||
END
|
||||
POPUP "Menu2"
|
||||
BEGIN
|
||||
MENUITEM "Item2", IDM_ITEM2
|
||||
END
|
||||
POPUP "Menu3"
|
||||
BEGIN
|
||||
MENUITEM "Item3", IDM_ITEM3
|
||||
END
|
||||
POPUP "Menu4"
|
||||
BEGIN
|
||||
MENUITEM "Item4", IDM_ITEM4
|
||||
END
|
||||
POPUP "Menu5"
|
||||
BEGIN
|
||||
MENUITEM "Item5", IDM_ITEM5
|
||||
END
|
||||
POPUP "Menu6"
|
||||
BEGIN
|
||||
MENUITEM "Item6", IDM_ITEM6
|
||||
END
|
||||
POPUP "Menu7"
|
||||
BEGIN
|
||||
MENUITEM "Item7", IDM_ITEM7
|
||||
END
|
||||
POPUP "Menu8"
|
||||
BEGIN
|
||||
MENUITEM "Item8", IDM_ITEM8
|
||||
END
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_EXIT "Exit"
|
||||
IDS_MENU "Menu"
|
||||
IDS_LEFTMENU "Display"
|
||||
IDS_MENU1 "Menu__1"
|
||||
IDS_MENU2 "Menu__2"
|
||||
IDS_MENU3 "Menu__3"
|
||||
IDS_MENU4 "Menu__4"
|
||||
IDS_MENU5 "Menu__5"
|
||||
IDS_MENU6 "Menu__6"
|
||||
IDS_MENU7 "Menu__7"
|
||||
IDS_MENU8 "Menu__8"
|
||||
END
|
||||
|
||||
IDR_MAIN_MENU SHMENUBAR DISCARDABLE
|
||||
BEGIN
|
||||
IDR_MAIN_MENU,
|
||||
2,
|
||||
|
||||
I_IMAGENONE, IDM_EXIT, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE,
|
||||
IDS_EXIT, 0, NOMENU,
|
||||
|
||||
I_IMAGENONE, IDM_MENU, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU, 0, 0,
|
||||
END
|
||||
|
||||
IDR_MAIN_MENU2 SHMENUBAR DISCARDABLE
|
||||
BEGIN
|
||||
IDR_MAIN_MENU2,
|
||||
2,
|
||||
|
||||
I_IMAGENONE, IDM_LEFTMENU, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_LEFTMENU, 0, 1,
|
||||
|
||||
I_IMAGENONE, IDM_MENU, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU, 0, 0,
|
||||
END
|
||||
|
||||
IDR_MAIN_MENU3 SHMENUBAR DISCARDABLE
|
||||
BEGIN
|
||||
IDR_MAIN_MENU3,
|
||||
4,
|
||||
|
||||
I_IMAGENONE, IDM_MENU1, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU1, 0, 0,
|
||||
|
||||
I_IMAGENONE, IDM_MENU2, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU2, 0, 1,
|
||||
|
||||
I_IMAGENONE, IDM_MENU3, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU3, 0, 2,
|
||||
|
||||
I_IMAGENONE, IDM_MENU4, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU4, 0, 3,
|
||||
END
|
||||
|
||||
IDR_MAIN_MENU4 SHMENUBAR DISCARDABLE
|
||||
BEGIN
|
||||
IDR_MAIN_MENU4,
|
||||
6,
|
||||
|
||||
I_IMAGENONE, IDM_MENU1, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU1, 0, 0,
|
||||
|
||||
I_IMAGENONE, IDM_MENU2, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU2, 0, 1,
|
||||
|
||||
I_IMAGENONE, IDM_MENU3, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU3, 0, 2,
|
||||
|
||||
I_IMAGENONE, IDM_MENU4, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU4, 0, 3,
|
||||
|
||||
I_IMAGENONE, IDM_MENU5, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU5, 0, 4,
|
||||
|
||||
I_IMAGENONE, IDM_MENU6, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU6, 0, 5,
|
||||
END
|
||||
|
||||
IDR_MAIN_MENU5 SHMENUBAR DISCARDABLE
|
||||
BEGIN
|
||||
IDR_MAIN_MENU5,
|
||||
8,
|
||||
|
||||
I_IMAGENONE, IDM_MENU1, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU1, 0, 0,
|
||||
|
||||
I_IMAGENONE, IDM_MENU2, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU2, 0, 1,
|
||||
|
||||
I_IMAGENONE, IDM_MENU3, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU3, 0, 2,
|
||||
|
||||
I_IMAGENONE, IDM_MENU4, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU4, 0, 3,
|
||||
|
||||
I_IMAGENONE, IDM_MENU5, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU5, 0, 4,
|
||||
|
||||
I_IMAGENONE, IDM_MENU6, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU6, 0, 5,
|
||||
|
||||
I_IMAGENONE, IDM_MENU7, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU7, 0, 6,
|
||||
|
||||
I_IMAGENONE, IDM_MENU8, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
|
||||
IDS_MENU8, 0, 7,
|
||||
END
|
@ -1,89 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtWidgets module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the Qt API. It exists purely as an
|
||||
// implementation detail. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
|
||||
#define IDR_MAIN_MENU 102
|
||||
#define IDR_MAIN_MENU2 103
|
||||
#define IDR_MAIN_MENU3 104
|
||||
#define IDS_EXIT 105
|
||||
#define IDS_MENU 106
|
||||
#define IDS_LEFTMENU 107
|
||||
#define IDM_ABOUT 108
|
||||
#define IDM_VIEW 109
|
||||
#define IDM_ITEM1 108
|
||||
#define IDM_ITEM2 109
|
||||
#define IDM_ITEM3 110
|
||||
#define IDM_ITEM4 111
|
||||
#define IDM_ITEM5 112
|
||||
#define IDM_ITEM6 113
|
||||
#define IDM_ITEM7 114
|
||||
#define IDM_ITEM8 115
|
||||
#define IDS_MENU1 116
|
||||
#define IDS_MENU2 117
|
||||
#define IDS_MENU3 118
|
||||
#define IDS_MENU4 119
|
||||
#define IDS_MENU5 120
|
||||
#define IDS_MENU6 121
|
||||
#define IDS_MENU7 122
|
||||
#define IDS_MENU8 123
|
||||
#define IDR_MAIN_MENU4 124
|
||||
#define IDR_MAIN_MENU5 125
|
||||
#define IDM_EXIT 40000
|
||||
#define IDM_MENU 40001
|
||||
#define IDM_LEFTMENU 40002
|
||||
#define IDM_MENU1 40003
|
||||
#define IDM_MENU2 40004
|
||||
#define IDM_MENU3 40005
|
||||
#define IDM_MENU4 40006
|
||||
#define IDM_MENU5 40007
|
||||
#define IDM_MENU6 40008
|
||||
#define IDM_MENU7 40009
|
||||
#define IDM_MENU8 40010
|
||||
|
@ -64,10 +64,6 @@
|
||||
#include "qmenubar_p.h"
|
||||
#include "qdebug.h"
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QMenuBarExtension : public QToolButton
|
||||
@ -701,16 +697,6 @@ void QMenuBarPrivate::init()
|
||||
|
||||
if (platformMenuBar)
|
||||
q->hide();
|
||||
#ifdef Q_OS_WINCE
|
||||
if (qt_wince_is_mobile()) {
|
||||
wceCreateMenuBar(q->parentWidget());
|
||||
if(wce_menubar)
|
||||
q->hide();
|
||||
}
|
||||
else {
|
||||
QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
|
||||
}
|
||||
#endif
|
||||
q->setBackgroundRole(QPalette::Button);
|
||||
oldWindow = oldParent = 0;
|
||||
handleReparent();
|
||||
@ -761,11 +747,6 @@ QMenuBar::~QMenuBar()
|
||||
Q_D(QMenuBar);
|
||||
delete d->platformMenuBar;
|
||||
d->platformMenuBar = 0;
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
if (qt_wince_is_mobile())
|
||||
d->wceDestroyMenuBar();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -1017,7 +998,7 @@ void QMenuBar::paintEvent(QPaintEvent *e)
|
||||
*/
|
||||
void QMenuBar::setVisible(bool visible)
|
||||
{
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_DARWIN)
|
||||
if (isNativeMenuBar()) {
|
||||
if (!visible)
|
||||
QWidget::setVisible(false);
|
||||
@ -1234,11 +1215,7 @@ void QMenuBar::actionEvent(QActionEvent *e)
|
||||
d->itemsDirty = true;
|
||||
|
||||
if (d->platformMenuBar) {
|
||||
#if !defined(Q_OS_WINCE)
|
||||
QPlatformMenuBar *nativeMenuBar = d->platformMenuBar;
|
||||
#else
|
||||
QMenuBarPrivate::QWceMenuBarPrivate *nativeMenuBar = d->wce_menubar;
|
||||
#endif
|
||||
if (!nativeMenuBar)
|
||||
return;
|
||||
|
||||
@ -1379,11 +1356,6 @@ void QMenuBarPrivate::handleReparent()
|
||||
platformMenuBar->handleReparent(0);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
if (qt_wince_is_mobile() && wce_menubar)
|
||||
wce_menubar->rebuild();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -1563,7 +1535,7 @@ QRect QMenuBar::actionGeometry(QAction *act) const
|
||||
QSize QMenuBar::minimumSizeHint() const
|
||||
{
|
||||
Q_D(const QMenuBar);
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_DARWIN)
|
||||
const bool as_gui_menubar = !isNativeMenuBar();
|
||||
#else
|
||||
const bool as_gui_menubar = true;
|
||||
@ -1619,7 +1591,7 @@ QSize QMenuBar::minimumSizeHint() const
|
||||
QSize QMenuBar::sizeHint() const
|
||||
{
|
||||
Q_D(const QMenuBar);
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_DARWIN)
|
||||
const bool as_gui_menubar = !isNativeMenuBar();
|
||||
#else
|
||||
const bool as_gui_menubar = true;
|
||||
@ -1677,7 +1649,7 @@ QSize QMenuBar::sizeHint() const
|
||||
int QMenuBar::heightForWidth(int) const
|
||||
{
|
||||
Q_D(const QMenuBar);
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_DARWIN)
|
||||
const bool as_gui_menubar = !isNativeMenuBar();
|
||||
#else
|
||||
const bool as_gui_menubar = true;
|
||||
@ -1861,55 +1833,6 @@ QPlatformMenuBar *QMenuBar::platformMenuBar()
|
||||
return d->platformMenuBar;
|
||||
}
|
||||
|
||||
/*!
|
||||
\since 4.4
|
||||
|
||||
Sets the default action to \a act.
|
||||
|
||||
The default action is assigned to the left soft key. The menu is assigned
|
||||
to the right soft key.
|
||||
|
||||
Currently there is only support for the default action on Windows
|
||||
Mobile. On all other platforms this method is not available.
|
||||
|
||||
\sa defaultAction()
|
||||
*/
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
void QMenuBar::setDefaultAction(QAction *act)
|
||||
{
|
||||
Q_D(QMenuBar);
|
||||
if (d->defaultAction == act)
|
||||
return;
|
||||
if (qt_wince_is_mobile())
|
||||
if (d->defaultAction) {
|
||||
disconnect(d->defaultAction, SIGNAL(changed()), this, SLOT(_q_updateDefaultAction()));
|
||||
disconnect(d->defaultAction, SIGNAL(destroyed()), this, SLOT(_q_updateDefaultAction()));
|
||||
}
|
||||
d->defaultAction = act;
|
||||
if (qt_wince_is_mobile())
|
||||
if (d->defaultAction) {
|
||||
connect(d->defaultAction, SIGNAL(changed()), this, SLOT(_q_updateDefaultAction()));
|
||||
connect(d->defaultAction, SIGNAL(destroyed()), this, SLOT(_q_updateDefaultAction()));
|
||||
}
|
||||
if (d->wce_menubar) {
|
||||
d->wce_menubar->rebuild();
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\since 4.4
|
||||
|
||||
Returns the current default action.
|
||||
|
||||
\sa setDefaultAction()
|
||||
*/
|
||||
QAction *QMenuBar::defaultAction() const
|
||||
{
|
||||
return d_func()->defaultAction;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\fn void QMenuBar::triggered(QAction *action)
|
||||
|
||||
|
@ -95,13 +95,6 @@ public:
|
||||
void setCornerWidget(QWidget *w, Qt::Corner corner = Qt::TopRightCorner);
|
||||
QWidget *cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
void setDefaultAction(QAction *);
|
||||
QAction *defaultAction() const;
|
||||
|
||||
static void wceCommands(uint command);
|
||||
static void wceRefresh();
|
||||
#endif
|
||||
#ifdef Q_OS_OSX
|
||||
NSMenu* toNSMenu();
|
||||
#endif
|
||||
@ -141,10 +134,6 @@ private:
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_internalShortcutActivated(int))
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_updateLayout())
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_updateDefaultAction())
|
||||
#endif
|
||||
|
||||
friend class QMenu;
|
||||
friend class QMenuPrivate;
|
||||
friend class QWindowsStyle;
|
||||
|
@ -66,17 +66,11 @@ public:
|
||||
QMenuBarPrivate() : itemsDirty(0), currentAction(0), mouseDown(0),
|
||||
closePopupMode(0), defaultPopDown(1), popupState(0), keyboardState(0), altPressed(0),
|
||||
nativeMenuBar(-1), doChildEffects(false), platformMenuBar(0)
|
||||
{ }
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
, wce_menubar(0), wceClassicMenu(false)
|
||||
#endif
|
||||
{ }
|
||||
~QMenuBarPrivate()
|
||||
{
|
||||
delete platformMenuBar;
|
||||
#ifdef Q_OS_WINCE
|
||||
delete wce_menubar;
|
||||
#endif
|
||||
}
|
||||
|
||||
void init();
|
||||
@ -118,10 +112,6 @@ public:
|
||||
void _q_internalShortcutActivated(int);
|
||||
void _q_updateLayout();
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
void _q_updateDefaultAction();
|
||||
#endif
|
||||
|
||||
//extra widgets in the menubar
|
||||
QPointer<QWidget> leftWidget, rightWidget;
|
||||
QMenuBarExtension *extension;
|
||||
@ -146,47 +136,6 @@ public:
|
||||
QPlatformMenu *getPlatformMenu(QAction *action);
|
||||
|
||||
inline int indexOf(QAction *act) const { return q_func()->actions().indexOf(act); }
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
void wceCreateMenuBar(QWidget *);
|
||||
void wceDestroyMenuBar();
|
||||
struct QWceMenuBarPrivate {
|
||||
QList<QWceMenuAction*> actionItems;
|
||||
QList<QWceMenuAction*> actionItemsLeftButton;
|
||||
QList<QList<QWceMenuAction*>> actionItemsClassic;
|
||||
HMENU menuHandle;
|
||||
HMENU leftButtonMenuHandle;
|
||||
HWND menubarHandle;
|
||||
HWND parentWindowHandle;
|
||||
bool leftButtonIsMenu;
|
||||
QPointer<QAction> leftButtonAction;
|
||||
QMenuBarPrivate *d;
|
||||
int leftButtonCommand;
|
||||
|
||||
QWceMenuBarPrivate(QMenuBarPrivate *menubar);
|
||||
~QWceMenuBarPrivate();
|
||||
void addAction(QAction *, QAction *);
|
||||
void addAction(QAction *, QWceMenuAction* =0);
|
||||
void addAction(QWceMenuAction *, QWceMenuAction* =0);
|
||||
void syncAction(QWceMenuAction *);
|
||||
inline void syncAction(QAction *a) { syncAction(findAction(a)); }
|
||||
void removeAction(QWceMenuAction *);
|
||||
void rebuild();
|
||||
inline void removeAction(QAction *a) { removeAction(findAction(a)); }
|
||||
inline QWceMenuAction *findAction(QAction *a) {
|
||||
for(int i = 0; i < actionItems.size(); i++) {
|
||||
QWceMenuAction *act = actionItems[i];
|
||||
if(a == act->action)
|
||||
return act;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} *wce_menubar;
|
||||
bool wceClassicMenu;
|
||||
void wceCommands(uint command);
|
||||
void wceRefresh();
|
||||
bool wceEmitSignals(QList<QWceMenuAction*> actions, uint command);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // QT_NO_MENUBAR
|
||||
|
@ -397,12 +397,6 @@ void QScrollBarPrivate::init()
|
||||
q->setSizePolicy(sp);
|
||||
q->setAttribute(Qt::WA_WState_OwnSizePolicy, false);
|
||||
q->setAttribute(Qt::WA_OpaquePaintEvent);
|
||||
|
||||
#if !defined(QT_NO_CONTEXTMENU) && defined(Q_OS_WINCE)
|
||||
if (!q->style()->styleHint(QStyle::SH_ScrollBar_ContextMenu, 0, q)) {
|
||||
q->setContextMenuPolicy(Qt::PreventContextMenu);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef QT_NO_CONTEXTMENU
|
||||
|
@ -1186,17 +1186,6 @@ bool QToolBar::event(QEvent *event)
|
||||
if (d->mouseMoveEvent(static_cast<QMouseEvent*>(event)))
|
||||
return true;
|
||||
break;
|
||||
#ifdef Q_OS_WINCE
|
||||
case QEvent::ContextMenu:
|
||||
{
|
||||
QContextMenuEvent* contextMenuEvent = static_cast<QContextMenuEvent*>(event);
|
||||
QWidget* child = childAt(contextMenuEvent->pos());
|
||||
QAbstractButton* button = qobject_cast<QAbstractButton*>(child);
|
||||
if (button)
|
||||
button->setDown(false);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case QEvent::Leave:
|
||||
if (d->state != 0 && d->state->dragging) {
|
||||
#ifdef Q_OS_WIN
|
||||
|
@ -155,19 +155,3 @@ macx {
|
||||
widgets/qmacnativewidget_mac.mm \
|
||||
widgets/qmaccocoaviewcontainer_mac.mm
|
||||
}
|
||||
|
||||
wince {
|
||||
SOURCES += widgets/qmenu_wince.cpp
|
||||
HEADERS += widgets/qmenu_wince_resource_p.h
|
||||
RC_FILE = widgets/qmenu_wince.rc
|
||||
!static: QMAKE_WRITE_DEFAULT_RC = 1
|
||||
!isEmpty(QT_LIBINFIX) {
|
||||
ORIG_RCFILE = $${TARGET}_resource.rc
|
||||
copyrcc.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
||||
copyrcc.input = ORIG_RCFILE
|
||||
CONFIG(debug, debug|release):copyrcc.output = $${ORIG_TARGET}d_resource.rc
|
||||
else:copyrcc.output = $${ORIG_TARGET}_resource.rc
|
||||
copyrcc.CONFIG = target_predeps no_link
|
||||
QMAKE_EXTRA_COMPILERS += copyrcc
|
||||
}
|
||||
}
|
||||
|
@ -69,10 +69,8 @@ private slots:
|
||||
void showMaximized();
|
||||
void showMinimized();
|
||||
void showFullScreen();
|
||||
#ifndef Q_OS_WINCE
|
||||
void showAsTool();
|
||||
void toolDialogPosition();
|
||||
#endif
|
||||
void deleteMainDefault();
|
||||
void deleteInExec();
|
||||
#ifndef QT_NO_SIZEGRIP
|
||||
@ -358,8 +356,6 @@ void tst_QDialog::showFullScreen()
|
||||
QVERIFY(!dialog.isVisible());
|
||||
}
|
||||
|
||||
// No real support for Qt::Tool on WinCE
|
||||
#ifndef Q_OS_WINCE
|
||||
void tst_QDialog::showAsTool()
|
||||
{
|
||||
#if defined(Q_OS_UNIX)
|
||||
@ -379,10 +375,7 @@ void tst_QDialog::showAsTool()
|
||||
QCOMPARE(dialog.wasActive(), false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// No real support for Qt::Tool on WinCE
|
||||
#ifndef Q_OS_WINCE
|
||||
// Verify that pos() returns the same before and after show()
|
||||
// for a dialog with the Tool window type.
|
||||
void tst_QDialog::toolDialogPosition()
|
||||
@ -394,7 +387,6 @@ void tst_QDialog::toolDialogPosition()
|
||||
const QPoint afterShowPosition = dialog.pos();
|
||||
QCOMPARE(afterShowPosition, beforeShowPosition);
|
||||
}
|
||||
#endif
|
||||
|
||||
class Dialog : public QDialog
|
||||
{
|
||||
|
@ -8,18 +8,6 @@ QT += widgets widgets-private testlib
|
||||
QT += core-private gui-private
|
||||
SOURCES += tst_qfiledialog.cpp
|
||||
|
||||
wince* {
|
||||
addFiles.files = *.cpp
|
||||
addFiles.path = .
|
||||
filesInDir.files = *.pro
|
||||
filesInDir.path = someDir
|
||||
DEPLOYMENT += addFiles filesInDir
|
||||
}
|
||||
|
||||
wince* {
|
||||
DEFINES += SRCDIR=\\\"./\\\"
|
||||
} else {
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
}
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
|
||||
linux*: CONFIG += insignificant_test # Crashes on different Linux distros
|
||||
|
@ -183,9 +183,6 @@ void tst_QFiledialog::init()
|
||||
QFileDialogPrivate::setLastVisitedDirectory(QUrl());
|
||||
// populate the sidebar with some default settings
|
||||
QNonNativeFileDialog fd;
|
||||
#if defined(Q_OS_WINCE)
|
||||
QTest::qWait(1000);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QFiledialog::cleanup()
|
||||
|
@ -6,17 +6,4 @@ QT += core-private gui-private
|
||||
|
||||
SOURCES += tst_qfiledialog2.cpp
|
||||
|
||||
wince* {
|
||||
addFiles.files = *.cpp
|
||||
addFiles.path = .
|
||||
filesInDir.files = *.pro
|
||||
filesInDir.path = someDir
|
||||
DEPLOYMENT += addFiles filesInDir
|
||||
}
|
||||
|
||||
wince* {
|
||||
DEFINES += SRCDIR=\\\"./\\\"
|
||||
} else {
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
}
|
||||
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
|
@ -54,7 +54,7 @@
|
||||
|
||||
#include <qpa/qplatformdialoghelper.h>
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
#include "../../../network-settings.h"
|
||||
#endif
|
||||
|
||||
@ -118,7 +118,7 @@ private slots:
|
||||
#ifndef Q_OS_MAC
|
||||
void task227930_correctNavigationKeyboardBehavior();
|
||||
#endif
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
void task226366_lowerCaseHardDriveWindows();
|
||||
#endif
|
||||
void completionOnLevelAfterRoot();
|
||||
@ -148,9 +148,6 @@ private:
|
||||
tst_QFileDialog2::tst_QFileDialog2()
|
||||
: tempDir(QDir::tempPath() + "/tst_qfiledialog2.XXXXXX")
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QFileDialog2::cleanupSettingsFile()
|
||||
@ -177,9 +174,6 @@ void tst_QFileDialog2::init()
|
||||
QFileDialogPrivate::setLastVisitedDirectory(QUrl());
|
||||
// populate the sidebar with some default settings
|
||||
QNonNativeFileDialog fd;
|
||||
#if defined(Q_OS_WINCE)
|
||||
QTest::qWait(1000);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QFileDialog2::cleanup()
|
||||
@ -199,11 +193,7 @@ void tst_QFileDialog2::listRoot()
|
||||
fd.show();
|
||||
QCOMPARE(qt_test_isFetchedRoot(),false);
|
||||
fd.setDirectory("");
|
||||
#ifdef Q_OS_WINCE
|
||||
QTest::qWait(1500);
|
||||
#else
|
||||
QTest::qWait(500);
|
||||
#endif
|
||||
QCOMPARE(qt_test_isFetchedRoot(),true);
|
||||
}
|
||||
#endif
|
||||
@ -297,7 +287,7 @@ void tst_QFileDialog2::showNameFilterDetails()
|
||||
|
||||
void tst_QFileDialog2::unc()
|
||||
{
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
// Only test UNC on Windows./
|
||||
QString dir("\\\\" + QtNetworkSettings::winServerName() + "\\testsharewritable");
|
||||
#else
|
||||
@ -645,7 +635,7 @@ void tst_QFileDialog2::task227930_correctNavigationKeyboardBehavior()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
void tst_QFileDialog2::task226366_lowerCaseHardDriveWindows()
|
||||
{
|
||||
QNonNativeFileDialog fd;
|
||||
@ -675,7 +665,7 @@ void tst_QFileDialog2::task226366_lowerCaseHardDriveWindows()
|
||||
void tst_QFileDialog2::completionOnLevelAfterRoot()
|
||||
{
|
||||
QNonNativeFileDialog fd;
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
fd.setDirectory("C:/");
|
||||
QDir current = fd.directory();
|
||||
QStringList entryList = current.entryList(QStringList(), QDir::Dirs);
|
||||
@ -719,7 +709,7 @@ void tst_QFileDialog2::completionOnLevelAfterRoot()
|
||||
fd.show();
|
||||
QLineEdit *edit = fd.findChild<QLineEdit*>("fileNameEdit");
|
||||
QTest::qWait(2000);
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
//I love testlib :D
|
||||
for (int i = 0; i < 5; i++)
|
||||
QTest::keyClick(edit, testDir.at(i).toLower().toLatin1() - 'a' + Qt::Key_A);
|
||||
@ -730,7 +720,7 @@ void tst_QFileDialog2::completionOnLevelAfterRoot()
|
||||
QTest::qWait(200);
|
||||
QTest::keyClick(edit->completer()->popup(), Qt::Key_Down);
|
||||
QTest::qWait(200);
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
QCOMPARE(edit->text(), testDir);
|
||||
#else
|
||||
QTRY_COMPARE(edit->text(), QString("etc"));
|
||||
@ -864,33 +854,21 @@ void tst_QFileDialog2::task228844_ensurePreviousSorting()
|
||||
fd.setDirectory(current.absolutePath());
|
||||
fd.setViewMode(QFileDialog::Detail);
|
||||
fd.show();
|
||||
#if defined(Q_OS_WINCE)
|
||||
QTest::qWait(1500);
|
||||
#else
|
||||
QTest::qWait(500);
|
||||
#endif
|
||||
QTreeView *tree = fd.findChild<QTreeView*>("treeView");
|
||||
tree->header()->setSortIndicator(3,Qt::DescendingOrder);
|
||||
QTest::qWait(200);
|
||||
QDialogButtonBox *buttonBox = fd.findChild<QDialogButtonBox*>("buttonBox");
|
||||
QPushButton *button = buttonBox->button(QDialogButtonBox::Open);
|
||||
QTest::mouseClick(button, Qt::LeftButton);
|
||||
#if defined(Q_OS_WINCE)
|
||||
QTest::qWait(1500);
|
||||
#else
|
||||
QTest::qWait(500);
|
||||
#endif
|
||||
QNonNativeFileDialog fd2;
|
||||
fd2.setFileMode(QFileDialog::Directory);
|
||||
fd2.restoreState(fd.saveState());
|
||||
current.cd("aaaaaaaaaaaaaaaaaa");
|
||||
fd2.setDirectory(current.absolutePath());
|
||||
fd2.show();
|
||||
#if defined(Q_OS_WINCE)
|
||||
QTest::qWait(1500);
|
||||
#else
|
||||
QTest::qWait(500);
|
||||
#endif
|
||||
QTreeView *tree2 = fd2.findChild<QTreeView*>("treeView");
|
||||
tree2->setFocus();
|
||||
|
||||
@ -900,22 +878,14 @@ void tst_QFileDialog2::task228844_ensurePreviousSorting()
|
||||
QPushButton *button2 = buttonBox2->button(QDialogButtonBox::Open);
|
||||
fd2.selectFile("g");
|
||||
QTest::mouseClick(button2, Qt::LeftButton);
|
||||
#if defined(Q_OS_WINCE)
|
||||
QTest::qWait(1500);
|
||||
#else
|
||||
QTest::qWait(500);
|
||||
#endif
|
||||
QCOMPARE(fd2.selectedFiles().first(), current.absolutePath() + QLatin1String("/g"));
|
||||
|
||||
QNonNativeFileDialog fd3(0, "This is a third file dialog", tempFile->fileName());
|
||||
fd3.restoreState(fd.saveState());
|
||||
fd3.setFileMode(QFileDialog::Directory);
|
||||
fd3.show();
|
||||
#if defined(Q_OS_WINCE)
|
||||
QTest::qWait(1500);
|
||||
#else
|
||||
QTest::qWait(500);
|
||||
#endif
|
||||
QTreeView *tree3 = fd3.findChild<QTreeView*>("treeView");
|
||||
tree3->setFocus();
|
||||
|
||||
@ -924,11 +894,7 @@ void tst_QFileDialog2::task228844_ensurePreviousSorting()
|
||||
QDialogButtonBox *buttonBox3 = fd3.findChild<QDialogButtonBox*>("buttonBox");
|
||||
QPushButton *button3 = buttonBox3->button(QDialogButtonBox::Open);
|
||||
QTest::mouseClick(button3, Qt::LeftButton);
|
||||
#if defined(Q_OS_WINCE)
|
||||
QTest::qWait(1500);
|
||||
#else
|
||||
QTest::qWait(500);
|
||||
#endif
|
||||
QCOMPARE(fd3.selectedFiles().first(), tempFile->fileName());
|
||||
|
||||
current.cd("aaaaaaaaaaaaaaaaaa");
|
||||
@ -1010,11 +976,7 @@ void tst_QFileDialog2::task251321_sideBarHiddenEntries()
|
||||
sidebar->selectUrl(QUrl::fromLocalFile(hiddenSubDir.absolutePath()));
|
||||
QTest::mouseClick(sidebar->viewport(), Qt::LeftButton, 0, sidebar->visualRect(sidebar->model()->index(0, 0)).center());
|
||||
// give the background processes more time on windows mobile
|
||||
#ifdef Q_OS_WINCE
|
||||
QTest::qWait(1000);
|
||||
#else
|
||||
QTest::qWait(250);
|
||||
#endif
|
||||
|
||||
QFileSystemModel *model = fd.findChild<QFileSystemModel*>("qt_filesystem_model");
|
||||
QCOMPARE(model->rowCount(model->index(hiddenSubDir.absolutePath())), 2);
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <QStyle>
|
||||
#include <QtGlobal>
|
||||
#include <QTemporaryDir>
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
# include <qt_windows.h> // for SetFileAttributes
|
||||
#endif
|
||||
|
||||
@ -104,7 +104,7 @@ private slots:
|
||||
|
||||
void caseSensitivity();
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
void Win32LongFileName();
|
||||
#endif
|
||||
|
||||
@ -334,7 +334,7 @@ bool tst_QFileSystemModel::createFiles(const QString &test_path, const QStringLi
|
||||
return false;
|
||||
}
|
||||
file.close();
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
if (initial_files.at(i)[0] == '.') {
|
||||
QString hiddenFile = QDir::toNativeSeparators(file.fileName());
|
||||
wchar_t nativeHiddenFile[MAX_PATH];
|
||||
@ -371,14 +371,9 @@ void tst_QFileSystemModel::rowCount()
|
||||
QSignalSpy spy2(model, SIGNAL(rowsInserted(QModelIndex,int,int)));
|
||||
QSignalSpy spy3(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
|
||||
|
||||
#if !defined(Q_OS_WINCE)
|
||||
QStringList files = QStringList() << "b" << "d" << "f" << "h" << "j" << ".a" << ".c" << ".e" << ".g";
|
||||
QString l = "b,d,f,h,j,.a,.c,.e,.g";
|
||||
#else
|
||||
// Cannot hide them on CE
|
||||
QStringList files = QStringList() << "b" << "d" << "f" << "h" << "j";
|
||||
QString l = "b,d,f,h,j";
|
||||
#endif
|
||||
|
||||
QVERIFY(createFiles(tmp, files));
|
||||
|
||||
QModelIndex root = model->setRootPath(tmp);
|
||||
@ -406,9 +401,6 @@ static inline QString lastEntry(const QModelIndex &root)
|
||||
|
||||
void tst_QFileSystemModel::rowsInserted()
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
QSKIP("Watching directories does not work on CE(see #137910)");
|
||||
#endif
|
||||
QString tmp = flatDirTestPath;
|
||||
rowCount();
|
||||
QModelIndex root = model->index(model->rootPath());
|
||||
@ -463,9 +455,6 @@ void tst_QFileSystemModel::rowsRemoved_data()
|
||||
|
||||
void tst_QFileSystemModel::rowsRemoved()
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
QSKIP("Watching directories does not work on CE(see #137910)");
|
||||
#endif
|
||||
QString tmp = flatDirTestPath;
|
||||
rowCount();
|
||||
QModelIndex root = model->index(model->rootPath());
|
||||
@ -554,7 +543,6 @@ void tst_QFileSystemModel::filters_data()
|
||||
QTest::addColumn<int>("dirFilters");
|
||||
QTest::addColumn<QStringList>("nameFilters");
|
||||
QTest::addColumn<int>("rowCount");
|
||||
#if !defined(Q_OS_WINCE)
|
||||
QTest::newRow("no dirs") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs) << QStringList() << 2;
|
||||
QTest::newRow("no dirs - dot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 1;
|
||||
QTest::newRow("no dirs - dotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 1;
|
||||
@ -576,30 +564,6 @@ void tst_QFileSystemModel::filters_data()
|
||||
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive) << (QStringList() << "a") << 1;
|
||||
QTest::newRow("dir+files+hid+dot+cas+alldir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
|
||||
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive | QDir::AllDirs) << (QStringList() << "Z") << 1;
|
||||
#else
|
||||
QTest::qWait(3000); // We need to calm down a bit...
|
||||
QTest::newRow("no dirs") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs) << QStringList() << 0;
|
||||
QTest::newRow("no dirs - dot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 1;
|
||||
QTest::newRow("no dirs - dotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 1;
|
||||
QTest::newRow("no dirs - dotanddotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 0;
|
||||
QTest::newRow("one dir - dot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 2;
|
||||
QTest::newRow("one dir - dotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 2;
|
||||
QTest::newRow("one dir - dotanddotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 1;
|
||||
QTest::newRow("one dir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs) << QStringList() << 1;
|
||||
QTest::newRow("no dir + hidden") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::Hidden) << QStringList() << 0;
|
||||
QTest::newRow("dir+hid+files") << (QStringList() << "a" << "b" << "c") << QStringList() <<
|
||||
(int)(QDir::Dirs | QDir::Files | QDir::Hidden) << QStringList() << 3;
|
||||
QTest::newRow("dir+file+hid-dot .A") << (QStringList() << "a" << "b" << "c") << (QStringList() << ".A") <<
|
||||
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << QStringList() << 4;
|
||||
QTest::newRow("dir+files+hid+dot A") << (QStringList() << "a" << "b" << "c") << (QStringList() << "AFolder") <<
|
||||
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << (QStringList() << "A*") << 2;
|
||||
QTest::newRow("dir+files+hid+dot+cas1") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
|
||||
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive) << (QStringList() << "Z") << 1;
|
||||
QTest::newRow("dir+files+hid+dot+cas2") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
|
||||
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive) << (QStringList() << "a") << 1;
|
||||
QTest::newRow("dir+files+hid+dot+cas+alldir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
|
||||
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive | QDir::AllDirs) << (QStringList() << "Z") << 1;
|
||||
#endif
|
||||
|
||||
QTest::newRow("case sensitive") << (QStringList() << "Antiguagdb" << "Antiguamtd"
|
||||
<< "Antiguamtp" << "afghanistangdb" << "afghanistanmtd")
|
||||
@ -902,7 +866,7 @@ void tst_QFileSystemModel::caseSensitivity()
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
void tst_QFileSystemModel::Win32LongFileName()
|
||||
{
|
||||
QString tmp = flatDirTestPath;
|
||||
|
@ -395,11 +395,8 @@ void tst_QMessageBox::about()
|
||||
QVERIFY(closeHelper.done());
|
||||
#endif
|
||||
|
||||
#if !defined(Q_OS_WINCE)
|
||||
const int keyToSend = Qt::Key_Enter;
|
||||
#else
|
||||
const keyToSend = Qt::Key_Escape;
|
||||
#endif
|
||||
|
||||
closeHelper.start(keyToSend);
|
||||
QMessageBox::aboutQt(0, "Caption");
|
||||
#ifdef Q_OS_MAC
|
||||
|
@ -51,9 +51,6 @@ class tst_QWizard : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
tst_QWizard();
|
||||
|
||||
private slots:
|
||||
void cleanup();
|
||||
void buttonText();
|
||||
@ -128,13 +125,6 @@ private slots:
|
||||
*/
|
||||
};
|
||||
|
||||
tst_QWizard::tst_QWizard()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QWizard::cleanup()
|
||||
{
|
||||
QVERIFY(QApplication::topLevelWidgets().isEmpty());
|
||||
@ -962,9 +952,6 @@ void tst_QWizard::setOption_IndependentPages()
|
||||
|
||||
void tst_QWizard::setOption_IgnoreSubTitles()
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
QSKIP("Skipped because of limited resources and potential crash. (Task: 166824)");
|
||||
#endif
|
||||
const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
|
||||
const int kPixels = (availableGeometry.width() + 500) / 1000;
|
||||
const int frame = 50 * kPixels;
|
||||
@ -1073,9 +1060,6 @@ void tst_QWizard::setOption_IgnoreSubTitles()
|
||||
|
||||
void tst_QWizard::setOption_ExtendedWatermarkPixmap()
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
QSKIP("Skipped because of limited resources and potential crash. (Task: 166824)");
|
||||
#endif
|
||||
QPixmap watermarkPixmap(200, 400);
|
||||
watermarkPixmap.fill(Qt::black);
|
||||
|
||||
@ -2062,10 +2046,6 @@ void tst_QWizard::combinations_data()
|
||||
|
||||
void tst_QWizard::combinations()
|
||||
{
|
||||
#ifdef Q_OS_WINCE
|
||||
QSKIP("Too much memory usage for testing on CE emulator");
|
||||
#endif
|
||||
|
||||
QFETCH(bool, ref);
|
||||
QFETCH(bool, testEquality);
|
||||
QFETCH(QList<Operation *>, operations);
|
||||
|
@ -5,10 +5,3 @@ QT += widgets widgets-private testlib
|
||||
QT += gui-private
|
||||
|
||||
SOURCES += tst_qpixmapfilter.cpp
|
||||
|
||||
wince {
|
||||
addFiles.files = noise.png
|
||||
addFiles.path = .
|
||||
DEPLOYMENT += addFiles
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,6 @@ class tst_QGraphicsGridLayout : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void initTestCase();
|
||||
void qgraphicsgridlayout_data();
|
||||
void qgraphicsgridlayout();
|
||||
void addItem_data();
|
||||
@ -294,16 +293,6 @@ Q_DECLARE_METATYPE(ItemList);
|
||||
|
||||
typedef QList<QSizeF> SizeList;
|
||||
|
||||
|
||||
// This will be called before the first test function is executed.
|
||||
// It is only called once.
|
||||
void tst_QGraphicsGridLayout::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QGraphicsGridLayout::qgraphicsgridlayout_data()
|
||||
{
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ QT += core-private gui-private
|
||||
SOURCES += tst_qgraphicsitem.cpp
|
||||
DEFINES += QT_NO_CAST_TO_ASCII
|
||||
|
||||
win32:!wince:!winrt: LIBS += -luser32
|
||||
win32:!winrt: LIBS += -luser32
|
||||
|
@ -59,7 +59,7 @@ Q_DECLARE_METATYPE(QPainterPath)
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
#include <windows.h>
|
||||
#define Q_CHECK_PAINTEVENTS \
|
||||
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
|
||||
@ -279,9 +279,6 @@ class tst_QGraphicsItem : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
void init();
|
||||
|
||||
private slots:
|
||||
void construction();
|
||||
void constructionWithParent();
|
||||
@ -481,13 +478,6 @@ private:
|
||||
QList<QGraphicsItem *> paintedItems;
|
||||
};
|
||||
|
||||
void tst_QGraphicsItem::init()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QGraphicsItem::construction()
|
||||
{
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
|
@ -272,9 +272,6 @@ public:
|
||||
// It is only called once.
|
||||
void tst_QGraphicsProxyWidget::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
// Disable menu animations to prevent the alpha widget from getting in the way
|
||||
// in actionsContextMenu().
|
||||
QApplication::setEffectEnabled(Qt::UI_AnimateMenu, false);
|
||||
@ -1571,7 +1568,7 @@ void tst_QGraphicsProxyWidget::resize_simple_data()
|
||||
QTest::addColumn<QSizeF>("size");
|
||||
|
||||
QTest::newRow("200, 200") << QSizeF(200, 200);
|
||||
#if !defined(Q_PROCESSOR_ARM) && !defined(Q_OS_WINCE)
|
||||
#if !defined(Q_PROCESSOR_ARM)
|
||||
QTest::newRow("1000, 1000") << QSizeF(1000, 1000);
|
||||
// Since 4.5, 10000x10000 runs out of memory.
|
||||
// QTest::newRow("10000, 10000") << QSizeF(10000, 10000);
|
||||
|
@ -4,18 +4,9 @@ QT += widgets widgets-private testlib
|
||||
QT += core-private gui-private
|
||||
SOURCES += tst_qgraphicsscene.cpp
|
||||
RESOURCES += images.qrc
|
||||
win32:!wince:!winrt: LIBS += -luser32
|
||||
win32:!winrt: LIBS += -luser32
|
||||
|
||||
!wince: DEFINES += SRCDIR=\\\"$$PWD\\\"
|
||||
DEFINES += SRCDIR=\\\"$$PWD\\\"
|
||||
DEFINES += QT_NO_CAST_TO_ASCII
|
||||
|
||||
wince* {
|
||||
rootFiles.files = Ash_European.jpg graphicsScene_selection.data
|
||||
rootFiles.path = .
|
||||
renderFiles.files = testData\\render\\*
|
||||
renderFiles.path = testData\\render
|
||||
DEPLOYMENT += rootFiles renderFiles
|
||||
DEFINES += SRCDIR=\\\".\\\"
|
||||
}
|
||||
|
||||
RESOURCES += testdata.qrc
|
||||
|
@ -28,9 +28,6 @@
|
||||
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#if defined(Q_OS_WINCE)
|
||||
#include <ceconfig.h>
|
||||
#endif
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtWidgets>
|
||||
@ -41,7 +38,7 @@
|
||||
#include "../../../shared/platforminputcontext.h"
|
||||
#include <private/qinputmethod_p.h>
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
#include <windows.h>
|
||||
#define Q_CHECK_PAINTEVENTS \
|
||||
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
|
||||
@ -170,7 +167,6 @@ class tst_QGraphicsScene : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public slots:
|
||||
void initTestCase();
|
||||
void cleanup();
|
||||
|
||||
private slots:
|
||||
@ -273,13 +269,6 @@ private slots:
|
||||
void taskQTBUG_16401_focusItem();
|
||||
};
|
||||
|
||||
void tst_QGraphicsScene::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QGraphicsScene::cleanup()
|
||||
{
|
||||
// ensure not even skipped tests with custom input context leave it dangling
|
||||
@ -1250,7 +1239,7 @@ void tst_QGraphicsScene::addText()
|
||||
|
||||
void tst_QGraphicsScene::removeItem()
|
||||
{
|
||||
#if (defined(Q_OS_WINCE) && !defined(GWES_ICONCURS)) || defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_ANDROID)
|
||||
QSKIP("No mouse cursor support");
|
||||
#endif
|
||||
QGraphicsScene scene;
|
||||
@ -1587,11 +1576,7 @@ void tst_QGraphicsScene::hoverEvents_siblings()
|
||||
|
||||
QGraphicsView view(&scene);
|
||||
view.setRenderHint(QPainter::Antialiasing, true);
|
||||
#if defined(Q_OS_WINCE)
|
||||
view.setMinimumSize(230, 200);
|
||||
#else
|
||||
view.setMinimumSize(400, 300);
|
||||
#endif
|
||||
view.rotate(10);
|
||||
view.scale(1.7, 1.7);
|
||||
view.show();
|
||||
@ -1660,11 +1645,7 @@ void tst_QGraphicsScene::hoverEvents_parentChild()
|
||||
|
||||
QGraphicsView view(&scene);
|
||||
view.setRenderHint(QPainter::Antialiasing, true);
|
||||
#if defined(Q_OS_WINCE)
|
||||
view.setMinimumSize(230, 200);
|
||||
#else
|
||||
view.setMinimumSize(400, 300);
|
||||
#endif
|
||||
view.rotate(10);
|
||||
view.scale(1.7, 1.7);
|
||||
view.show();
|
||||
|
@ -143,7 +143,6 @@ public:
|
||||
: platformName(QGuiApplication::platformName().toLower())
|
||||
{ }
|
||||
private slots:
|
||||
void initTestCase();
|
||||
void cleanup();
|
||||
void construction();
|
||||
void renderHints();
|
||||
@ -273,13 +272,6 @@ private:
|
||||
QString platformName;
|
||||
};
|
||||
|
||||
void tst_QGraphicsView::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QGraphicsView::cleanup()
|
||||
{
|
||||
// ensure not even skipped tests with custom input context leave it dangling
|
||||
@ -1383,20 +1375,9 @@ void tst_QGraphicsView::fitInView()
|
||||
items[0]->setTransform(QTransform().rotate(30), true);
|
||||
items[1]->setTransform(QTransform().rotate(-30), true);
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
//Is the standard scrollbar size
|
||||
int scrollbarSize = qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent) - 13;
|
||||
#endif
|
||||
|
||||
QGraphicsView view(&scene);
|
||||
view.setSceneRect(-400, -400, 800, 800);
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
//We need to take in account the scrollbar size for the WindowsMobilStyle
|
||||
view.setFixedSize(400 + scrollbarSize, 200 + scrollbarSize);
|
||||
#else
|
||||
view.setFixedSize(400, 200);
|
||||
#endif
|
||||
|
||||
view.showNormal();
|
||||
view.fitInView(scene.itemsBoundingRect(), Qt::IgnoreAspectRatio);
|
||||
@ -1810,11 +1791,7 @@ void tst_QGraphicsView::mapToScene()
|
||||
QGraphicsView view(&topLevel);
|
||||
view.setScene(&scene);
|
||||
view.setSceneRect(-500, -500, 1000, 1000);
|
||||
#if defined(Q_OS_WINCE)
|
||||
QSize viewSize(200,200);
|
||||
#else
|
||||
QSize viewSize(300,300);
|
||||
#endif
|
||||
|
||||
view.setFixedSize(viewSize);
|
||||
topLevel.show();
|
||||
@ -4528,9 +4505,6 @@ void tst_QGraphicsView::task253415_reconnectUpdateSceneOnSceneChanged()
|
||||
|
||||
void tst_QGraphicsView::task255529_transformationAnchorMouseAndViewportMargins()
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
QSKIP("Qt/CE does not implement mouse tracking at this point");
|
||||
#endif
|
||||
QGraphicsScene scene(-100, -100, 200, 200);
|
||||
scene.addRect(QRectF(-50, -50, 100, 100), QPen(Qt::black), QBrush(Qt::blue));
|
||||
|
||||
|
@ -1112,9 +1112,7 @@ void tst_QGraphicsWidget::initStyleOption()
|
||||
bool hasFocus = option.state & QStyle::State_HasFocus;
|
||||
QCOMPARE(hasFocus, focus);
|
||||
bool isUnderMouse = option.state & QStyle::State_MouseOver;
|
||||
#ifndef Q_OS_WINCE
|
||||
QCOMPARE(isUnderMouse, underMouse);
|
||||
#endif
|
||||
// if (layoutDirection != Qt::LeftToRight)
|
||||
//QEXPECT_FAIL("", "QApplicaiton::layoutDirection doesn't propagate to QGraphicsWidget", Continue);
|
||||
//QCOMPARE(option.direction, layoutDirection);
|
||||
@ -2938,8 +2936,8 @@ protected:
|
||||
|
||||
void tst_QGraphicsWidget::respectHFW()
|
||||
{
|
||||
#if defined(Q_OS_WINCE) || defined(Q_OS_MAC)
|
||||
QSKIP("This test is platform dependent, it fails on wince and mac. Please fix.");
|
||||
#if defined(Q_OS_DARWIN)
|
||||
QSKIP("This test is platform dependent, it fails on Apple platforms. Please fix.");
|
||||
#else
|
||||
QGraphicsScene scene;
|
||||
HFWWidget *window = new HFWWidget;
|
||||
|
@ -197,7 +197,6 @@ public:
|
||||
void basic_tests(TestView *view);
|
||||
|
||||
private slots:
|
||||
void initTestCase();
|
||||
void cleanup();
|
||||
void getSetCheck();
|
||||
void emptyModels_data();
|
||||
@ -356,13 +355,6 @@ void tst_QAbstractItemView::getSetCheck()
|
||||
QCOMPARE(16, obj1->autoScrollMargin());
|
||||
}
|
||||
|
||||
void tst_QAbstractItemView::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QAbstractItemView::cleanup()
|
||||
{
|
||||
QVERIFY(QApplication::topLevelWidgets().isEmpty());
|
||||
@ -1307,9 +1299,6 @@ void tst_QAbstractItemView::task250754_fontChange()
|
||||
|
||||
void tst_QAbstractItemView::task200665_itemEntered()
|
||||
{
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
QSKIP("On Windows Mobile the mouse tracking is unavailable at the moment");
|
||||
#endif
|
||||
//we test that view will emit entered
|
||||
//when the scrollbar move but not the mouse itself
|
||||
QStandardItemModel model(1000,1);
|
||||
|
@ -183,9 +183,6 @@ void tst_QColumnView::initTestCase()
|
||||
void tst_QColumnView::init()
|
||||
{
|
||||
qApp->setLayoutDirection(Qt::LeftToRight);
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QColumnView::rootIndex()
|
||||
|
@ -13,7 +13,7 @@ wince* {
|
||||
DEPLOYMENT += addit tests sourceFile
|
||||
}
|
||||
|
||||
android|wince {
|
||||
android {
|
||||
DEFINES += SRCDIR=\\\"./\\\"
|
||||
} else {
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
|
@ -575,7 +575,7 @@ void tst_QDirModel::filePath()
|
||||
model.setResolveSymlinks(false);
|
||||
QModelIndex index = model.index(SRCDIR "test.lnk");
|
||||
QVERIFY(index.isValid());
|
||||
#if !defined(Q_OS_WINCE) && !defined(Q_OS_ANDROID)
|
||||
#if !defined(Q_OS_ANDROID)
|
||||
QString path = SRCDIR;
|
||||
#else
|
||||
QString path = QFileInfo(SRCDIR).absoluteFilePath();
|
||||
|
@ -379,9 +379,6 @@ tst_QHeaderView::tst_QHeaderView()
|
||||
|
||||
void tst_QHeaderView::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
m_tableview = new QTableView();
|
||||
}
|
||||
|
||||
@ -552,11 +549,7 @@ void tst_QHeaderView::hidden()
|
||||
void tst_QHeaderView::stretch()
|
||||
{
|
||||
// Show before resize and setStretchLastSection
|
||||
#if defined(Q_OS_WINCE)
|
||||
QSize viewSize(200,300);
|
||||
#else
|
||||
QSize viewSize(500, 500);
|
||||
#endif
|
||||
view->resize(viewSize);
|
||||
view->setStretchLastSection(true);
|
||||
QCOMPARE(view->stretchLastSection(), true);
|
||||
@ -616,12 +609,6 @@ void tst_QHeaderView::sectionSize()
|
||||
QFETCH(int, lastVisibleSectionSize);
|
||||
QFETCH(int, persistentSectionSize);
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
// We test on a device with doubled pixels. Therefore we need to specify
|
||||
// different boundaries.
|
||||
initialDefaultSize = qMax(view->minimumSectionSize(), 30);
|
||||
#endif
|
||||
|
||||
// bounds check
|
||||
foreach (int val, boundsCheck)
|
||||
view->sectionSize(val);
|
||||
@ -691,13 +678,7 @@ void tst_QHeaderView::visualIndexAt_data()
|
||||
QTest::addColumn<QList<int> >("visual");
|
||||
|
||||
QList<int> coordinateList;
|
||||
#ifndef Q_OS_WINCE
|
||||
coordinateList << -1 << 0 << 31 << 91 << 99999;
|
||||
#else
|
||||
// We test on a device with doubled pixels. Therefore we need to specify
|
||||
// different boundaries.
|
||||
coordinateList << -1 << 0 << 33 << 97 << 99999;
|
||||
#endif
|
||||
|
||||
QTest::newRow("no hidden, no moved sections")
|
||||
<< QList<int>()
|
||||
@ -750,10 +731,6 @@ void tst_QHeaderView::visualIndexAt()
|
||||
|
||||
void tst_QHeaderView::length()
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
QFont font(QLatin1String("Tahoma"), 7);
|
||||
view->setFont(font);
|
||||
#endif
|
||||
view->setStretchLastSection(true);
|
||||
topLevel->show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(topLevel));
|
||||
|
@ -3,4 +3,4 @@ TARGET = tst_qitemdelegate
|
||||
QT += widgets testlib
|
||||
SOURCES += tst_qitemdelegate.cpp
|
||||
|
||||
win32:!wince:!winrt: LIBS += -luser32
|
||||
win32:!winrt: LIBS += -luser32
|
||||
|
@ -53,7 +53,7 @@
|
||||
|
||||
Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint)
|
||||
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
#include <windows.h>
|
||||
#define Q_CHECK_PAINTEVENTS \
|
||||
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
|
||||
|
@ -32,42 +32,13 @@
|
||||
#include "viewstotest.cpp"
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(Q_OS_UNIX)
|
||||
#if defined(Q_OS_UNIX) || defined(Q_OS_WIN)
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#include <time.h>
|
||||
#if defined(Q_OS_WINCE)
|
||||
#include <aygshell.h>
|
||||
#endif
|
||||
#define random rand
|
||||
#define srandom srand
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
#ifndef SPI_GETPLATFORMTYPE
|
||||
#define SPI_GETPLATFORMTYPE 257
|
||||
#endif
|
||||
|
||||
bool qt_wince_is_platform(const QString &platformString) {
|
||||
wchar_t tszPlatform[64];
|
||||
if (SystemParametersInfo(SPI_GETPLATFORMTYPE,
|
||||
sizeof(tszPlatform)/sizeof(*tszPlatform),tszPlatform,0))
|
||||
if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.utf16()), tszPlatform))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool qt_wince_is_pocket_pc() {
|
||||
return qt_wince_is_platform(QString::fromLatin1("PocketPC"));
|
||||
}
|
||||
|
||||
bool qt_wince_is_smartphone() {
|
||||
return qt_wince_is_platform(QString::fromLatin1("Smartphone"));
|
||||
}
|
||||
bool qt_wince_is_mobile() {
|
||||
return (qt_wince_is_smartphone() || qt_wince_is_pocket_pc());
|
||||
}
|
||||
#endif
|
||||
# define random rand
|
||||
# define srandom srand
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@ -305,10 +276,6 @@ void tst_QItemView::nonDestructiveBasicTest_data()
|
||||
*/
|
||||
void tst_QItemView::nonDestructiveBasicTest()
|
||||
{
|
||||
#ifdef Q_OS_WINCE
|
||||
QTest::qWait(400);
|
||||
#endif
|
||||
|
||||
QFETCH(QString, viewType);
|
||||
QFETCH(int, vscroll);
|
||||
QFETCH(int, hscroll);
|
||||
@ -476,11 +443,7 @@ void tst_QItemView::spider()
|
||||
view->setModel(treeModel);
|
||||
view->show();
|
||||
QVERIFY(QTest::qWaitForWindowActive(view));
|
||||
#if defined(Q_OS_WINCE)
|
||||
srandom(0);
|
||||
#else
|
||||
srandom(time(0));
|
||||
#endif
|
||||
touch(view->viewport(), Qt::NoModifier, Qt::Key_Left);
|
||||
touch(view->viewport(), Qt::ShiftModifier, Qt::Key_Enter);
|
||||
touch(view->viewport(), Qt::ControlModifier, Qt::Key_Backspace);
|
||||
|
@ -2,5 +2,5 @@ CONFIG += testcase
|
||||
TARGET = tst_qlistview
|
||||
QT += widgets gui-private widgets-private core-private testlib
|
||||
SOURCES += tst_qlistview.cpp
|
||||
win32:!wince:!winrt: LIBS += -luser32
|
||||
win32:!winrt: LIBS += -luser32
|
||||
linux*: CONFIG += insignificant_test # Crashes
|
||||
|
@ -45,13 +45,13 @@
|
||||
#include <QtWidgets/QStyledItemDelegate>
|
||||
#include <QtWidgets/QStyleFactory>
|
||||
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
# include <windows.h>
|
||||
# include <QtGui/QGuiApplication>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_WINCE)
|
||||
#if defined(Q_OS_WIN)
|
||||
static inline HWND getHWNDForWidget(const QWidget *widget)
|
||||
{
|
||||
QWindow *window = widget->windowHandle();
|
||||
@ -83,7 +83,6 @@ class tst_QListView : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void initTestCase();
|
||||
void cleanup();
|
||||
void getSetCheck();
|
||||
void noDelegate();
|
||||
@ -111,7 +110,7 @@ private slots:
|
||||
void scrollBarAsNeeded();
|
||||
void moveItems();
|
||||
void wordWrap();
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && WINVER >= 0x0500
|
||||
#if defined(Q_OS_WIN) && WINVER >= 0x0500
|
||||
void setCurrentIndexAfterAppendRowCrash();
|
||||
#endif
|
||||
void emptyItemSize();
|
||||
@ -292,13 +291,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void tst_QListView::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QListView::cleanup()
|
||||
{
|
||||
QVERIFY(QApplication::topLevelWidgets().isEmpty());
|
||||
@ -983,25 +975,6 @@ void tst_QListView::selection_data()
|
||||
<< QRect(300, 0, 1, 300) // selection rectangle
|
||||
<< IntList(); // expected items
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
// depending on whether the display is double-pixeld, we need
|
||||
// to click at a different position
|
||||
bool doubledSize = false;
|
||||
int dpi = GetDeviceCaps(GetDC(0), LOGPIXELSX);
|
||||
if ((dpi < 1000) && (dpi > 0)) {
|
||||
doubledSize = true;
|
||||
}
|
||||
QTest::newRow("select inside contents, (on viewport)")
|
||||
<< 35 // itemCount
|
||||
<< int(QListView::ListMode)
|
||||
<< int(QListView::TopToBottom)
|
||||
<< true // wrapping
|
||||
<< 0 // spacing
|
||||
<< QSize() // gridSize
|
||||
<< IntList() // hiddenRows
|
||||
<< QRect(doubledSize?350:175,doubledSize?550:275, 1, 1)// selection rectangle
|
||||
<< IntList(); // expected items
|
||||
#else
|
||||
QTest::newRow("select inside contents, (on viewport)")
|
||||
<< 35 // itemCount
|
||||
<< int(QListView::ListMode)
|
||||
@ -1012,7 +985,6 @@ void tst_QListView::selection_data()
|
||||
<< IntList() // hiddenRows
|
||||
<< QRect(175, 275, 1, 1) // selection rectangle
|
||||
<< IntList(); // expected items
|
||||
#endif
|
||||
|
||||
QTest::newRow("select a tall rect in LeftToRight flow, wrap items")
|
||||
<< 70 // itemCount
|
||||
@ -1137,17 +1109,7 @@ void tst_QListView::selection()
|
||||
v.setRowHidden(hiddenRows.at(j), true);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
// If the device is double-pixeled then the scrollbars become
|
||||
// 10 pixels wider than normal (Windows Style: 16, Windows Mobile Style: 26).
|
||||
// So we have to make the window slightly bigger to have the same count of
|
||||
// items in each row of the list view like in the other styles.
|
||||
static const int dpi = ::GetDeviceCaps(GetDC(0), LOGPIXELSX);
|
||||
if ((dpi < 1000) && (dpi > 0))
|
||||
v.resize(535,535);
|
||||
#else
|
||||
v.resize(525,525);
|
||||
#endif
|
||||
|
||||
topLevel.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
|
||||
@ -1449,7 +1411,7 @@ void tst_QListView::wordWrap()
|
||||
QTRY_COMPARE(lv.verticalScrollBar()->isVisible(), true);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
class SetCurrentIndexAfterAppendRowCrashDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -1490,7 +1452,7 @@ private:
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) && WINVER >= 0x0500
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && WINVER >= 0x0500
|
||||
// This test only makes sense on windows 2000 and higher.
|
||||
void tst_QListView::setCurrentIndexAfterAppendRowCrash()
|
||||
{
|
||||
|
@ -61,8 +61,6 @@ class tst_QTableView : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void initTestCase();
|
||||
|
||||
void getSetCheck();
|
||||
|
||||
void noDelegate();
|
||||
@ -519,13 +517,6 @@ public:
|
||||
QSize hint;
|
||||
};
|
||||
|
||||
void tst_QTableView::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QTableView::noDelegate()
|
||||
{
|
||||
QtTestTableModel model(3, 3);
|
||||
@ -3995,10 +3986,6 @@ void tst_QTableView::mouseWheel_data()
|
||||
|
||||
void tst_QTableView::mouseWheel()
|
||||
{
|
||||
#ifdef Q_OS_WINCE
|
||||
QSKIP("Since different Windows CE versions sport different taskbars, we skip this test");
|
||||
#endif
|
||||
|
||||
QFETCH(int, scrollMode);
|
||||
QFETCH(int, delta);
|
||||
QFETCH(int, horizontalPositon);
|
||||
|
@ -118,8 +118,6 @@ public slots:
|
||||
void selectionOrderTest();
|
||||
|
||||
private slots:
|
||||
void initTestCase();
|
||||
|
||||
void getSetCheck();
|
||||
|
||||
// one test per QTreeView property
|
||||
@ -390,13 +388,6 @@ public:
|
||||
mutable QMap<QModelIndex,QModelIndex> parentHash;
|
||||
};
|
||||
|
||||
void tst_QTreeView::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Testing get/set functions
|
||||
void tst_QTreeView::getSetCheck()
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ TESTDATA = ../test/test.pro ../tmp/README
|
||||
|
||||
!winrt {
|
||||
SUBPROGRAMS = desktopsettingsaware modal
|
||||
win32:!wince: SUBPROGRAMS += wincmdline
|
||||
win32:SUBPROGRAMS += wincmdline
|
||||
|
||||
for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
|
||||
}
|
||||
|
@ -52,10 +52,6 @@
|
||||
#include <QtWidgets/private/qapplication_p.h>
|
||||
#include <QtWidgets/QStyle>
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
#include <private/qhighdpiscaling_p.h>
|
||||
|
||||
@ -235,10 +231,6 @@ static char *argv0;
|
||||
tst_QApplication::tst_QApplication()
|
||||
: quitApplicationTriggered(false)
|
||||
{
|
||||
#ifdef Q_OS_WINCE
|
||||
// Clean up environment previously to launching test
|
||||
qputenv("QT_PLUGIN_PATH", QByteArray());
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QApplication::cleanup()
|
||||
@ -897,19 +889,8 @@ bool isPathListIncluded(const QStringList &l, const QStringList &r)
|
||||
#define QT_TST_QAPP_DEBUG
|
||||
void tst_QApplication::libraryPaths()
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
const QString testDir = QFileInfo(QFINDTESTDATA("test/test.pro")).absolutePath();
|
||||
QVERIFY(!testDir.isEmpty());
|
||||
#else // !Q_OS_WINCE
|
||||
// On Windows CE we need QApplication object to have valid
|
||||
// current Path. Therefore we need to identify it ourselves
|
||||
// here for the test.
|
||||
QFileInfo filePath;
|
||||
wchar_t module_name[MAX_PATH];
|
||||
GetModuleFileName(0, module_name, MAX_PATH);
|
||||
filePath = QString::fromWCharArray(module_name);
|
||||
const QString testDir = filePath.path() + "/test";
|
||||
#endif // Q_OS_WINCE
|
||||
{
|
||||
QApplication::setLibraryPaths(QStringList() << testDir);
|
||||
QCOMPARE(QApplication::libraryPaths(), (QStringList() << testDir));
|
||||
@ -1000,11 +981,7 @@ void tst_QApplication::libraryPaths()
|
||||
QString appDirPath = app.applicationDirPath();
|
||||
|
||||
app.addLibraryPath(appDirPath);
|
||||
#ifdef Q_OS_WINCE
|
||||
app.addLibraryPath(appDirPath + "/../..");
|
||||
#else
|
||||
app.addLibraryPath(appDirPath + "/..");
|
||||
#endif
|
||||
#ifdef QT_TST_QAPP_DEBUG
|
||||
qDebug() << "appDirPath" << appDirPath;
|
||||
qDebug() << "After adding appDirPath && appDirPath + /..:" << app.libraryPaths();
|
||||
@ -1044,15 +1021,9 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
|
||||
QByteArray nonExistentPath = "/nonexistent";
|
||||
QByteArray pluginPath = validPath + ':' + nonExistentPath;
|
||||
#elif defined(Q_OS_WIN)
|
||||
# ifdef Q_OS_WINCE
|
||||
QByteArray validPath = "/Temp";
|
||||
QByteArray nonExistentPath = "/nonexistent";
|
||||
QByteArray pluginPath = validPath + ';' + nonExistentPath;
|
||||
# else
|
||||
QByteArray validPath = "C:\\windows";
|
||||
QByteArray nonExistentPath = "Z:\\nonexistent";
|
||||
QByteArray pluginPath = validPath + ';' + nonExistentPath;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
{
|
||||
@ -1069,9 +1040,7 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
|
||||
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
|
||||
<< QDir(app.applicationDirPath()).canonicalPath()
|
||||
<< QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).canonicalPath();
|
||||
# ifdef Q_OS_WINCE
|
||||
expected = QSet<QString>::fromList(expected).toList();
|
||||
# endif
|
||||
|
||||
QVERIFY2(isPathListIncluded(app.libraryPaths(), expected),
|
||||
qPrintable("actual:\n - " + app.libraryPaths().join("\n - ") +
|
||||
"\nexpected:\n - " + expected.join("\n - ")));
|
||||
@ -1091,9 +1060,6 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
|
||||
QStringList()
|
||||
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
|
||||
<< app.applicationDirPath();
|
||||
# ifdef Q_OS_WINCE
|
||||
expected = QSet<QString>::fromList(expected).toList();
|
||||
# endif
|
||||
QVERIFY(isPathListIncluded(app.libraryPaths(), expected));
|
||||
|
||||
qputenv("QT_PLUGIN_PATH", QByteArray());
|
||||
@ -1479,10 +1445,6 @@ void tst_QApplication::desktopSettingsAware()
|
||||
}
|
||||
QVERIFY2(!path.isEmpty(), "Cannot locate desktopsettingsaware helper application");
|
||||
path += "desktopsettingsaware";
|
||||
#ifdef Q_OS_WINCE
|
||||
int argc = 0;
|
||||
QApplication tmpApp(argc, 0);
|
||||
#endif
|
||||
QProcess testProcess;
|
||||
testProcess.start(path);
|
||||
QVERIFY2(testProcess.waitForStarted(),
|
||||
|
@ -56,7 +56,6 @@ class tst_QGridLayout : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void initTestCase();
|
||||
void cleanup();
|
||||
void getItemPosition();
|
||||
void itemAtPosition();
|
||||
@ -85,13 +84,6 @@ private slots:
|
||||
void dontCrashWhenExtendsToEnd();
|
||||
};
|
||||
|
||||
void tst_QGridLayout::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int visibleTopLevelWidgetCount()
|
||||
{
|
||||
int result= 0;
|
||||
@ -603,19 +595,6 @@ void tst_QGridLayout::spacingsAndMargins_data()
|
||||
<< QPoint( 20, child_offset_y)
|
||||
<< QPoint( 20, child_offset_y + 100 + 6)
|
||||
);
|
||||
#if defined (Q_OS_WINCE) //There is not enough screenspace to run the test in original size on Windows CE. We use smaller widgets.
|
||||
child_offset_y = 11 + 9 + 50 + 6 + 50 + 6 + 50 + 6;
|
||||
QTest::newRow("1x3 grid") << 1 << 3 << QSize(50, 50)
|
||||
<< (PointList() // toplevel
|
||||
<< QPoint( 11, 11)
|
||||
<< QPoint( 11, 11 + 50 + 6)
|
||||
<< QPoint( 11, 11 + 50 + 6 + 50 + 6)
|
||||
// children
|
||||
<< QPoint( 20, child_offset_y)
|
||||
<< QPoint( 20, child_offset_y + 50 + 6)
|
||||
<< QPoint( 20, child_offset_y + 50 + 6 + 50 + 6)
|
||||
);
|
||||
#else
|
||||
child_offset_y = 11 + 9 + 100 + 6 + 100 + 6 + 100 + 6;
|
||||
QTest::newRow("1x3 grid") << 1 << 3 << QSize(100, 100)
|
||||
<< (PointList() // toplevel
|
||||
@ -627,7 +606,6 @@ void tst_QGridLayout::spacingsAndMargins_data()
|
||||
<< QPoint( 20, child_offset_y + 100 + 6)
|
||||
<< QPoint( 20, child_offset_y + 100 + 6 + 100 + 6)
|
||||
);
|
||||
#endif
|
||||
|
||||
child_offset_y = 11 + 9 + 100 + 6 + 100 + 6;
|
||||
QTest::newRow("2x2 grid") << 2 << 2 << QSize(100, 100)
|
||||
|
@ -4,13 +4,7 @@ TARGET = tst_qlayout
|
||||
QT += widgets widgets-private testlib
|
||||
|
||||
SOURCES += tst_qlayout.cpp
|
||||
wince* {
|
||||
addFiles.files = baseline
|
||||
addFiles.path = .
|
||||
DEPLOYMENT += addFiles
|
||||
} else {
|
||||
TESTDATA += baseline/*
|
||||
}
|
||||
TESTDATA += baseline/*
|
||||
|
||||
android {
|
||||
RESOURCES += \
|
||||
|
@ -20,4 +20,4 @@ x11 {
|
||||
LIBS += $$QMAKE_LIBS_X11
|
||||
}
|
||||
|
||||
win32:!wince:!winrt: LIBS += -luser32 -lgdi32
|
||||
win32:!winrt: LIBS += -luser32 -lgdi32
|
||||
|
@ -75,7 +75,7 @@
|
||||
|
||||
#include <QtTest/QTest>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#if defined(Q_OS_WIN) && !Q_OS_WINRT
|
||||
# include <QtCore/qt_windows.h>
|
||||
# include <QtGui/private/qguiapplication_p.h>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
@ -91,49 +91,12 @@ static HWND winHandleOf(const QWidget *w)
|
||||
return 0;
|
||||
}
|
||||
|
||||
# ifdef Q_OS_WINCE
|
||||
# define Q_CHECK_PAINTEVENTS
|
||||
# ifdef Q_OS_WINCE_WM
|
||||
# include <qguifunctions_wince.h>
|
||||
// taken from qguifunctions_wce.cpp
|
||||
# define SPI_GETPLATFORMTYPE 257
|
||||
static bool qt_wince_is_platform(const QString &platformString) {
|
||||
wchar_t tszPlatform[64];
|
||||
if (SystemParametersInfo(SPI_GETPLATFORMTYPE,
|
||||
sizeof(tszPlatform)/sizeof(*tszPlatform),tszPlatform,0))
|
||||
if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.utf16()), tszPlatform))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
static inline bool qt_wince_is_smartphone() { return qt_wince_is_platform(QString::fromLatin1("Smartphone")); }
|
||||
# endif // Q_OS_WINCE_WM
|
||||
# elif !defined(Q_OS_WINRT) // Q_OS_WINCE
|
||||
# define Q_CHECK_PAINTEVENTS \
|
||||
# define Q_CHECK_PAINTEVENTS \
|
||||
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
|
||||
QSKIP("desktop is not visible, this test would fail");
|
||||
# else // !Q_OS_WINCE && !Q_OS_WINRT
|
||||
# define Q_CHECK_PAINTEVENTS
|
||||
# endif // Q_OS_WINRT
|
||||
#else // Q_OS_WIN
|
||||
|
||||
#else // Q_OS_WIN && !Q_OS_WINRT
|
||||
# define Q_CHECK_PAINTEVENTS
|
||||
#endif // else Q_OS_WIN
|
||||
|
||||
|
||||
#if defined(Q_OS_WINCE_WM)
|
||||
#include <qguifunctions_wince.h>
|
||||
// taken from qguifunctions_wce.cpp
|
||||
#define SPI_GETPLATFORMTYPE 257
|
||||
bool qt_wince_is_platform(const QString &platformString) {
|
||||
wchar_t tszPlatform[64];
|
||||
if (SystemParametersInfo(SPI_GETPLATFORMTYPE,
|
||||
sizeof(tszPlatform)/sizeof(*tszPlatform),tszPlatform,0))
|
||||
if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.utf16()), tszPlatform))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
bool qt_wince_is_smartphone() {
|
||||
return qt_wince_is_platform(QString::fromLatin1("Smartphone"));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
@ -163,7 +126,7 @@ static inline void centerOnScreen(QWidget *w)
|
||||
w->move(QGuiApplication::primaryScreen()->availableGeometry().center() - offset);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
static inline void setWindowsAnimationsEnabled(bool enabled)
|
||||
{
|
||||
ANIMATIONINFO animation = { sizeof(ANIMATIONINFO), enabled };
|
||||
@ -176,10 +139,10 @@ static inline bool windowsAnimationsEnabled()
|
||||
SystemParametersInfo(SPI_GETANIMATION, 0, &animation, 0);
|
||||
return animation.iMinAnimate;
|
||||
}
|
||||
#else // Q_OS_WIN && !Q_OS_WINCE && !Q_OS_WINRT
|
||||
#else // Q_OS_WIN && !Q_OS_WINRT
|
||||
inline void setWindowsAnimationsEnabled(bool) {}
|
||||
static inline bool windowsAnimationsEnabled() { return false; }
|
||||
#endif // !Q_OS_WIN || Q_OS_WINCE || Q_OS_WINRT
|
||||
#endif // !Q_OS_WIN || Q_OS_WINRT
|
||||
|
||||
template <class T>
|
||||
static QByteArray msgComparisonFailed(T v1, const char *op, T v2)
|
||||
@ -251,9 +214,7 @@ private slots:
|
||||
void hideWhenFocusWidgetIsChild();
|
||||
void normalGeometry();
|
||||
void setGeometry();
|
||||
#ifndef Q_OS_WINCE
|
||||
void windowOpacity();
|
||||
#endif
|
||||
void raise();
|
||||
void lower();
|
||||
void stackUnder();
|
||||
@ -315,7 +276,7 @@ private slots:
|
||||
|
||||
void subtractOpaqueSiblings();
|
||||
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
void setGeometry_win();
|
||||
#endif
|
||||
|
||||
@ -340,9 +301,7 @@ private slots:
|
||||
void render_task188133();
|
||||
void render_task211796();
|
||||
void render_task217815();
|
||||
#ifndef Q_OS_WINCE
|
||||
void render_windowOpacity();
|
||||
#endif
|
||||
void render_systemClip();
|
||||
void render_systemClip2_data();
|
||||
void render_systemClip2();
|
||||
@ -358,9 +317,7 @@ private slots:
|
||||
|
||||
void repaintWhenChildDeleted();
|
||||
void hideOpaqueChildWhileHidden();
|
||||
#if !defined(Q_OS_WINCE)
|
||||
void updateWhileMinimized();
|
||||
#endif
|
||||
void alienWidgets();
|
||||
void adjustSize();
|
||||
void adjustSize_data();
|
||||
@ -408,9 +365,7 @@ private slots:
|
||||
void toplevelLineEditFocus();
|
||||
|
||||
void focusWidget_task254563();
|
||||
#ifndef Q_OS_WINCE_WM
|
||||
void rectOutsideCoordinatesLimit_task144779();
|
||||
#endif
|
||||
void setGraphicsEffect();
|
||||
|
||||
#ifdef QT_BUILD_INTERNAL
|
||||
@ -613,7 +568,7 @@ void tst_QWidget::getSetCheck()
|
||||
QCOMPARE(true, obj1.autoFillBackground());
|
||||
|
||||
var1.reset();
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
obj1.setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint);
|
||||
const HWND handle = reinterpret_cast<HWND>(obj1.winId()); // explicitly create window handle
|
||||
QVERIFY(GetWindowLong(handle, GWL_STYLE) & WS_POPUP);
|
||||
@ -657,9 +612,6 @@ private:
|
||||
|
||||
void tst_QWidget::initTestCase()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
// Size of reference widget, 200 for < 2000, scale up for larger screens
|
||||
// to avoid Windows warnings about minimum size for decorated windows.
|
||||
int width = 200;
|
||||
@ -1507,7 +1459,7 @@ void tst_QWidget::mapFromAndTo()
|
||||
subWindow2->setGeometry(75, 75, 100, 100);
|
||||
subSubWindow->setGeometry(10, 10, 10, 10);
|
||||
|
||||
#if !defined(Q_OS_WINCE) && !defined(Q_OS_QNX)
|
||||
#if !defined(Q_OS_QNX)
|
||||
//update visibility
|
||||
if (windowMinimized) {
|
||||
if (!windowHidden) {
|
||||
@ -1820,15 +1772,8 @@ void tst_QWidget::activation()
|
||||
{
|
||||
Q_CHECK_PAINTEVENTS
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
int waitTime = 1000;
|
||||
#else
|
||||
int waitTime = 100;
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
qApp->processEvents();
|
||||
#endif
|
||||
QWidget widget1;
|
||||
widget1.setObjectName("activation-Widget1");
|
||||
widget1.setWindowTitle(widget1.objectName());
|
||||
@ -1876,10 +1821,6 @@ void tst_QWidget::windowState()
|
||||
size = QGuiApplication::primaryScreen()->size();
|
||||
} else {
|
||||
pos = QPoint(10, 10);
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
if (qt_wince_is_smartphone()) { //small screen
|
||||
size = QSize(100,100);
|
||||
#endif
|
||||
}
|
||||
|
||||
QWidget widget1;
|
||||
@ -2407,11 +2348,7 @@ void tst_QWidget::reparent()
|
||||
childTLW.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&parent));
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
parent.move(50, 50);
|
||||
#else
|
||||
parent.move(parentPosition);
|
||||
#endif
|
||||
|
||||
QPoint childPos = parent.mapToGlobal(child.pos());
|
||||
QPoint tlwPos = childTLW.pos();
|
||||
@ -2618,8 +2555,6 @@ void tst_QWidget::setGeometry()
|
||||
QCOMPARE(tlw.geometry(), tr);
|
||||
}
|
||||
|
||||
// Windows CE does not support windowOpacity.
|
||||
#ifndef Q_OS_WINCE
|
||||
void tst_QWidget::windowOpacity()
|
||||
{
|
||||
QWidget widget;
|
||||
@ -2650,7 +2585,6 @@ void tst_QWidget::windowOpacity()
|
||||
child.setWindowOpacity(-1.0);
|
||||
QCOMPARE(child.windowOpacity(), 1.0);
|
||||
}
|
||||
#endif
|
||||
|
||||
class UpdateWidget : public QWidget
|
||||
{
|
||||
@ -2970,9 +2904,6 @@ void tst_QWidget::stackUnder()
|
||||
foreach (UpdateWidget *child, allChildren) {
|
||||
int expectedZOrderChangeEvents = child == child1 ? 1 : 0;
|
||||
if (child == child3) {
|
||||
#ifdef Q_OS_WINCE
|
||||
qApp->processEvents();
|
||||
#endif
|
||||
#ifndef Q_OS_MAC
|
||||
QEXPECT_FAIL(0, "See QTBUG-493", Continue);
|
||||
#endif
|
||||
@ -3342,9 +3273,6 @@ void tst_QWidget::widgetAt()
|
||||
w2->setMask(rgn);
|
||||
qApp->processEvents();
|
||||
QTest::qWait(10);
|
||||
#if defined(Q_OS_WINCE)
|
||||
QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
|
||||
#endif
|
||||
|
||||
QTRY_VERIFY((wr = QApplication::widgetAt(testPos)));
|
||||
QTRY_COMPARE(wr->objectName(), w1->objectName());
|
||||
@ -3360,9 +3288,6 @@ void tst_QWidget::widgetAt()
|
||||
w2->setMask(bitmap);
|
||||
qApp->processEvents();
|
||||
QTest::qWait(10);
|
||||
#if defined(Q_OS_WINCE)
|
||||
QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
|
||||
#endif
|
||||
QTRY_COMPARE(QApplication::widgetAt(testPos), w1.data());
|
||||
QTRY_VERIFY(QApplication::widgetAt(testPos + QPoint(1, 1)) == w2.data());
|
||||
}
|
||||
@ -3698,7 +3623,7 @@ void tst_QWidget::optimizedResize_topLevel()
|
||||
topLevel.partial = false;
|
||||
topLevel.paintedRegion = QRegion();
|
||||
|
||||
#if !defined(Q_OS_WIN32) && !defined(Q_OS_WINCE)
|
||||
#if !defined(Q_OS_WIN32)
|
||||
topLevel.resize(topLevel.size() + QSize(10, 10));
|
||||
#else
|
||||
// Static contents does not work when programmatically resizing
|
||||
@ -3769,7 +3694,6 @@ void tst_QWidget::setMinimumSize()
|
||||
|
||||
// Setting a minimum size larger than the desktop does not work on WinCE,
|
||||
// so skip this part of the test.
|
||||
#ifndef Q_OS_WINCE
|
||||
QSize nonDefaultSize = defaultSize + QSize(5,5);
|
||||
w.setMinimumSize(nonDefaultSize);
|
||||
w.showNormal();
|
||||
@ -3778,7 +3702,6 @@ void tst_QWidget::setMinimumSize()
|
||||
msgComparisonFailed(w.height(), ">=", nonDefaultSize.height()));
|
||||
QVERIFY2(w.width() >= nonDefaultSize.width(),
|
||||
msgComparisonFailed(w.width(), ">=", nonDefaultSize.width()));
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QWidget::setMaximumSize()
|
||||
@ -4714,7 +4637,7 @@ void tst_QWidget::setWindowGeometry()
|
||||
}
|
||||
}
|
||||
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
void tst_QWidget::setGeometry_win()
|
||||
{
|
||||
QWidget widget;
|
||||
@ -4735,7 +4658,7 @@ void tst_QWidget::setGeometry_win()
|
||||
QVERIFY2(rt.top <= m_availableTopLeft.y(),
|
||||
msgComparisonFailed(int(rt.top), "<=", m_availableTopLeft.y()));
|
||||
}
|
||||
#endif // defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
|
||||
#endif // defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
|
||||
// Since X11 WindowManager operation are all async, and we have no way to know if the window
|
||||
// manager has finished playing with the window geometry, this test can't be reliable on X11.
|
||||
@ -5060,12 +4983,8 @@ void tst_QWidget::moveChild()
|
||||
parent.setStyle(QStyleFactory::create(QLatin1String("Windows")));
|
||||
ColorWidget child(&parent, Qt::Widget, Qt::blue);
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
parent.setGeometry(QRect(QPoint(QApplication::desktop()->availableGeometry(&parent).topLeft()) + QPoint(50, 50),
|
||||
QSize(200, 200)));
|
||||
#else
|
||||
parent.setGeometry(60, 60, 150, 150);
|
||||
#endif
|
||||
child.setGeometry(25, 25, 50, 50);
|
||||
#ifndef QT_NO_CURSOR // Try to make sure the cursor is not in a taskbar area to prevent tooltips or window highlighting
|
||||
QCursor::setPos(parent.geometry().topRight() + QPoint(50 , 50));
|
||||
@ -5646,8 +5565,6 @@ void tst_QWidget::setToolTip()
|
||||
QCOMPARE(widget.toolTip(), QString());
|
||||
QCOMPARE(spy.count(), 2);
|
||||
|
||||
// Mouse over doesn't work on Windows mobile, so skip the rest of the test for that platform.
|
||||
#ifndef Q_OS_WINCE_WM
|
||||
for (int pass = 0; pass < 2; ++pass) {
|
||||
QCursor::setPos(0, 0);
|
||||
QScopedPointer<QWidget> popup(new QWidget(0, Qt::Popup));
|
||||
@ -5675,7 +5592,6 @@ void tst_QWidget::setToolTip()
|
||||
QTest::qWait(2200); // delay is 2000
|
||||
QTest::mouseMove(popupWindow);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QWidget::testWindowIconChangeEventPropagation()
|
||||
@ -6754,7 +6670,6 @@ void tst_QWidget::render_task217815()
|
||||
}
|
||||
|
||||
// Window Opacity is not supported on Windows CE.
|
||||
#ifndef Q_OS_WINCE
|
||||
void tst_QWidget::render_windowOpacity()
|
||||
{
|
||||
const qreal opacity = 0.5;
|
||||
@ -6827,7 +6742,6 @@ void tst_QWidget::render_windowOpacity()
|
||||
QCOMPARE(result, expected);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QWidget::render_systemClip()
|
||||
{
|
||||
@ -7285,14 +7199,10 @@ void tst_QWidget::repaintWhenChildDeleted()
|
||||
}
|
||||
#endif
|
||||
ColorWidget w(0, Qt::FramelessWindowHint, Qt::red);
|
||||
#if !defined(Q_OS_WINCE)
|
||||
QPoint startPoint = QApplication::desktop()->availableGeometry(&w).topLeft();
|
||||
startPoint.rx() += 50;
|
||||
startPoint.ry() += 50;
|
||||
w.setGeometry(QRect(startPoint, QSize(100, 100)));
|
||||
#else
|
||||
w.setGeometry(60, 60, 110, 110);
|
||||
#endif
|
||||
w.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&w));
|
||||
QTest::qWait(10);
|
||||
@ -7316,14 +7226,10 @@ void tst_QWidget::repaintWhenChildDeleted()
|
||||
void tst_QWidget::hideOpaqueChildWhileHidden()
|
||||
{
|
||||
ColorWidget w(0, Qt::FramelessWindowHint, Qt::red);
|
||||
#if !defined(Q_OS_WINCE)
|
||||
QPoint startPoint = QApplication::desktop()->availableGeometry(&w).topLeft();
|
||||
startPoint.rx() += 50;
|
||||
startPoint.ry() += 50;
|
||||
w.setGeometry(QRect(startPoint, QSize(100, 100)));
|
||||
#else
|
||||
w.setGeometry(60, 60, 110, 110);
|
||||
#endif
|
||||
|
||||
ColorWidget child(&w, Qt::Widget, Qt::blue);
|
||||
child.setGeometry(10, 10, 80, 80);
|
||||
@ -7352,7 +7258,6 @@ void tst_QWidget::hideOpaqueChildWhileHidden()
|
||||
}
|
||||
|
||||
// This test doesn't make sense without support for showMinimized().
|
||||
#if !defined(Q_OS_WINCE)
|
||||
void tst_QWidget::updateWhileMinimized()
|
||||
{
|
||||
if (m_platform == QStringLiteral("wayland"))
|
||||
@ -7390,7 +7295,6 @@ void tst_QWidget::updateWhileMinimized()
|
||||
QTRY_COMPARE(widget.numPaintEvents, 1);
|
||||
QCOMPARE(widget.paintedRegion, QRegion(0, 0, 50, 50));
|
||||
}
|
||||
#endif
|
||||
|
||||
class PaintOnScreenWidget: public QWidget
|
||||
{
|
||||
@ -7757,13 +7661,6 @@ void tst_QWidget::adjustSize()
|
||||
QVERIFY2(child->size().height() < sizeHint.height(),
|
||||
msgComparisonFailed(child->size().height(), "<", sizeHint.height()));
|
||||
} else {
|
||||
#if defined (Q_OS_WINCE)
|
||||
if (!haveParent) {
|
||||
const QRect& desktopRect = qApp->desktop()->availableGeometry();
|
||||
expectedSize.setWidth(qMin(expectedSize.width(), desktopRect.width()));
|
||||
expectedSize.setHeight(qMin(expectedSize.height(), desktopRect.height()));
|
||||
}
|
||||
#endif
|
||||
QCOMPARE(child->size(), expectedSize);
|
||||
}
|
||||
if (!haveParent)
|
||||
@ -9169,7 +9066,6 @@ QWidgetBackingStore* backingStore(QWidget &widget)
|
||||
}
|
||||
|
||||
// Tables of 5000 elements do not make sense on Windows Mobile.
|
||||
#ifndef Q_OS_WINCE_WM
|
||||
void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
|
||||
{
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
@ -9211,7 +9107,6 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
|
||||
QApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QWidget::setGraphicsEffect()
|
||||
{
|
||||
|
@ -3,12 +3,6 @@ TARGET = tst_qstyle
|
||||
QT += widgets testlib
|
||||
SOURCES += tst_qstyle.cpp
|
||||
|
||||
wince* {
|
||||
addPixmap.files = task_25863.png
|
||||
addPixmap.path = .
|
||||
DEPLOYMENT += addPixmap
|
||||
}
|
||||
|
||||
android {
|
||||
RESOURCES += \
|
||||
testdata.qrc
|
||||
|
@ -56,20 +56,6 @@
|
||||
#include <qlineedit.h>
|
||||
#include <qmdiarea.h>
|
||||
#include <qscrollarea.h>
|
||||
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
#include <windows.h>
|
||||
|
||||
static bool qt_wince_is_smartphone() {
|
||||
wchar_t tszPlatform[64];
|
||||
if (SystemParametersInfo(SPI_GETPLATFORMTYPE,
|
||||
sizeof(tszPlatform)/sizeof(*tszPlatform),tszPlatform,0))
|
||||
if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (QString::fromLatin1("Smartphone").utf16()), tszPlatform))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <qwidget.h>
|
||||
|
||||
// Make a widget frameless to prevent size constraints of title bars
|
||||
@ -90,7 +76,7 @@ public:
|
||||
|
||||
private:
|
||||
bool testAllFunctions(QStyle *);
|
||||
bool testScrollBarSubControls(QStyle *);
|
||||
bool testScrollBarSubControls();
|
||||
void testPainting(QStyle *style, const QString &platform);
|
||||
private slots:
|
||||
void drawItemPixmap();
|
||||
@ -108,12 +94,6 @@ private slots:
|
||||
#endif
|
||||
#ifdef Q_OS_MAC
|
||||
void testMacStyle();
|
||||
#endif
|
||||
#ifdef Q_OS_WINCE
|
||||
void testWindowsCEStyle();
|
||||
#endif
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
void testWindowsMobileStyle();
|
||||
#endif
|
||||
void testStyleFactory();
|
||||
void testProxyStyle();
|
||||
@ -314,19 +294,11 @@ bool tst_QStyle::testAllFunctions(QStyle *style)
|
||||
style->itemPixmapRect(QRect(0, 0, 100, 100), Qt::AlignHCenter, QPixmap(200, 200));
|
||||
style->itemTextRect(QFontMetrics(qApp->font()), QRect(0, 0, 100, 100), Qt::AlignHCenter, true, QString("Test"));
|
||||
|
||||
return testScrollBarSubControls(style);
|
||||
return testScrollBarSubControls();
|
||||
}
|
||||
|
||||
bool tst_QStyle::testScrollBarSubControls(QStyle* style)
|
||||
bool tst_QStyle::testScrollBarSubControls()
|
||||
{
|
||||
// WinCE SmartPhone doesn't have scrollbar subcontrols, so skip the rest of the test.
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
if (style->inherits("QWindowsMobileStyle") && qt_wince_is_smartphone())
|
||||
return true;
|
||||
#else
|
||||
Q_UNUSED(style);
|
||||
#endif
|
||||
|
||||
QScrollBar scrollBar;
|
||||
setFrameless(&scrollBar);
|
||||
scrollBar.show();
|
||||
@ -521,26 +493,6 @@ void tst_QStyle::testMacStyle()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
// WindowsCEStyle style
|
||||
void tst_QStyle::testWindowsCEStyle()
|
||||
{
|
||||
QStyle *cstyle = QStyleFactory::create("WindowsCE");
|
||||
QVERIFY(testAllFunctions(cstyle));
|
||||
delete cstyle;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WINCE_WM
|
||||
// WindowsMobileStyle style
|
||||
void tst_QStyle::testWindowsMobileStyle()
|
||||
{
|
||||
QStyle *cstyle = QStyleFactory::create("WindowsMobile");
|
||||
QVERIFY(testAllFunctions(cstyle));
|
||||
delete cstyle;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Helper class...
|
||||
|
||||
MyWidget::MyWidget( QWidget* parent, const char* name )
|
||||
|
@ -12,5 +12,5 @@ SUBDIRS=\
|
||||
!mac:SUBDIRS -= \
|
||||
qmacstyle \
|
||||
|
||||
ios|android|qnx|wince: SUBDIRS -= \
|
||||
ios|android|qnx: SUBDIRS -= \
|
||||
qstylesheetstyle \
|
||||
|
@ -585,10 +585,7 @@ void tst_QCompleter::directoryModel_data()
|
||||
if (i == 1)
|
||||
QTest::newRow("FILTERING_OFF") << "FILTERING_OFF" << "" << "" << "";
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
QTest::newRow("()") << "" << "" << "/" << "/";
|
||||
QTest::newRow("()") << "\\Program" << "" << "Program Files" << "\\Program Files";
|
||||
#elif defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_WIN)
|
||||
QTest::newRow("()") << "C" << "" << "C:" << "C:";
|
||||
QTest::newRow("()") << "C:\\Program" << "" << "Program Files" << "C:\\Program Files";
|
||||
#elif defined (Q_OS_MAC)
|
||||
@ -634,10 +631,7 @@ void tst_QCompleter::fileSystemModel_data()
|
||||
if (i == 1)
|
||||
QTest::newRow("FILTERING_OFF") << "FILTERING_OFF" << "" << "" << "";
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
QTest::newRow("()") << "" << "" << "/" << "/";
|
||||
QTest::newRow("()") << "\\Program" << "" << "Program Files" << "\\Program Files";
|
||||
#elif defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_WIN)
|
||||
QTest::newRow("()") << "C" << "" << "C:" << "C:";
|
||||
QTest::newRow("()") << "C:\\Program" << "" << "Program Files" << "C:\\Program Files";
|
||||
#elif defined (Q_OS_MAC)
|
||||
|
@ -107,9 +107,6 @@ void tst_QSystemTrayIcon::getSetCheck()
|
||||
void tst_QSystemTrayIcon::supportsMessages()
|
||||
{
|
||||
// ### fixme: Check platforms.
|
||||
#if defined(Q_OS_WINCE)
|
||||
QCOMPARE(QSystemTrayIcon::supportsMessages(), false);
|
||||
#else
|
||||
const QString platform = QGuiApplication::platformName();
|
||||
if (platform.compare(QStringLiteral("xcb"), Qt::CaseInsensitive)
|
||||
&& platform.compare(QStringLiteral("windows"), Qt::CaseInsensitive)
|
||||
@ -117,7 +114,6 @@ void tst_QSystemTrayIcon::supportsMessages()
|
||||
QEXPECT_FAIL("", "QTBUG-20978 QSystemTrayIcon is unimplemented for this platform", Abort);
|
||||
}
|
||||
QCOMPARE(QSystemTrayIcon::supportsMessages(), true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QSystemTrayIcon::lastWindowClosed()
|
||||
|
@ -78,9 +78,6 @@ class tst_QComboBox : public QObject
|
||||
public:
|
||||
tst_QComboBox() {}
|
||||
|
||||
public slots:
|
||||
void init();
|
||||
|
||||
private slots:
|
||||
void getSetCheck();
|
||||
void ensureReturnIsIgnored();
|
||||
@ -395,13 +392,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
void tst_QComboBox::init()
|
||||
{
|
||||
#ifdef Q_OS_WINCE //disable magic for WindowsCE
|
||||
qApp->setAutoMaximizeThreshold(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QComboBox::setEditable()
|
||||
{
|
||||
TestWidget topLevel;
|
||||
@ -2752,7 +2742,7 @@ void tst_QComboBox::keyBoardNavigationWithMouse()
|
||||
QCOMPARE(combo.currentText(), QLatin1String("0"));
|
||||
|
||||
// When calling cursor function, Windows CE responds with: This function is not supported on this system.
|
||||
#if !defined Q_OS_WINCE && !defined Q_OS_QNX
|
||||
#if !defined Q_OS_QNX
|
||||
// Force cursor movement to prevent QCursor::setPos() from returning prematurely on QPA:
|
||||
centerCursor(combo.view());
|
||||
QTest::qWait(200);
|
||||
|
@ -2,5 +2,3 @@ CONFIG += testcase
|
||||
TARGET = tst_qdatetimeedit
|
||||
QT += widgets testlib core-private widgets-private
|
||||
SOURCES += tst_qdatetimeedit.cpp
|
||||
|
||||
wincewm50smart-msvc2005: DEFINES += WINCE_NO_MODIFIER_KEYS
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user