Skip to content

Commit

Permalink
Merge branch 'master' of [email protected]:qt/qt
Browse files Browse the repository at this point in the history
  • Loading branch information
Gunnar Sletta committed Aug 21, 2009
2 parents fc82b17 + 078f3ec commit 8feda9e
Show file tree
Hide file tree
Showing 469 changed files with 24,240 additions and 38,009 deletions.
74 changes: 70 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ QMAKE_VARS_FILE=.qmake.vars
# utility functions
#-------------------------------------------------------------------------------

shellEscape()
{
echo "$@" | sed 's/ /\ /g'
}

# Adds a new qmake variable to the cache
# Usage: QMakeVar mode varname contents
# where mode is one of: set, add, del
Expand Down Expand Up @@ -89,6 +94,29 @@ getQMakeConf()
{ print }' "$tmpSPEC/qmake.conf"
}

# relies on $TEST_COMPILER being set correctly
compilerSupportsFlag()
{
cat >conftest.cpp <<EOF
int main() { return 0; }
EOF
"$TEST_COMPILER" "$@" -o /dev/null conftest.cpp
ret=$?
rm -f conftest.cpp conftest.o
return $?
}

# relies on $TEST_COMPILER being set correctly
linkerSupportsFlag()
{
lflags=-Wl
for flag; do
safe_flag=`shellEscape "$flag"`
lflags=$lflags,$safe_flag
done
compilerSupportsFlag "$lflags"
}

#-------------------------------------------------------------------------------
# operating system detection
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -563,6 +591,7 @@ MIN_DBUS_1_VERSION=0.62
CFG_CONFIGURE_EXIT_ON_ERROR=yes
CFG_PROFILE=no
CFG_EXCEPTIONS=unspecified
CFG_SCRIPT=auto # (yes|no|auto)
CFG_SCRIPTTOOLS=auto # (yes|no|auto)
CFG_XMLPATTERNS=auto # (yes|no|auto)
CFG_INCREMENTAL=auto
Expand Down Expand Up @@ -850,7 +879,7 @@ while [ "$#" -gt 0 ]; do
VAL=no
;;
#Qt style yes options
-incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-svg|-webkit|-scripttools|-rpath|-force-pkg-config)
-incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-svg|-webkit|-script|-scripttools|-rpath|-force-pkg-config)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
VAL=yes
;;
Expand Down Expand Up @@ -1749,6 +1778,17 @@ while [ "$#" -gt 0 ]; do
fi
fi
;;
script)
if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
CFG_SCRIPT="yes"
else
if [ "$VAL" = "no" ]; then
CFG_SCRIPT="no"
else
UNKNOWN_OPT=yes
fi
fi
;;
scripttools)
if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
CFG_SCRIPTTOOLS="yes"
Expand Down Expand Up @@ -3165,7 +3205,7 @@ Usage: $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir
[-no-openssl] [-openssl] [-openssl-linked]
[-no-multimedia] [-multimedia]
[-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit]
[-no-scripttools] [-scripttools]
[-no-script] [-script] [-no-scripttools] [-scripttools]
[additional platform specific options (see below)]
Expand Down Expand Up @@ -3314,6 +3354,9 @@ fi
+ -webkit ............ Build the WebKit module.
WebKit is built if a decent C++ compiler is used.
-no-script ......... Do not build the QtScript module.
+ -script ............ Build the QtScript module.
-no-scripttools .... Do not build the QtScriptTools module.
+ -scripttools ....... Build the QtScriptTools module.
Expand Down Expand Up @@ -6297,13 +6340,28 @@ else
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WEBKIT"
fi

if [ "$CFG_SCRIPTTOOLS" = "auto" ]; then
if [ "$CFG_SCRIPT" = "auto" ]; then
CFG_SCRIPT="$canBuildWebKit"
fi

if [ "$CFG_SCRIPT" = "yes" ]; then
QT_CONFIG="$QT_CONFIG script"
else
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SCRIPT"
fi

if [ "$CFG_SCRIPTTOOLS" = "yes" -a "$CFG_SCRIPT" = "no" ]; then
echo "QtScriptTools was requested, but it can't be built due to QtScript being disabled."
exit 1
fi
if [ "$CFG_SCRIPTTOOLS" = "auto" -a "$CFG_SCRIPT" != "no" ]; then
CFG_SCRIPTTOOLS="yes"
elif [ "$CFG_SCRIPT" = "no" ]; then
CFG_SCRIPTTOOLS="no"
fi

if [ "$CFG_SCRIPTTOOLS" = "yes" ]; then
QT_CONFIG="$QT_CONFIG scripttools"
CFG_SCRIPTTOOLS="yes"
else
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SCRIPTTOOLS"
fi
Expand Down Expand Up @@ -6978,6 +7036,13 @@ QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib
EOF

# Ensure we can link to uninistalled libraries
if linkerSupportsFlag -rpath-link "$outpath/lib"; then
echo "QMAKE_LFLAGS += -Wl,-rpath-link,\$\$QT_BUILD_TREE/lib" >> "$CACHEFILE.tmp"
elif linkerSupportsFlag -rpath "$outpath/lib"; then
echo "QMAKE_LFLAGS += -Wl,-rpath,\$\$QT_BUILD_TREE/lib" >> "$CACHEFILE.tmp"
fi

if [ -n "$QT_CFLAGS_PSQL" ]; then
echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL" >> "$CACHEFILE.tmp"
fi
Expand Down Expand Up @@ -7172,6 +7237,7 @@ echo "Qt 3 compatibility .. $CFG_QT3SUPPORT"
[ "$CFG_DBUS" = "yes" ] && echo "QtDBus module ....... yes (run-time)"
[ "$CFG_DBUS" = "linked" ] && echo "QtDBus module ....... yes (linked)"
echo "QtConcurrent code.... $CFG_CONCURRENT"
echo "QtScript module ..... $CFG_SCRIPT"
echo "QtScriptTools module $CFG_SCRIPTTOOLS"
echo "QtXmlPatterns module $CFG_XMLPATTERNS"
echo "Phonon module ....... $CFG_PHONON"
Expand Down
Binary file modified configure.exe
Binary file not shown.
36 changes: 35 additions & 1 deletion demos/browser/networkaccessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,21 @@
#include <QtNetwork/QAuthenticator>
#include <QtNetwork/QNetworkDiskCache>
#include <QtNetwork/QNetworkProxy>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QSslError>

NetworkAccessManager::NetworkAccessManager(QObject *parent)
: QNetworkAccessManager(parent)
: QNetworkAccessManager(parent),
requestFinishedCount(0), requestFinishedFromCacheCount(0), requestFinishedPipelinedCount(0),
requestFinishedSecureCount(0)
{
connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
connect(this, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)),
SLOT(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)));
connect(this, SIGNAL(finished(QNetworkReply *)),
SLOT(requestFinished(QNetworkReply *)));
#ifndef QT_NO_OPENSSL
connect(this, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)),
SLOT(sslErrors(QNetworkReply*, const QList<QSslError>&)));
Expand All @@ -79,6 +84,35 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent)
setCache(diskCache);
}

QNetworkReply* NetworkAccessManager::createRequest(Operation op, const QNetworkRequest & req, QIODevice * outgoingData)
{
QNetworkRequest request = req; // copy so we can modify
// this is a temporary hack until we properly use the pipelining flags from QtWebkit
// pipeline everything! :)
request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
return QNetworkAccessManager::createRequest(op, request, outgoingData);
}

void NetworkAccessManager::requestFinished(QNetworkReply *reply)
{
requestFinishedCount++;

if (reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool() == true)
requestFinishedFromCacheCount++;

if (reply->attribute(QNetworkRequest::HttpPipeliningWasUsedAttribute).toBool() == true)
requestFinishedPipelinedCount++;

if (reply->attribute(QNetworkRequest::ConnectionEncryptedAttribute).toBool() == true)
requestFinishedSecureCount++;

double pctCached = (double(requestFinishedFromCacheCount) * 100.0/ double(requestFinishedCount));
double pctPipelined = (double(requestFinishedPipelinedCount) * 100.0/ double(requestFinishedCount));
double pctSecure = (double(requestFinishedSecureCount) * 100.0/ double(requestFinishedCount));
qDebug("%lli requests [%3.2f%% from cache] [%3.2f%% pipelined] [%3.2f%% SSL/TLS]", requestFinishedCount, pctCached, pctPipelined, pctSecure);

}

void NetworkAccessManager::loadSettings()
{
QSettings settings;
Expand Down
8 changes: 8 additions & 0 deletions demos/browser/networkaccessmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#define NETWORKACCESSMANAGER_H

#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>

class NetworkAccessManager : public QNetworkAccessManager
{
Expand All @@ -51,11 +52,18 @@ class NetworkAccessManager : public QNetworkAccessManager
public:
NetworkAccessManager(QObject *parent = 0);

virtual QNetworkReply* createRequest ( Operation op, const QNetworkRequest & req, QIODevice * outgoingData = 0 );

private:
QList<QString> sslTrustedHostList;
qint64 requestFinishedCount;
qint64 requestFinishedFromCacheCount;
qint64 requestFinishedPipelinedCount;
qint64 requestFinishedSecureCount;

public slots:
void loadSettings();
void requestFinished(QNetworkReply *reply);

private slots:
void authenticationRequired(QNetworkReply *reply, QAuthenticator *auth);
Expand Down
2 changes: 1 addition & 1 deletion demos/sub-attaq/submarine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ SubMarine::SubMarine(int type, const QString &name, int points, QGraphicsItem *

graphicsRotation = new QGraphicsRotation(this);
graphicsRotation->setAxis(QVector3D(0, 1, 0));
graphicsRotation->setOrigin(QPointF(size().width()/2, size().height()/2));
graphicsRotation->setOrigin(QVector3D(size().width()/2, size().height()/2, 0));
QList<QGraphicsTransform *> r;
r.append(graphicsRotation);
setTransformations(r);
Expand Down
2 changes: 1 addition & 1 deletion dist/changes-4.6.0
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ information about a particular change.
of (non-unicode) Windows 9x/ME support.

- QRegion is no longer a GDI object by default. This means it is no
longer subjuect to gui-thread only nor does it potentially impact
longer subject to gui-thread only nor does it potentially impact
the 10.000 GDI object limit per process. By explicitly calling
.handle() a GDI object will be created and memory managed by
QRegion. The native handle is for reading out only. Any GDI calls
Expand Down
6 changes: 2 additions & 4 deletions doc/src/examples/qtscriptcalculator.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@

\snippet examples/script/calculator/calculator.js 1

The digitClicked() function uses the special local variable
__qt_sender__ to access the object that triggered the signal;
this gives us a simple way to retrieve the value of the digit
that was clicked.
The digitClicked() function is called when a digit button is
clicked, with the input digit as argument.

\snippet examples/script/calculator/calculator.js 2

Expand Down
38 changes: 0 additions & 38 deletions doc/src/scripting/scripting.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -1224,44 +1224,6 @@
for it, evaluate the script, and finally restore the old context.
\endlist

\section2 Nested Functions and the Scope Chain

This is an advanced topic; feel free to skip it.

A nested function can be used to "capture" the execution context in which a
nested function object is created; this is typically referred to as creating
a \e closure. When, at some later time, the nested function is invoked, it
can access the variables that were created when the enclosing function was
invoked. This can perhaps best be illustrated through a small example:

\snippet doc/src/snippets/code/doc_src_qtscript.qdoc 70

The \c{counter()} function initializes a local variable to zero,
and returns a nested function. The nested function increments
the "outer" variable and returns its new value. The variable
persists over function calls, as shown in the following example:

\snippet doc/src/snippets/code/doc_src_qtscript.qdoc 71

The \c{counter()} function can be implemented as a native function, too
\mdash or rather, as a pair of native functions: One for the outer and
one for the inner. The definition of the outer function is as follows:

\snippet doc/src/snippets/code/doc_src_qtscript.qdoc 72

The function creates a local variable and initializes it to zero.
Then it wraps the inner native function, and sets the scope of
the resulting function object to be the activation object associated
with this (the outer) function call. The inner function accesses
the "outer" activation through the scope of the callee:

\snippet doc/src/snippets/code/doc_src_qtscript.qdoc 73

It is also possible to have a hybrid approach, where the outer function
is a native function and the inner function is defined by a script:

\snippet doc/src/snippets/code/doc_src_qtscript.qdoc 74

\section2 Property Getters and Setters

A script object property can be defined in terms of a getter/setter
Expand Down
2 changes: 1 addition & 1 deletion examples/examples.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ SUBDIRS = \
widgets \
uitools \
xml \
script \
multitouch \
gestures

contains(QT_CONFIG, script): SUBDIRS += script
contains(QT_CONFIG, multimedia):!static: SUBDIRS += multimedia
contains(QT_CONFIG, phonon):!static: SUBDIRS += phonon
contains(QT_CONFIG, webkit): SUBDIRS += webkit
Expand Down
14 changes: 14 additions & 0 deletions examples/graphicsview/anchorlayout/anchorlayout.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
######################################################################
# Automatically generated by qmake (2.01a) Tue May 12 15:22:25 2009
######################################################################

# Input
SOURCES += main.cpp

# install
target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/anchorlayout
sources.files = $$SOURCES $$HEADERS $$RESOURCES anchorlayout.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/anchorlayout
INSTALLS += target sources

TARGET = anchorlayout_example
Loading

0 comments on commit 8feda9e

Please sign in to comment.