summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-12-15 13:16:24 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-12-15 13:16:24 (GMT)
commit1c1d3e79e1b7cb2cdffaee38a98bc777e3a7b961 (patch)
tree5c33473950b22db0a0eb9c230005cd8e7f251538 /tools
parentcace8e6a9f00ee478dfe63a7fa6959056cfe7e8a (diff)
parent0c6780c39d18a4fd06b9bed94400de365a518c45 (diff)
downloadQt-1c1d3e79e1b7cb2cdffaee38a98bc777e3a7b961.zip
Qt-1c1d3e79e1b7cb2cdffaee38a98bc777e3a7b961.tar.gz
Qt-1c1d3e79e1b7cb2cdffaee38a98bc777e3a7b961.tar.bz2
Merge branch '4.7' into mimir
Diffstat (limited to 'tools')
-rw-r--r--tools/configure/configureapp.cpp2
-rw-r--r--tools/linguist/linguist/messagemodel.cpp7
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h3
-rw-r--r--tools/qml/browser/Browser.qml2
-rw-r--r--tools/qml/deviceorientation.h4
-rw-r--r--tools/qml/main.cpp56
-rw-r--r--tools/qml/qdeclarativetester.cpp16
-rw-r--r--tools/qml/qdeclarativetester.h4
-rw-r--r--tools/qml/qml.pro4
-rw-r--r--tools/qml/qmlruntime.cpp4
-rw-r--r--tools/qml/startup/startup.qml6
11 files changed, 60 insertions, 48 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 050ad62..c967dad 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -1029,6 +1029,8 @@ void Configure::parseCmdLine()
if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
dictionary[ "QT_INSTALL_PLUGINS" ] =
QString("\\resource\\qt%1\\plugins").arg(dictionary[ "QT_LIBINFIX" ]);
+ dictionary[ "QT_INSTALL_IMPORTS" ] =
+ QString("\\resource\\qt%1\\imports").arg(dictionary[ "QT_LIBINFIX" ]);
}
} else if (configCmdLine.at(i) == "-D") {
++i;
diff --git a/tools/linguist/linguist/messagemodel.cpp b/tools/linguist/linguist/messagemodel.cpp
index 39ba9fd..c2edc75 100644
--- a/tools/linguist/linguist/messagemodel.cpp
+++ b/tools/linguist/linguist/messagemodel.cpp
@@ -209,6 +209,13 @@ bool DataModel::load(const QString &fileName, bool *langGuessed, QWidget *parent
return false;
}
+ if (!tor.messageCount()) {
+ QMessageBox::warning(parent, QObject::tr("Qt Linguist"),
+ tr("The translation file '%1' will not be loaded because it is empty.")
+ .arg(Qt::escape(fileName)));
+ return false;
+ }
+
Translator::Duplicates dupes = tor.resolveDuplicates();
if (!dupes.byId.isEmpty() || !dupes.byContents.isEmpty()) {
QString err = tr("<qt>Duplicate messages found in '%1':").arg(Qt::escape(fileName));
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
index d47c829..6df3c22 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
@@ -181,6 +181,9 @@ public:
This function needs to be called *before* any widget/content is created.
When called with true, the base window surface will be translucent and initialized
with QGLFormat.alpha == true.
+
+ This function is *deprecated*. Set Qt::WA_TranslucentBackground attribute
+ on the top-level widget *before* you show it instead.
*/
static void setTranslucent(bool translucent);
};
diff --git a/tools/qml/browser/Browser.qml b/tools/qml/browser/Browser.qml
index b9573da..968d077 100644
--- a/tools/qml/browser/Browser.qml
+++ b/tools/qml/browser/Browser.qml
@@ -173,7 +173,7 @@ Rectangle {
width: parent.width
model: folders1
delegate: folderDelegate
- highlight: Rectangle {
+ highlight: Rectangle {
color: palette.highlight
visible: root.showFocusHighlight && view1.count != 0
gradient: Gradient {
diff --git a/tools/qml/deviceorientation.h b/tools/qml/deviceorientation.h
index 487ebd4..88ceb1b 100644
--- a/tools/qml/deviceorientation.h
+++ b/tools/qml/deviceorientation.h
@@ -52,8 +52,8 @@ class DeviceOrientation : public QObject
Q_OBJECT
Q_ENUMS(Orientation)
public:
- enum Orientation {
- UnknownOrientation,
+ enum Orientation {
+ UnknownOrientation,
Portrait,
Landscape,
PortraitInverted,
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 209c72f..b9513b9 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -59,6 +59,19 @@ QtMsgHandler systemMsgOutput = 0;
static QDeclarativeViewer *openFile(const QString &fileName);
static void showViewer(QDeclarativeViewer *viewer);
+QString warnings;
+void exitApp(int i)
+{
+#ifdef Q_OS_WIN
+ // Debugging output is not visible by default on Windows -
+ // therefore show modal dialog with errors instead.
+ if (!warnings.isEmpty()) {
+ QMessageBox::warning(0, QApplication::tr("Qt QML Viewer"), warnings);
+ }
+#endif
+ exit(i);
+}
+
#if defined (Q_OS_SYMBIAN)
#include <unistd.h>
#include <sys/types.h>
@@ -85,31 +98,22 @@ void myMessageOutput(QtMsgType type, const char *msg)
QWeakPointer<LoggerWidget> logger;
-QString warnings;
-void showWarnings()
-{
- if (!warnings.isEmpty()) {
- int argc = 0; char **argv = 0;
- QApplication application(argc, argv); // QApplication() in main has been destroyed already.
- Q_UNUSED(application)
- QMessageBox::warning(0, QApplication::tr("Qt QML Viewer"), warnings);
- }
-}
-
static QAtomicInt recursiveLock(0);
void myMessageOutput(QtMsgType type, const char *msg)
{
QString strMsg = QString::fromLatin1(msg);
- if (!logger.isNull() && !QCoreApplication::closingDown()) {
- if (recursiveLock.testAndSetOrdered(0, 1)) {
- QMetaObject::invokeMethod(logger.data(), "append", Q_ARG(QString, strMsg));
- recursiveLock = 0;
+ if (!QCoreApplication::closingDown()) {
+ if (!logger.isNull()) {
+ if (recursiveLock.testAndSetOrdered(0, 1)) {
+ QMetaObject::invokeMethod(logger.data(), "append", Q_ARG(QString, strMsg));
+ recursiveLock = 0;
+ }
+ } else {
+ warnings += strMsg;
+ warnings += QLatin1Char('\n');
}
- } else {
- warnings += strMsg;
- warnings += QLatin1Char('\n');
}
if (systemMsgOutput) { // Windows
systemMsgOutput(type, msg);
@@ -165,7 +169,8 @@ void usage()
qWarning(" ");
qWarning(" Press F1 for interactive help");
- exit(1);
+
+ exitApp(1);
}
void scriptOptsUsage()
@@ -184,7 +189,8 @@ void scriptOptsUsage()
qWarning(" saveonexit ............................... save recording on viewer exit");
qWarning(" ");
qWarning(" One of record, play or both must be specified.");
- exit(1);
+
+ exitApp(1);
}
enum WarningsConfig { ShowWarnings, HideWarnings, DefaultWarnings };
@@ -370,7 +376,7 @@ static void parseCommandLineOptions(const QStringList &arguments)
qApp->setStartDragDistance(arguments.at(++i).toInt());
} else if (arg == QLatin1String("-v") || arg == QLatin1String("-version")) {
qWarning("Qt QML Viewer version %s", QT_VERSION_STR);
- exit(0);
+ exitApp(0);
} else if (arg == "-translation") {
if (lastArg) usage();
opts.translationFile = arguments.at(++i);
@@ -400,7 +406,7 @@ static void parseCommandLineOptions(const QStringList &arguments)
QDeclarativeEngine tmpEngine;
QString paths = tmpEngine.importPathList().join(QLatin1String(":"));
qWarning("Current search path: %s", paths.toLocal8Bit().constData());
- exit(0);
+ exitApp(0);
}
opts.imports << arguments.at(++i);
} else if (arg == "-P") {
@@ -529,12 +535,6 @@ int main(int argc, char ** argv)
systemMsgOutput = qInstallMsgHandler(myMessageOutput);
#endif
-#if defined (Q_OS_WIN)
- // Debugging output is not visible by default on Windows -
- // therefore show modal dialog with errors instead.
- atexit(showWarnings);
-#endif
-
#if defined (Q_WS_X11) || defined (Q_WS_MAC)
//### default to using raster graphics backend for now
bool gsSpecified = false;
diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp
index e3a1f59..1bcdb04 100644
--- a/tools/qml/qdeclarativetester.cpp
+++ b/tools/qml/qdeclarativetester.cpp
@@ -54,9 +54,9 @@ QT_BEGIN_NAMESPACE
extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled;
-QDeclarativeTester::QDeclarativeTester(const QString &script, QDeclarativeViewer::ScriptOptions opts,
+QDeclarativeTester::QDeclarativeTester(const QString &script, QDeclarativeViewer::ScriptOptions opts,
QDeclarativeView *parent)
-: QAbstractAnimation(parent), m_script(script), m_view(parent), filterEvents(true), options(opts),
+: QAbstractAnimation(parent), m_script(script), m_view(parent), filterEvents(true), options(opts),
testscript(0), hasCompleted(false), hasFailed(false)
{
parent->viewport()->installEventFilter(this);
@@ -75,8 +75,8 @@ QDeclarativeTester::QDeclarativeTester(const QString &script, QDeclarativeViewer
QDeclarativeTester::~QDeclarativeTester()
{
- if (!hasFailed &&
- options & QDeclarativeViewer::Record &&
+ if (!hasFailed &&
+ options & QDeclarativeViewer::Record &&
options & QDeclarativeViewer::SaveOnExit)
save();
}
@@ -228,7 +228,7 @@ void QDeclarativeTester::save()
}
ts << " }\n";
- while (!mouseevents.isEmpty() &&
+ while (!mouseevents.isEmpty() &&
mouseevents.first().msec == fe.msec) {
MouseEvent me = mouseevents.takeFirst();
@@ -345,7 +345,7 @@ void QDeclarativeTester::updateCurrentTime(int msec)
if (QDeclarativeVisualTestFrame *frame = qobject_cast<QDeclarativeVisualTestFrame *>(event)) {
if (frame->msec() < msec) {
if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) {
- qWarning() << "QDeclarativeTester(" << m_script << "): Extra frame. Seen:"
+ qWarning() << "QDeclarativeTester(" << m_script << "): Extra frame. Seen:"
<< msec << "Expected:" << frame->msec();
imagefailure();
}
@@ -371,7 +371,7 @@ void QDeclarativeTester::updateCurrentTime(int msec)
}
if (goodImage != img) {
QString reject(frame->image().toLocalFile() + ".reject.png");
- qWarning() << "QDeclarativeTester(" << m_script << "): Image mismatch. Reject saved to:"
+ qWarning() << "QDeclarativeTester(" << m_script << "): Image mismatch. Reject saved to:"
<< reject;
img.save(reject);
bool doDiff = (goodImage.size() == img.size());
@@ -424,7 +424,7 @@ void QDeclarativeTester::updateCurrentTime(int msec)
ke.destination = ViewPort;
}
m_savedKeyEvents.append(ke);
- }
+ }
testscriptidx++;
}
diff --git a/tools/qml/qdeclarativetester.h b/tools/qml/qdeclarativetester.h
index 0cf508a..6fdf495 100644
--- a/tools/qml/qdeclarativetester.h
+++ b/tools/qml/qdeclarativetester.h
@@ -122,7 +122,7 @@ public:
int type() const { return m_type; }
void setType(int t) { m_type = t; }
-
+
int button() const { return m_button; }
void setButton(int b) { m_button = b; }
@@ -237,7 +237,7 @@ private:
struct MouseEvent {
MouseEvent(QMouseEvent *e)
- : type(e->type()), button(e->button()), buttons(e->buttons()),
+ : type(e->type()), button(e->button()), buttons(e->buttons()),
pos(e->pos()), modifiers(e->modifiers()), destination(View) {}
QEvent::Type type;
diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro
index 3927dd6..bdac6e3 100644
--- a/tools/qml/qml.pro
+++ b/tools/qml/qml.pro
@@ -4,7 +4,7 @@ DESTDIR = ../../bin
include(qml.pri)
-SOURCES += main.cpp
+SOURCES += main.cpp
INCLUDEPATH += ../../include/QtDeclarative
INCLUDEPATH += ../../src/declarative/util
@@ -26,7 +26,7 @@ wince* {
QT += xmlpatterns
}
contains(QT_CONFIG, webkit) {
- QT += webkit
+ QT += webkit
}
}
maemo5 {
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index a368bc1..142e4c5 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -820,7 +820,7 @@ void QDeclarativeViewer::createMenu()
fileMenu->addAction(reloadAction);
fileMenu->addSeparator();
fileMenu->addAction(closeAction);
-#if !defined(Q_OS_SYMBIAN)
+#if !defined(Q_OS_SYMBIAN)
fileMenu->addAction(quitAction);
QMenu *recordMenu = menu->addMenu(tr("&Recording"));
@@ -836,7 +836,7 @@ void QDeclarativeViewer::createMenu()
settingsMenu->addAction(proxyAction);
#if defined(Q_OS_SYMBIAN)
settingsMenu->addAction(fullscreenAction);
-#else
+#else
settingsMenu->addAction(recordOptions);
settingsMenu->addMenu(loggerWindow->preferencesMenu());
#endif // !Q_OS_SYMBIAN
diff --git a/tools/qml/startup/startup.qml b/tools/qml/startup/startup.qml
index 9ca50a3..35c44c2 100644
--- a/tools/qml/startup/startup.qml
+++ b/tools/qml/startup/startup.qml
@@ -92,8 +92,8 @@ Rectangle {
to: 360
loops: NumberAnimation.Infinite
running: true
- duration: 2000
- }
+ duration: 2000
+ }
}
}
}
@@ -168,6 +168,6 @@ Rectangle {
}
}
}
- ]
+ ]
} // treatsApp