Merge remote-tracking branch 'origin/dev' into stable
Change-Id: Ice524edcc51373509f0023ae7f7c2963f4602f88
57
config.tests/qpa/direct2d/direct2d.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the config.tests 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 Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <d3d11_1.h>
|
||||
#include <d2d1_1.h>
|
||||
#include <d2d1_1helper.h>
|
||||
#include <dxgi1_2.h>
|
||||
#include <wrl.h>
|
||||
#include <dwrite.h>
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
ComPtr<ID2D1Factory1> d2dFactory;
|
||||
D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, d2dFactory.ReleaseAndGetAddressOf());
|
||||
|
||||
return 0;
|
||||
}
|
4
config.tests/qpa/direct2d/direct2d.pro
Normal file
@ -0,0 +1,4 @@
|
||||
SOURCES = direct2d.cpp
|
||||
LIBS += -ld2d1 -ldwrite -ld3d11
|
||||
CONFIG -= qt
|
||||
CONFIG += console
|
62
config.tests/qpa/egl-x11/egl-x11.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the config.tests 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 Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <xcb/xcb.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xlib-xcb.h>
|
||||
|
||||
// Check if EGL is compatible with X. Some EGL implementations, typically on
|
||||
// embedded devices, are not intended to be used together with X. EGL support
|
||||
// has to be disabled in plugins like xcb in this case since the native display,
|
||||
// window and pixmap types will be different than what an X-based platform
|
||||
// plugin would expect.
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
Display *dpy = EGL_DEFAULT_DISPLAY;
|
||||
EGLNativeDisplayType egldpy = XOpenDisplay("");
|
||||
dpy = egldpy;
|
||||
EGLNativeWindowType w = XCreateWindow(dpy, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
XDestroyWindow(dpy, w);
|
||||
XCloseDisplay(dpy);
|
||||
return 0;
|
||||
}
|
12
config.tests/qpa/egl-x11/egl-x11.pro
Normal file
@ -0,0 +1,12 @@
|
||||
SOURCES = egl-x11.cpp
|
||||
|
||||
for(p, QMAKE_LIBDIR_EGL) {
|
||||
exists($$p):LIBS += -L$$p
|
||||
}
|
||||
|
||||
!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL
|
||||
!isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL
|
||||
|
||||
CONFIG -= qt
|
||||
|
||||
LIBS += -lxcb -lX11 -lX11-xcb
|
@ -1,3 +1,3 @@
|
||||
SOURCES = iconv.cpp
|
||||
CONFIG -= qt dylib
|
||||
mac|win32-g++*|qnx:LIBS += -liconv
|
||||
mac|mingw|qnx:LIBS += -liconv
|
||||
|
48
config.tests/unix/journald/journald.c
Normal file
@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Jolla Ltd, author: <robin.burchell@jollamobile.com>
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the config.tests 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 Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <systemd/sd-journal.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
sd_journal_print_with_location(LOG_INFO, "CODE_FILE=foo.c", "CODE_LINE=0", "unknown_function", "test message");
|
||||
return 0;
|
||||
}
|
6
config.tests/unix/journald/journald.pro
Normal file
@ -0,0 +1,6 @@
|
||||
SOURCES = journald.c
|
||||
|
||||
CONFIG += link_pkgconfig
|
||||
PKGCONFIG_PRIVATE += libsystemd-journal
|
||||
|
||||
CONFIG -= qt
|
49
config.tests/unix/lgmon/lgmon.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
/***************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the config.tests 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 Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <lgmon.h>
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
lgmon_supported(getpid());
|
||||
return 0;
|
||||
}
|
||||
|
3
config.tests/unix/lgmon/lgmon.pro
Normal file
@ -0,0 +1,3 @@
|
||||
SOURCES = lgmon.cpp
|
||||
CONFIG -= qt
|
||||
LIBS += -llgmon
|
@ -1,4 +0,0 @@
|
||||
SOURCES = neon.cpp
|
||||
CONFIG -= x11 qt
|
||||
isEmpty(QMAKE_CFLAGS_NEON):error("This compiler does not support Neon")
|
||||
else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_NEON
|
@ -1,4 +1,4 @@
|
||||
SOURCES = odbc.cpp
|
||||
CONFIG -= qt dylib
|
||||
win32-g++*:LIBS += -lodbc32
|
||||
mingw:LIBS += -lodbc32
|
||||
else:LIBS += -lodbc
|
||||
|
@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the config.tests of the Qt Toolkit.
|
||||
@ -39,13 +39,10 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <arm_neon.h>
|
||||
#include "imf/imf_client.h"
|
||||
|
||||
int main(int, char**)
|
||||
int main(int, char **)
|
||||
{
|
||||
int32x4_t null = vdupq_n_s32(0x0);
|
||||
|
||||
int result;
|
||||
vst1q_lane_s32(&result, null, 0);
|
||||
return result;
|
||||
imf_client_init();
|
||||
return 0;
|
||||
}
|
3
config.tests/unix/qqnx_imf/qqnx_imf.pro
Normal file
@ -0,0 +1,3 @@
|
||||
SOURCES = qqnx_imf.cpp
|
||||
CONFIG -= qt
|
||||
LIBS += -linput_client
|
@ -7,5 +7,5 @@ for(p, QMAKE_LIBDIR_OPENGL) {
|
||||
}
|
||||
|
||||
CONFIG -= qt
|
||||
win32-g++*:LIBS += -lopengl32
|
||||
mingw:LIBS += -lopengl32
|
||||
else:LIBS += -lGL
|
||||
|
159
configure
vendored
@ -596,6 +596,7 @@ CFG_XINERAMA=runtime
|
||||
CFG_XFIXES=runtime
|
||||
CFG_ZLIB=auto
|
||||
CFG_MTDEV=auto
|
||||
CFG_JOURNALD=no
|
||||
CFG_SQLITE=qt
|
||||
CFG_GIF=auto
|
||||
CFG_PNG=yes
|
||||
@ -612,6 +613,7 @@ CFG_OPENVG_LC_INCLUDES=no
|
||||
CFG_OPENVG_SHIVA=auto
|
||||
CFG_OPENVG_ON_OPENGL=auto
|
||||
CFG_EGL=auto
|
||||
CFG_EGL_X=auto
|
||||
CFG_FONTCONFIG=auto
|
||||
CFG_FREETYPE=auto
|
||||
CFG_HARFBUZZ=no
|
||||
@ -630,6 +632,8 @@ CFG_PKGCONFIG=auto
|
||||
CFG_STACK_PROTECTOR_STRONG=auto
|
||||
CFG_SLOG2=auto
|
||||
CFG_PPS=auto
|
||||
CFG_QNX_IMF=auto
|
||||
CFG_LGMON=auto
|
||||
CFG_SYSTEM_PROXIES=no
|
||||
|
||||
# Target architecture
|
||||
@ -778,6 +782,8 @@ QT_LIBS_GLIB=
|
||||
|
||||
# default qpa platform
|
||||
QT_QPA_DEFAULT_PLATFORM=
|
||||
# default print support plugin
|
||||
QT_PRINTSUPPORT_DEFAULT_PLUGIN=
|
||||
|
||||
# Android vars
|
||||
CFG_DEFAULT_ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT
|
||||
@ -1471,6 +1477,7 @@ while [ "$#" -gt 0 ]; do
|
||||
egl)
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||
CFG_EGL="$VAL"
|
||||
CFG_EGL_X="$VAL"
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
@ -1551,13 +1558,6 @@ while [ "$#" -gt 0 ]; do
|
||||
iwmmxt)
|
||||
CFG_IWMMXT="yes"
|
||||
;;
|
||||
neon)
|
||||
if [ "$VAL" = "no" ]; then
|
||||
CFG_NEON="$VAL"
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
mips_dsp)
|
||||
if [ "$VAL" = "no" ]; then
|
||||
CFG_MIPS_DSP="$VAL"
|
||||
@ -1596,6 +1596,13 @@ while [ "$#" -gt 0 ]; do
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
journald)
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||
CFG_JOURNALD="$VAL"
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
sqlite)
|
||||
if [ "$VAL" = "system" ]; then
|
||||
CFG_SQLITE=system
|
||||
@ -1780,6 +1787,13 @@ while [ "$#" -gt 0 ]; do
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
imf)
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||
CFG_QNX_IMF="$VAL"
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
pps)
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||
CFG_PPS="$VAL"
|
||||
@ -1787,6 +1801,13 @@ while [ "$#" -gt 0 ]; do
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
lgmon)
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||
CFG_LGMON="$VAL"
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
gtkstyle)
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||
CFG_QGTKSTYLE="$VAL"
|
||||
@ -2275,7 +2296,6 @@ Configure options:
|
||||
-no-sse4.2 ......... Do not compile with use of SSE4.2 instructions.
|
||||
-no-avx ............ Do not compile with use of AVX instructions.
|
||||
-no-avx2 ........... Do not compile with use of AVX2 instructions.
|
||||
-no-neon ........... Do not compile with use of NEON instructions.
|
||||
-no-mips_dsp ....... Do not compile with use of MIPS DSP instructions.
|
||||
-no-mips_dspr2 ..... Do not compile with use of MIPS DSP rev2 instructions.
|
||||
|
||||
@ -2307,6 +2327,9 @@ Third Party Libraries:
|
||||
-no-mtdev ......... Do not compile mtdev support.
|
||||
+ -mtdev ............. Enable mtdev support.
|
||||
|
||||
+ -no-journald ....... Do not send logging output to journald.
|
||||
-journald .......... Send logging output to journald.
|
||||
|
||||
-no-gif ............ Do not compile GIF reading support.
|
||||
|
||||
-no-libpng ......... Do not compile PNG support.
|
||||
@ -2484,6 +2507,12 @@ QNX/Blackberry options:
|
||||
-no-pps ............ Do not compile with pps support.
|
||||
-pps ............... Compile with pps support.
|
||||
|
||||
-no-imf ............ Do not compile with imf support.
|
||||
-imf ............... Compile with imf support.
|
||||
|
||||
-no-lgmon .......... Do not compile with lgmon support.
|
||||
-lgmon ............. Compile with lgmon support.
|
||||
|
||||
MacOS/iOS options:
|
||||
|
||||
-Fstring ........... Add an explicit framework path.
|
||||
@ -3344,9 +3373,8 @@ fi
|
||||
if [ "$XPLATFORM_IOS" = "yes" ]; then
|
||||
CFG_RPATH="no"
|
||||
CFG_PKGCONFIG="no"
|
||||
CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS examples tests"
|
||||
CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS examples"
|
||||
CFG_SHARED="no" # iOS builds should be static to be able to submit to the App Store
|
||||
CFG_CXX11="no" # C++11 support disabled for now
|
||||
CFG_SKIP_MODULES="$CFG_SKIP_MODULES qtconnectivity qtdoc qtlocation qtmacextras qtserialport qttools qtwebkit qtwebkit-examples"
|
||||
|
||||
# If the user passes -sdk on the command line we build a SDK-specific Qt build.
|
||||
@ -4011,13 +4039,19 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
|
||||
if [ $QT_EDITION = "QT_EDITION_OPENSOURCE" ]; then
|
||||
echo "EXTRA_CPPFLAGS = -DQMAKE_OPENSOURCE_EDITION" >> "$mkfile"
|
||||
fi
|
||||
cat "$in_mkfile" >> "$mkfile"
|
||||
|
||||
if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
|
||||
(cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1
|
||||
sed 's,^.*/\([^/]*.o\):,\1:,g' "$mkfile" >"$mkfile.tmp"
|
||||
sed "s,$outpath,$adjoutpath,g" "$mkfile.tmp" >"$mkfile"
|
||||
rm "$mkfile.tmp"
|
||||
if [ "$BUILD_ON_MAC" = "yes" ]; then
|
||||
echo "EXTRA_CXXFLAGS += -MMD" >> "$mkfile"
|
||||
cat "$in_mkfile" >> "$mkfile"
|
||||
echo "-include \$(notdir \$(DEPEND_SRC:%.cpp=%.d))" >> "$mkfile"
|
||||
else
|
||||
cat "$in_mkfile" >> "$mkfile"
|
||||
if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
|
||||
(cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1
|
||||
sed 's,^.*/\([^/]*.o\):,\1:,g' "$mkfile" >"$mkfile.tmp"
|
||||
sed "s,$outpath,$adjoutpath,g" "$mkfile.tmp" >"$mkfile"
|
||||
rm "$mkfile.tmp"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
@ -4328,17 +4362,6 @@ if [ "$CFG_IWMMXT" = "yes" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# detect neon support
|
||||
if [ "$CFG_ARCH" = "arm" ] && [ "${CFG_NEON}" = "auto" ]; then
|
||||
if compileTest unix/neon "neon"; then
|
||||
CFG_NEON=yes
|
||||
else
|
||||
CFG_NEON=no
|
||||
fi
|
||||
elif [ "$CFG_ARCH" != "arm" ]; then
|
||||
CFG_NEON=no
|
||||
fi
|
||||
|
||||
# detect mips_dsp support
|
||||
if [ "$CFG_ARCH" = "mips" ] && [ "${CFG_MIPS_DSP}" = "auto" ]; then
|
||||
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mips_dsp "mips_dsp" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
|
||||
@ -4388,7 +4411,14 @@ if [ "$XPLATFORM_QNX" = "yes" ]; then
|
||||
CFG_SLOG2=no
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CFG_QNX_IMF" != "no" ]; then
|
||||
if compileTest unix/qqnx_imf "qqnx_imf"; then
|
||||
CFG_QNX_IMF=yes
|
||||
QMAKE_CONFIG="$QMAKE_CONFIG qqnx_imf"
|
||||
else
|
||||
CFG_QNX_IMF=no
|
||||
fi
|
||||
fi
|
||||
if [ "$CFG_PPS" != "no" ]; then
|
||||
if compileTest unix/pps "pps"; then
|
||||
CFG_PPS=yes
|
||||
@ -4397,6 +4427,15 @@ if [ "$XPLATFORM_QNX" = "yes" ]; then
|
||||
CFG_PPS=no
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CFG_LGMON" != "no" ]; then
|
||||
if compileTest unix/lgmon "lgmon"; then
|
||||
CFG_LGMON=yes
|
||||
QMAKE_CONFIG="$QMAKE_CONFIG lgmon"
|
||||
else
|
||||
CFG_LGMON=no
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CFG_ZLIB" = "auto" ]; then
|
||||
@ -4418,6 +4457,23 @@ if [ "$CFG_MTDEV" = "no" ]; then
|
||||
QMakeVar add DEFINES QT_NO_MTDEV
|
||||
fi
|
||||
|
||||
if [ "$CFG_JOURNALD" != "no" ]; then
|
||||
if compileTest unix/journald "journald"; then
|
||||
CFG_JOURNALD=yes
|
||||
QMAKE_CONFIG="$QMAKE_CONFIG journald"
|
||||
else
|
||||
if [ "$CFG_JOURNALD" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
|
||||
echo "journald support cannot be enabled due to functionality tests!"
|
||||
echo " Turn on verbose messaging (-v) to $0 to see the final report."
|
||||
echo " If you believe this message is in error you may use the continue"
|
||||
echo " switch (-continue) to $0 to continue."
|
||||
exit 101
|
||||
else
|
||||
CFG_JOURNALD=no
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CFG_LARGEFILE" = "auto" ]; then
|
||||
#Large files should be enabled for all Linux systems
|
||||
CFG_LARGEFILE=yes
|
||||
@ -5161,6 +5217,14 @@ if [ "$CFG_XCB" != "no" ]; then
|
||||
QMAKE_CFLAGS_XCB="`$PKG_CONFIG --cflags xcb 2>/dev/null`"
|
||||
QMAKE_LIBS_XCB="`$PKG_CONFIG --libs xcb 2>/dev/null`"
|
||||
fi
|
||||
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "x11" 2> /dev/null; then
|
||||
QMAKE_X11_PREFIX="`$PKG_CONFIG --variable=prefix x11`"
|
||||
else
|
||||
# default to LSB prefix
|
||||
QMAKE_X11_PREFIX="/usr"
|
||||
fi
|
||||
QMakeVar set QMAKE_X11_PREFIX "$QMAKE_X11_PREFIX"
|
||||
|
||||
if compileTest qpa/xcb "xcb" $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
|
||||
|
||||
if [ "$CFG_XCB" = "qt" ]; then
|
||||
@ -5326,6 +5390,11 @@ if [ "$CFG_EGL" != "no" ]; then
|
||||
fi # detect EGL support
|
||||
if compileTest qpa/egl "EGL" $QMAKE_CFLAGS_EGL $QMAKE_LIBS_EGL; then
|
||||
CFG_EGL=yes
|
||||
if compileTest qpa/egl-x11 "EGL-X11" $QMAKE_CFLAGS_EGL $QMAKE_LIBS_EGL; then
|
||||
CFG_EGL_X=yes
|
||||
else
|
||||
CFG_EGL_X=no
|
||||
fi
|
||||
elif [ "$CFG_EGL" = "yes" ]; then
|
||||
echo " The EGL functionality test failed; EGL is required by some QPA plugins to manage contexts & surfaces."
|
||||
echo " You might need to modify the include and library search paths by editing"
|
||||
@ -5333,6 +5402,7 @@ if [ "$CFG_EGL" != "no" ]; then
|
||||
exit 1
|
||||
else
|
||||
CFG_EGL=no
|
||||
CFG_EGL_X=no
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -5387,6 +5457,15 @@ if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Determine print support plugin belonging to the default QPA platform
|
||||
if [ "$QT_QPA_DEFAULT_PLATFORM" = "cocoa" ]; then
|
||||
QT_PRINTSUPPORT_DEFAULT_PLUGIN=cocoaprintersupport
|
||||
elif [ "$QT_QPA_DEFAULT_PLATFORM" = "windows" ]; then
|
||||
QT_PRINTSUPPORT_DEFAULT_PLUGIN=windowsprintersupport
|
||||
elif [ "$QT_QPA_DEFAULT_PLATFORM" = "xcb" ]; then
|
||||
QT_PRINTSUPPORT_DEFAULT_PLUGIN=cupsprintersupport
|
||||
fi
|
||||
|
||||
if [ -n "$QMAKE_CFLAGS_XCB" ] || [ -n "$QMAKE_LIBS_XCB" ]; then
|
||||
QMakeVar set QMAKE_CFLAGS_XCB "$QMAKE_CFLAGS_XCB"
|
||||
QMakeVar set QMAKE_LIBS_XCB "$QMAKE_LIBS_XCB"
|
||||
@ -5431,6 +5510,7 @@ fi
|
||||
|
||||
# harfbuzz support
|
||||
[ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_HARFBUZZ" = "auto" ] && CFG_HARFBUZZ=no
|
||||
[ "$XPLATFORM_MAC" = "yes" ] && [ "$CFG_HARFBUZZ" = "auto" ] && CFG_HARFBUZZ=yes
|
||||
if [ "$CFG_HARFBUZZ" = "auto" ]; then
|
||||
if compileTest unix/harfbuzz "HarfBuzz"; then
|
||||
CFG_HARFBUZZ=system
|
||||
@ -5438,6 +5518,11 @@ if [ "$CFG_HARFBUZZ" = "auto" ]; then
|
||||
CFG_HARFBUZZ=yes
|
||||
fi
|
||||
fi
|
||||
if [ "$XPLATFORM_MAC" = "yes" -a "$CFG_HARFBUZZ" = "system" ]; then
|
||||
echo
|
||||
echo "WARNING: AAT is not supported with -system-harfbuzz on Mac OS X."
|
||||
echo
|
||||
fi
|
||||
|
||||
if ! compileTest unix/stl "STL" &&
|
||||
[ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
|
||||
@ -5706,6 +5791,13 @@ else
|
||||
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGL"
|
||||
fi
|
||||
|
||||
# enable egl on X
|
||||
if [ "$CFG_EGL_X" = "yes" ]; then
|
||||
QT_CONFIG="$QT_CONFIG egl_x11"
|
||||
else
|
||||
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGL_X11"
|
||||
fi
|
||||
|
||||
# enable eglfs
|
||||
if [ "$CFG_EGLFS" = "yes" ]; then
|
||||
QT_CONFIG="$QT_CONFIG eglfs"
|
||||
@ -5782,7 +5874,6 @@ fi
|
||||
[ "$CFG_AVX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx"
|
||||
[ "$CFG_AVX2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx2"
|
||||
[ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt"
|
||||
[ "$CFG_NEON" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG neon"
|
||||
if [ "$CFG_ARCH" = "mips" ]; then
|
||||
[ "$CFG_MIPS_DSP" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mips_dsp"
|
||||
[ "$CFG_MIPS_DSPR2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mips_dspr2"
|
||||
@ -6216,7 +6307,7 @@ fi
|
||||
echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
|
||||
echo "// Compiler sub-arch support" >>"$outpath/src/corelib/global/qconfig.h.new"
|
||||
for SUBARCH in SSE2 SSE3 SSSE3 SSE4_1 SSE4_2 AVX AVX2 \
|
||||
IWMMXT NEON \
|
||||
IWMMXT \
|
||||
MIPS_DSP MIPS_DSPR2; do
|
||||
eval "VAL=\$CFG_$SUBARCH"
|
||||
case "$VAL" in
|
||||
@ -6367,6 +6458,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo "#define QT_QPA_DEFAULT_PLATFORM_NAME \"$QT_QPA_DEFAULT_PLATFORM\"" >>"$outpath/src/corelib/global/qconfig.h.new"
|
||||
echo "#define QT_QPA_DEFAULT_PRINTSUPPORTPLUGIN_NAME \"QT_PRINTSUPPORT_DEFAULT_PLUGIN\"" >>"$outpath/src/corelib/global/qconfig.h.new"
|
||||
|
||||
# avoid unecessary rebuilds by copying only if qconfig.h has changed
|
||||
if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
|
||||
@ -6454,6 +6546,7 @@ EOF
|
||||
|
||||
if [ "$CFG_SHARED" = "no" ]; then
|
||||
echo "QT_DEFAULT_QPA_PLUGIN = q$QT_QPA_DEFAULT_PLATFORM" >> "$QTCONFIG.tmp"
|
||||
echo "QT_DEFAULT_PRINTSUPPORTPLUGIN = $QT_PRINTSUPPORT_DEFAULT_PLUGIN" >> "$QTCONFIG.tmp"
|
||||
echo >> "$QTCONFIG.tmp"
|
||||
fi
|
||||
|
||||
@ -6719,6 +6812,7 @@ report_support_plugin " JPEG ................." "$CFG_JPEG" "$CFG_LIBJPEG" Qt
|
||||
report_support_plugin " PNG .................." "$CFG_PNG" "$CFG_LIBPNG" QtGui
|
||||
report_support " Glib ..................." "$CFG_GLIB"
|
||||
report_support " GTK theme .............." "$CFG_QGTKSTYLE"
|
||||
report_support " journald ..............." "$CFG_JOURNALD"
|
||||
report_support " Large File ............." "$CFG_LARGEFILE"
|
||||
report_support " mtdev .................." "$CFG_MTDEV" yes "system library"
|
||||
report_support " Networking:"
|
||||
@ -6729,6 +6823,9 @@ report_support " getifaddrs ..........." "$CFG_GETIFADDRS"
|
||||
report_support " IPv6 ifname .........." "$CFG_IPV6IFNAME"
|
||||
report_support " OpenSSL .............." "$CFG_OPENSSL" yes "loading libraries at run-time" linked "linked to the libraries"
|
||||
report_support " NIS ...................." "$CFG_NIS"
|
||||
report_support " EGL ...................." "$CFG_EGL"
|
||||
report_support " EGL on X ..............." "$CFG_EGL_X"
|
||||
report_support " GLX ...................." "$CFG_XCB_GLX"
|
||||
report_support " OpenGL ................." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.x"
|
||||
report_support " OpenVG ................." "$CFG_OPENVG-$CFG_OPENVG_SHIVA" yes-yes "ShivaVG" yes-no "native"
|
||||
report_support " PCRE ..................." "$CFG_PCRE" yes "system library" qt "bundled copy"
|
||||
@ -6762,7 +6859,9 @@ fi
|
||||
report_support " Session management ....." "$CFG_SM"
|
||||
if [ "$XPLATFORM_QNX" = "yes" ]; then
|
||||
report_support " SLOG2 .................." "$CFG_SLOG2"
|
||||
report_support " IMF ...................." "$CFG_QNX_IMF"
|
||||
report_support " PPS ...................." "$CFG_PPS"
|
||||
report_support " LGMON .................." "$CFG_LGMON"
|
||||
fi
|
||||
report_support " SQL drivers:"
|
||||
report_support " DB2 .................." "$CFG_SQL_db2" plugin "plugin" yes "built into QtSql"
|
||||
|
36
dist/changes-5.3.0
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
Qt 5.3 introduces many new features and improvements as well as bugfixes
|
||||
over the 5.2.x series. For more details, refer to the online documentation
|
||||
included in this distribution. The documentation is also available online:
|
||||
|
||||
http://qt-project.org/doc/qt-5.3
|
||||
|
||||
The Qt version 5.3 series is binary compatible with the 5.2.x series.
|
||||
Applications compiled for 5.2 will continue to run with 5.3.
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
http://bugreports.qt-project.org/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
****************************************************************************
|
||||
* Library *
|
||||
****************************************************************************
|
||||
|
||||
QtWidgets
|
||||
---------
|
||||
|
||||
QtCore
|
||||
------
|
||||
|
||||
- Added QSignalBlocker, a RAII-style wrapper around
|
||||
QObject::blockSignals().
|
||||
|
||||
QtGui
|
||||
-----
|
||||
|
||||
- Added setSwapInterval() to QSurfaceFormat. Platforms that support
|
||||
setting the swap interval are now defaulting to the value of 1,
|
||||
meaning vsync is enabled.
|
@ -49,7 +49,7 @@
|
||||
StyleWidget::StyleWidget(QWidget *parent)
|
||||
: QFrame(parent)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
m_ui.setupUi(this);
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,8 +73,8 @@ Dialog::Dialog(QWidget *parent)
|
||||
ui.setupUi(this);
|
||||
connect(ui.loadFromFileButton, SIGNAL(clicked()), SLOT(loadFromFile()));
|
||||
connect(ui.loadFromSharedMemoryButton,
|
||||
SIGNAL(clicked()),
|
||||
SLOT(loadFromMemory()));
|
||||
SIGNAL(clicked()),
|
||||
SLOT(loadFromMemory()));
|
||||
setWindowTitle(tr("SharedMemory Example"));
|
||||
}
|
||||
//! [0]
|
||||
@ -155,7 +155,7 @@ void Dialog::loadFromMemory()
|
||||
{
|
||||
if (!sharedMemory.attach()) {
|
||||
ui.label->setText(tr("Unable to attach to shared memory segment.\n" \
|
||||
"Load an image first."));
|
||||
"Load an image first."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -84,10 +84,10 @@ BearerMonitor::BearerMonitor(QWidget *parent)
|
||||
this, SLOT(configurationChanged(const QNetworkConfiguration)));
|
||||
connect(&manager, SIGNAL(updateCompleted()), this, SLOT(updateConfigurations()));
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
connect(registerButton, SIGNAL(clicked()), this, SLOT(registerNetwork()));
|
||||
connect(unregisterButton, SIGNAL(clicked()), this, SLOT(unregisterNetwork()));
|
||||
#else
|
||||
#else // Q_OS_WIN && !Q_OS_WINRT
|
||||
nlaGroup->hide();
|
||||
#endif
|
||||
|
||||
@ -257,7 +257,7 @@ void BearerMonitor::onlineStateChanged(bool isOnline)
|
||||
onlineState->setText(tr("Offline"));
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
void BearerMonitor::registerNetwork()
|
||||
{
|
||||
QTreeWidgetItem *item = treeWidget->currentItem();
|
||||
@ -301,7 +301,7 @@ void BearerMonitor::unregisterNetwork()
|
||||
if (WSASetService(&networkInfo, RNRSERVICE_DELETE, 0) == SOCKET_ERROR)
|
||||
qDebug() << "WSASetService(RNRSERVICE_DELETE) returned" << WSAGetLastError();
|
||||
}
|
||||
#endif
|
||||
#endif // Q_OS_WIN && !Q_OS_WINRT
|
||||
|
||||
void BearerMonitor::showConfigurationFor(QTreeWidgetItem *item)
|
||||
{
|
||||
|
@ -66,10 +66,10 @@ private slots:
|
||||
|
||||
void onlineStateChanged(bool isOnline);
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
void registerNetwork();
|
||||
void unregisterNetwork();
|
||||
#endif
|
||||
#endif // Q_OS_WIN && !Q_OS_WINRT
|
||||
|
||||
void showConfigurationFor(QTreeWidgetItem *item);
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
|
||||
static void usage() {
|
||||
printf("Qt DNS example - performs DNS lookups\n"
|
||||
"Usage: dnslookup [-t <type>] name\n\n");
|
||||
"Usage: dnslookup [-t <type>] [-s nameserver] name\n\n");
|
||||
}
|
||||
|
||||
DnsManager::DnsManager()
|
||||
@ -93,6 +93,17 @@ void DnsManager::execute()
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (args.size() > 1 && args.first() == "-s") {
|
||||
args.takeFirst();
|
||||
const QString ns = args.takeFirst();
|
||||
QHostAddress nameserver(ns);
|
||||
if (nameserver.isNull() || nameserver.protocol() == QAbstractSocket::UnknownNetworkLayerProtocol) {
|
||||
printf("Bad nameserver address: %s\n", qPrintable(ns));
|
||||
QCoreApplication::instance()->quit();
|
||||
return;
|
||||
}
|
||||
dns->setNameserver(nameserver);
|
||||
}
|
||||
if (args.isEmpty()) {
|
||||
usage();
|
||||
QCoreApplication::instance()->quit();
|
||||
|
@ -99,9 +99,9 @@ void Dialog::start()
|
||||
QMessageBox::StandardButton ret = QMessageBox::critical(this,
|
||||
tr("Loopback"),
|
||||
tr("Unable to start the test: %1.")
|
||||
.arg(tcpServer.errorString()),
|
||||
.arg(tcpServer.errorString()),
|
||||
QMessageBox::Retry
|
||||
| QMessageBox::Cancel);
|
||||
| QMessageBox::Cancel);
|
||||
if (ret == QMessageBox::Cancel)
|
||||
return;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ qtHaveModule(widgets) {
|
||||
multicastsender
|
||||
|
||||
# no QProcess
|
||||
!vxworks:!qnx:SUBDIRS += network-chat
|
||||
!vxworks:!qnx:!winrt:SUBDIRS += network-chat
|
||||
|
||||
contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient
|
||||
contains(QT_CONFIG, openssl-linked):SUBDIRS += securesocketclient
|
||||
|
@ -50,8 +50,8 @@ int main(int argc, char **argv)
|
||||
QApplication app(argc, argv);
|
||||
|
||||
if (!QSslSocket::supportsSsl()) {
|
||||
QMessageBox::information(0, "Secure Socket Client",
|
||||
"This system does not support OpenSSL.");
|
||||
QMessageBox::information(0, "Secure Socket Client",
|
||||
"This system does not support OpenSSL.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ void PeerWireClient::sendPieceList(const QBitArray &bitField)
|
||||
|
||||
// Don't send the bitfield if it's all zeros.
|
||||
if (bitField.count(true) == 0)
|
||||
return;
|
||||
return;
|
||||
|
||||
int bitFieldSize = bitField.size();
|
||||
int size = (bitFieldSize + 7) / 8;
|
||||
|
@ -64,7 +64,7 @@ void TorrentServer::removeClient(TorrentClient *client)
|
||||
void TorrentServer::incomingConnection(qintptr socketDescriptor)
|
||||
{
|
||||
PeerWireClient *client =
|
||||
new PeerWireClient(ConnectionManager::instance()->clientId(), this);
|
||||
new PeerWireClient(ConnectionManager::instance()->clientId(), this);
|
||||
|
||||
if (client->setSocketDescriptor(socketDescriptor)) {
|
||||
if (ConnectionManager::instance()->canAddConnection() && !clients.isEmpty()) {
|
||||
|
@ -79,40 +79,40 @@ void GeometryEngine::initCubeGeometry()
|
||||
// is different.
|
||||
VertexData vertices[] = {
|
||||
// Vertex data for face 0
|
||||
{QVector3D(-1.0, -1.0, 1.0), QVector2D(0.0, 0.0)}, // v0
|
||||
{QVector3D( 1.0, -1.0, 1.0), QVector2D(0.33, 0.0)}, // v1
|
||||
{QVector3D(-1.0, 1.0, 1.0), QVector2D(0.0, 0.5)}, // v2
|
||||
{QVector3D( 1.0, 1.0, 1.0), QVector2D(0.33, 0.5)}, // v3
|
||||
{QVector3D(-1.0f, -1.0f, 1.0f), QVector2D(0.0f, 0.0f)}, // v0
|
||||
{QVector3D( 1.0f, -1.0f, 1.0f), QVector2D(0.33f, 0.0f)}, // v1
|
||||
{QVector3D(-1.0f, 1.0f, 1.0f), QVector2D(0.0f, 0.5f)}, // v2
|
||||
{QVector3D( 1.0f, 1.0f, 1.0f), QVector2D(0.33f, 0.5f)}, // v3
|
||||
|
||||
// Vertex data for face 1
|
||||
{QVector3D( 1.0, -1.0, 1.0), QVector2D( 0.0, 0.5)}, // v4
|
||||
{QVector3D( 1.0, -1.0, -1.0), QVector2D(0.33, 0.5)}, // v5
|
||||
{QVector3D( 1.0, 1.0, 1.0), QVector2D(0.0, 1.0)}, // v6
|
||||
{QVector3D( 1.0, 1.0, -1.0), QVector2D(0.33, 1.0)}, // v7
|
||||
{QVector3D( 1.0f, -1.0f, 1.0f), QVector2D( 0.0f, 0.5f)}, // v4
|
||||
{QVector3D( 1.0f, -1.0f, -1.0f), QVector2D(0.33f, 0.5f)}, // v5
|
||||
{QVector3D( 1.0f, 1.0f, 1.0f), QVector2D(0.0f, 1.0f)}, // v6
|
||||
{QVector3D( 1.0f, 1.0f, -1.0f), QVector2D(0.33f, 1.0f)}, // v7
|
||||
|
||||
// Vertex data for face 2
|
||||
{QVector3D( 1.0, -1.0, -1.0), QVector2D(0.66, 0.5)}, // v8
|
||||
{QVector3D(-1.0, -1.0, -1.0), QVector2D(1.0, 0.5)}, // v9
|
||||
{QVector3D( 1.0, 1.0, -1.0), QVector2D(0.66, 1.0)}, // v10
|
||||
{QVector3D(-1.0, 1.0, -1.0), QVector2D(1.0, 1.0)}, // v11
|
||||
{QVector3D( 1.0f, -1.0f, -1.0f), QVector2D(0.66f, 0.5f)}, // v8
|
||||
{QVector3D(-1.0f, -1.0f, -1.0f), QVector2D(1.0f, 0.5f)}, // v9
|
||||
{QVector3D( 1.0f, 1.0f, -1.0f), QVector2D(0.66f, 1.0f)}, // v10
|
||||
{QVector3D(-1.0f, 1.0f, -1.0f), QVector2D(1.0f, 1.0f)}, // v11
|
||||
|
||||
// Vertex data for face 3
|
||||
{QVector3D(-1.0, -1.0, -1.0), QVector2D(0.66, 0.0)}, // v12
|
||||
{QVector3D(-1.0, -1.0, 1.0), QVector2D(1.0, 0.0)}, // v13
|
||||
{QVector3D(-1.0, 1.0, -1.0), QVector2D(0.66, 0.5)}, // v14
|
||||
{QVector3D(-1.0, 1.0, 1.0), QVector2D(1.0, 0.5)}, // v15
|
||||
{QVector3D(-1.0f, -1.0f, -1.0f), QVector2D(0.66f, 0.0f)}, // v12
|
||||
{QVector3D(-1.0f, -1.0f, 1.0f), QVector2D(1.0f, 0.0f)}, // v13
|
||||
{QVector3D(-1.0f, 1.0f, -1.0f), QVector2D(0.66f, 0.5f)}, // v14
|
||||
{QVector3D(-1.0f, 1.0f, 1.0f), QVector2D(1.0f, 0.5f)}, // v15
|
||||
|
||||
// Vertex data for face 4
|
||||
{QVector3D(-1.0, -1.0, -1.0), QVector2D(0.33, 0.0)}, // v16
|
||||
{QVector3D( 1.0, -1.0, -1.0), QVector2D(0.66, 0.0)}, // v17
|
||||
{QVector3D(-1.0, -1.0, 1.0), QVector2D(0.33, 0.5)}, // v18
|
||||
{QVector3D( 1.0, -1.0, 1.0), QVector2D(0.66, 0.5)}, // v19
|
||||
{QVector3D(-1.0f, -1.0f, -1.0f), QVector2D(0.33f, 0.0f)}, // v16
|
||||
{QVector3D( 1.0f, -1.0f, -1.0f), QVector2D(0.66f, 0.0f)}, // v17
|
||||
{QVector3D(-1.0f, -1.0f, 1.0f), QVector2D(0.33f, 0.5f)}, // v18
|
||||
{QVector3D( 1.0f, -1.0f, 1.0f), QVector2D(0.66f, 0.5f)}, // v19
|
||||
|
||||
// Vertex data for face 5
|
||||
{QVector3D(-1.0, 1.0, 1.0), QVector2D(0.33, 0.5)}, // v20
|
||||
{QVector3D( 1.0, 1.0, 1.0), QVector2D(0.66, 0.5)}, // v21
|
||||
{QVector3D(-1.0, 1.0, -1.0), QVector2D(0.33, 1.0)}, // v22
|
||||
{QVector3D( 1.0, 1.0, -1.0), QVector2D(0.66, 1.0)} // v23
|
||||
{QVector3D(-1.0f, 1.0f, 1.0f), QVector2D(0.33f, 0.5f)}, // v20
|
||||
{QVector3D( 1.0f, 1.0f, 1.0f), QVector2D(0.66f, 0.5f)}, // v21
|
||||
{QVector3D(-1.0f, 1.0f, -1.0f), QVector2D(0.33f, 1.0f)}, // v22
|
||||
{QVector3D( 1.0f, 1.0f, -1.0f), QVector2D(0.66f, 1.0f)} // v23
|
||||
};
|
||||
|
||||
// Indices for drawing cube faces using triangle strips.
|
||||
|
@ -112,20 +112,20 @@ void GLWidget::initializeGL()
|
||||
{
|
||||
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
// draw cube background
|
||||
// draw cube background
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.5f, 0.5f, -2.0f);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glVertexPointer(2, GL_INT, 0, faceArray);
|
||||
glDrawArrays(GL_QUADS, 0, 4);
|
||||
glVertexPointer(3, GL_INT, 0, cubeArray);
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glVertexPointer(2, GL_INT, 0, faceArray);
|
||||
glDrawArrays(GL_QUADS, 0, 4);
|
||||
glVertexPointer(3, GL_INT, 0, cubeArray);
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glPopMatrix();
|
||||
|
||||
// draw cube
|
||||
// draw cube
|
||||
glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
glRotatef(3.0f, 1.0f, 1.0f, 1.0f);
|
||||
glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
@ -205,12 +205,12 @@ void GLWidget::paintGL()
|
||||
glTranslatef(-1.2f, -0.8f, 0.0f);
|
||||
glScalef(0.2f, 0.2f, 0.2f);
|
||||
for (int y = 0; y < 5; ++y) {
|
||||
for (int x = 0; x < 5; ++x) {
|
||||
glTranslatef(2.0f, 0, 0);
|
||||
glColor4f(0.8f, 0.8f, 0.8f, 1.0f);
|
||||
glDrawArrays(GL_QUADS, 0, 4);
|
||||
}
|
||||
glTranslatef(-10.0f, 2.0f, 0);
|
||||
for (int x = 0; x < 5; ++x) {
|
||||
glTranslatef(2.0f, 0, 0);
|
||||
glColor4f(0.8f, 0.8f, 0.8f, 1.0f);
|
||||
glDrawArrays(GL_QUADS, 0, 4);
|
||||
}
|
||||
glTranslatef(-10.0f, 2.0f, 0);
|
||||
}
|
||||
glVertexPointer(3, GL_INT, 0, cubeArray);
|
||||
|
||||
|
@ -48,8 +48,8 @@ int main(int argc, char **argv)
|
||||
|
||||
QApplication a(argc, argv);
|
||||
if (!QGLFormat::hasOpenGL() || !QGLFramebufferObject::hasOpenGLFramebufferObjects()) {
|
||||
QMessageBox::information(0, "OpenGL framebuffer objects 2",
|
||||
"This system does not support OpenGL/framebuffer objects.");
|
||||
QMessageBox::information(0, "OpenGL framebuffer objects 2",
|
||||
"This system does not support OpenGL/framebuffer objects.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,8 @@ int main(int argc, char **argv)
|
||||
widget.makeCurrent();
|
||||
|
||||
if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) {
|
||||
QMessageBox::information(0, "OpenGL pbuffers",
|
||||
"This system does not support OpenGL/pbuffers.");
|
||||
QMessageBox::information(0, "OpenGL pbuffers",
|
||||
"This system does not support OpenGL/pbuffers.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -51,8 +51,8 @@ int main(int argc, char **argv)
|
||||
widget.resize(640, 480);
|
||||
widget.makeCurrent();
|
||||
if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) {
|
||||
QMessageBox::information(0, "OpenGL pbuffers 2",
|
||||
"This system does not support OpenGL/pbuffers.");
|
||||
QMessageBox::information(0, "OpenGL pbuffers 2",
|
||||
"This system does not support OpenGL/pbuffers.");
|
||||
return -1;
|
||||
}
|
||||
widget.show();
|
||||
|
@ -50,16 +50,16 @@ int main(int argc, char **argv)
|
||||
f.setSampleBuffers(true);
|
||||
QGLFormat::setDefaultFormat(f);
|
||||
if (!QGLFormat::hasOpenGL()) {
|
||||
QMessageBox::information(0, "OpenGL samplebuffers",
|
||||
"This system does not support OpenGL.");
|
||||
QMessageBox::information(0, "OpenGL samplebuffers",
|
||||
"This system does not support OpenGL.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLWidget widget(0);
|
||||
|
||||
if (!widget.format().sampleBuffers()) {
|
||||
QMessageBox::information(0, "OpenGL samplebuffers",
|
||||
"This system does not have sample buffer support.");
|
||||
QMessageBox::information(0, "OpenGL samplebuffers",
|
||||
"This system does not have sample buffer support.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -50,9 +50,7 @@ GLWidget::GLWidget(QWidget *parent, QGLWidget *shareWidget)
|
||||
xRot = 0;
|
||||
yRot = 0;
|
||||
zRot = 0;
|
||||
#ifdef QT_OPENGL_ES_2
|
||||
program = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
GLWidget::~GLWidget()
|
||||
@ -89,12 +87,10 @@ void GLWidget::initializeGL()
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_CULL_FACE);
|
||||
#ifndef QT_OPENGL_ES_2
|
||||
#ifdef GL_TEXTURE_2D
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
#endif
|
||||
|
||||
#ifdef QT_OPENGL_ES_2
|
||||
|
||||
#define PROGRAM_VERTEX_ATTRIBUTE 0
|
||||
#define PROGRAM_TEXCOORD_ATTRIBUTE 1
|
||||
|
||||
@ -130,8 +126,6 @@ void GLWidget::initializeGL()
|
||||
|
||||
program->bind();
|
||||
program->setUniformValue("texture", 0);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void GLWidget::paintGL()
|
||||
@ -139,21 +133,6 @@ void GLWidget::paintGL()
|
||||
qglClearColor(clearColor);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
#if !defined(QT_OPENGL_ES_2)
|
||||
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0f, 0.0f, -10.0f);
|
||||
glRotatef(xRot / 16.0f, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef(yRot / 16.0f, 0.0f, 1.0f, 0.0f);
|
||||
glRotatef(zRot / 16.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, 0, vertices.constData());
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, texCoords.constData());
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
#else
|
||||
|
||||
QMatrix4x4 m;
|
||||
m.ortho(-0.5f, +0.5f, +0.5f, -0.5f, 4.0f, 15.0f);
|
||||
m.translate(0.0f, 0.0f, -10.0f);
|
||||
@ -169,8 +148,6 @@ void GLWidget::paintGL()
|
||||
program->setAttributeArray
|
||||
(PROGRAM_TEXCOORD_ATTRIBUTE, texCoords.constData());
|
||||
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
glBindTexture(GL_TEXTURE_2D, textures[i]);
|
||||
glDrawArrays(GL_TRIANGLE_FAN, i * 4, 4);
|
||||
@ -181,17 +158,6 @@ void GLWidget::resizeGL(int width, int height)
|
||||
{
|
||||
int side = qMin(width, height);
|
||||
glViewport((width - side) / 2, (height - side) / 2, side, side);
|
||||
|
||||
#if !defined(QT_OPENGL_ES_2)
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
#ifndef QT_OPENGL_ES
|
||||
glOrtho(-0.5, +0.5, +0.5, -0.5, 4.0, 15.0);
|
||||
#else
|
||||
glOrthof(-0.5, +0.5, +0.5, -0.5, 4.0, 15.0);
|
||||
#endif
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
#endif
|
||||
}
|
||||
|
||||
void GLWidget::mousePressEvent(QMouseEvent *event)
|
||||
|
@ -81,9 +81,7 @@ private:
|
||||
GLuint textures[6];
|
||||
QVector<QVector3D> vertices;
|
||||
QVector<QVector2D> texCoords;
|
||||
#ifdef QT_OPENGL_ES_2
|
||||
QGLShaderProgram *program;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -186,7 +186,7 @@ bool MainWindow::maybeSave()
|
||||
tr("The image has been modified.\n"
|
||||
"Do you want to save your changes?"),
|
||||
QMessageBox::Save | QMessageBox::Discard
|
||||
| QMessageBox::Cancel);
|
||||
| QMessageBox::Cancel);
|
||||
if (ret == QMessageBox::Save) {
|
||||
return saveFile("png");
|
||||
} else if (ret == QMessageBox::Cancel) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/****************************************************************************
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
|
@ -137,7 +137,7 @@ void BlurPicker::keyPressEvent(QKeyEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void BlurPicker::resizeEvent(QResizeEvent */*event*/)
|
||||
void BlurPicker::resizeEvent(QResizeEvent * /* event */)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -134,6 +134,6 @@ void Lighting::animate()
|
||||
m_scene.update();
|
||||
}
|
||||
|
||||
void Lighting::resizeEvent(QResizeEvent */*event*/)
|
||||
void Lighting::resizeEvent(QResizeEvent * /* event */)
|
||||
{
|
||||
}
|
||||
|
@ -196,9 +196,9 @@ public:
|
||||
{
|
||||
GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::GLVertexBuffer", glGenBuffers && glBindBuffer && glBufferData, return)
|
||||
|
||||
glGenBuffers(1, &m_buffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, m_buffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, (m_length = length) * sizeof(T), data, mode);
|
||||
glGenBuffers(1, &m_buffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, m_buffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, (m_length = length) * sizeof(T), data, mode);
|
||||
}
|
||||
|
||||
~GLVertexBuffer()
|
||||
|
@ -45,54 +45,54 @@
|
||||
|
||||
bool GLExtensionFunctions::resolve(const QGLContext *context)
|
||||
{
|
||||
bool ok = true;
|
||||
bool ok = true;
|
||||
|
||||
RESOLVE_GL_FUNC(GenFramebuffersEXT)
|
||||
RESOLVE_GL_FUNC(GenRenderbuffersEXT)
|
||||
RESOLVE_GL_FUNC(BindRenderbufferEXT)
|
||||
RESOLVE_GL_FUNC(RenderbufferStorageEXT)
|
||||
RESOLVE_GL_FUNC(DeleteFramebuffersEXT)
|
||||
RESOLVE_GL_FUNC(DeleteRenderbuffersEXT)
|
||||
RESOLVE_GL_FUNC(BindFramebufferEXT)
|
||||
RESOLVE_GL_FUNC(FramebufferTexture2DEXT)
|
||||
RESOLVE_GL_FUNC(FramebufferRenderbufferEXT)
|
||||
RESOLVE_GL_FUNC(CheckFramebufferStatusEXT)
|
||||
RESOLVE_GL_FUNC(GenFramebuffersEXT)
|
||||
RESOLVE_GL_FUNC(GenRenderbuffersEXT)
|
||||
RESOLVE_GL_FUNC(BindRenderbufferEXT)
|
||||
RESOLVE_GL_FUNC(RenderbufferStorageEXT)
|
||||
RESOLVE_GL_FUNC(DeleteFramebuffersEXT)
|
||||
RESOLVE_GL_FUNC(DeleteRenderbuffersEXT)
|
||||
RESOLVE_GL_FUNC(BindFramebufferEXT)
|
||||
RESOLVE_GL_FUNC(FramebufferTexture2DEXT)
|
||||
RESOLVE_GL_FUNC(FramebufferRenderbufferEXT)
|
||||
RESOLVE_GL_FUNC(CheckFramebufferStatusEXT)
|
||||
|
||||
RESOLVE_GL_FUNC(ActiveTexture)
|
||||
RESOLVE_GL_FUNC(TexImage3D)
|
||||
RESOLVE_GL_FUNC(ActiveTexture)
|
||||
RESOLVE_GL_FUNC(TexImage3D)
|
||||
|
||||
RESOLVE_GL_FUNC(GenBuffers)
|
||||
RESOLVE_GL_FUNC(BindBuffer)
|
||||
RESOLVE_GL_FUNC(BufferData)
|
||||
RESOLVE_GL_FUNC(DeleteBuffers)
|
||||
RESOLVE_GL_FUNC(MapBuffer)
|
||||
RESOLVE_GL_FUNC(UnmapBuffer)
|
||||
RESOLVE_GL_FUNC(GenBuffers)
|
||||
RESOLVE_GL_FUNC(BindBuffer)
|
||||
RESOLVE_GL_FUNC(BufferData)
|
||||
RESOLVE_GL_FUNC(DeleteBuffers)
|
||||
RESOLVE_GL_FUNC(MapBuffer)
|
||||
RESOLVE_GL_FUNC(UnmapBuffer)
|
||||
|
||||
return ok;
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool GLExtensionFunctions::fboSupported() {
|
||||
return GenFramebuffersEXT
|
||||
&& GenRenderbuffersEXT
|
||||
&& BindRenderbufferEXT
|
||||
&& RenderbufferStorageEXT
|
||||
&& DeleteFramebuffersEXT
|
||||
&& DeleteRenderbuffersEXT
|
||||
&& BindFramebufferEXT
|
||||
&& FramebufferTexture2DEXT
|
||||
&& FramebufferRenderbufferEXT
|
||||
&& CheckFramebufferStatusEXT;
|
||||
&& GenRenderbuffersEXT
|
||||
&& BindRenderbufferEXT
|
||||
&& RenderbufferStorageEXT
|
||||
&& DeleteFramebuffersEXT
|
||||
&& DeleteRenderbuffersEXT
|
||||
&& BindFramebufferEXT
|
||||
&& FramebufferTexture2DEXT
|
||||
&& FramebufferRenderbufferEXT
|
||||
&& CheckFramebufferStatusEXT;
|
||||
}
|
||||
|
||||
bool GLExtensionFunctions::openGL15Supported() {
|
||||
return ActiveTexture
|
||||
&& TexImage3D
|
||||
&& TexImage3D
|
||||
&& GenBuffers
|
||||
&& BindBuffer
|
||||
&& BufferData
|
||||
&& DeleteBuffers
|
||||
&& MapBuffer
|
||||
&& UnmapBuffer;
|
||||
&& BindBuffer
|
||||
&& BufferData
|
||||
&& DeleteBuffers
|
||||
&& MapBuffer
|
||||
&& UnmapBuffer;
|
||||
}
|
||||
|
||||
#undef RESOLVE_GL_FUNC
|
||||
|
@ -145,37 +145,37 @@ typedef GLboolean (APIENTRY *_glUnmapBuffer) (GLenum);
|
||||
|
||||
struct GLExtensionFunctions
|
||||
{
|
||||
bool resolve(const QGLContext *context);
|
||||
bool resolve(const QGLContext *context);
|
||||
|
||||
bool fboSupported();
|
||||
bool openGL15Supported(); // the rest: multi-texture, 3D-texture, vertex buffer objects
|
||||
|
||||
_glGenFramebuffersEXT GenFramebuffersEXT;
|
||||
_glGenRenderbuffersEXT GenRenderbuffersEXT;
|
||||
_glBindRenderbufferEXT BindRenderbufferEXT;
|
||||
_glRenderbufferStorageEXT RenderbufferStorageEXT;
|
||||
_glDeleteFramebuffersEXT DeleteFramebuffersEXT;
|
||||
_glDeleteRenderbuffersEXT DeleteRenderbuffersEXT;
|
||||
_glBindFramebufferEXT BindFramebufferEXT;
|
||||
_glFramebufferTexture2DEXT FramebufferTexture2DEXT;
|
||||
_glFramebufferRenderbufferEXT FramebufferRenderbufferEXT;
|
||||
_glCheckFramebufferStatusEXT CheckFramebufferStatusEXT;
|
||||
_glGenFramebuffersEXT GenFramebuffersEXT;
|
||||
_glGenRenderbuffersEXT GenRenderbuffersEXT;
|
||||
_glBindRenderbufferEXT BindRenderbufferEXT;
|
||||
_glRenderbufferStorageEXT RenderbufferStorageEXT;
|
||||
_glDeleteFramebuffersEXT DeleteFramebuffersEXT;
|
||||
_glDeleteRenderbuffersEXT DeleteRenderbuffersEXT;
|
||||
_glBindFramebufferEXT BindFramebufferEXT;
|
||||
_glFramebufferTexture2DEXT FramebufferTexture2DEXT;
|
||||
_glFramebufferRenderbufferEXT FramebufferRenderbufferEXT;
|
||||
_glCheckFramebufferStatusEXT CheckFramebufferStatusEXT;
|
||||
|
||||
_glActiveTexture ActiveTexture;
|
||||
_glTexImage3D TexImage3D;
|
||||
_glActiveTexture ActiveTexture;
|
||||
_glTexImage3D TexImage3D;
|
||||
|
||||
_glGenBuffers GenBuffers;
|
||||
_glBindBuffer BindBuffer;
|
||||
_glBufferData BufferData;
|
||||
_glDeleteBuffers DeleteBuffers;
|
||||
_glMapBuffer MapBuffer;
|
||||
_glUnmapBuffer UnmapBuffer;
|
||||
_glGenBuffers GenBuffers;
|
||||
_glBindBuffer BindBuffer;
|
||||
_glBufferData BufferData;
|
||||
_glDeleteBuffers DeleteBuffers;
|
||||
_glMapBuffer MapBuffer;
|
||||
_glUnmapBuffer UnmapBuffer;
|
||||
};
|
||||
|
||||
inline GLExtensionFunctions &getGLExtensionFunctions()
|
||||
{
|
||||
static GLExtensionFunctions funcs;
|
||||
return funcs;
|
||||
static GLExtensionFunctions funcs;
|
||||
return funcs;
|
||||
}
|
||||
|
||||
#define glGenFramebuffersEXT getGLExtensionFunctions().GenFramebuffersEXT
|
||||
|
@ -186,10 +186,10 @@ TwoSidedGraphicsWidget::TwoSidedGraphicsWidget(QGraphicsScene *scene)
|
||||
void TwoSidedGraphicsWidget::setWidget(int index, QWidget *widget)
|
||||
{
|
||||
if (index < 0 || index >= 2)
|
||||
{
|
||||
qWarning("TwoSidedGraphicsWidget::setWidget: Index out of bounds, index == %d", index);
|
||||
return;
|
||||
}
|
||||
{
|
||||
qWarning("TwoSidedGraphicsWidget::setWidget: Index out of bounds, index == %d", index);
|
||||
return;
|
||||
}
|
||||
|
||||
GraphicsWidget *proxy = new GraphicsWidget;
|
||||
proxy->setWidget(widget);
|
||||
@ -210,10 +210,10 @@ void TwoSidedGraphicsWidget::setWidget(int index, QWidget *widget)
|
||||
QWidget *TwoSidedGraphicsWidget::widget(int index)
|
||||
{
|
||||
if (index < 0 || index >= 2)
|
||||
{
|
||||
qWarning("TwoSidedGraphicsWidget::widget: Index out of bounds, index == %d", index);
|
||||
return 0;
|
||||
}
|
||||
{
|
||||
qWarning("TwoSidedGraphicsWidget::widget: Index out of bounds, index == %d", index);
|
||||
return 0;
|
||||
}
|
||||
return m_proxyWidgets[index]->widget();
|
||||
}
|
||||
|
||||
|
@ -193,9 +193,9 @@ void GraphWidget::drawBackground(QPainter *painter, const QRectF &rect)
|
||||
QRectF rightShadow(sceneRect.right(), sceneRect.top() + 5, 5, sceneRect.height());
|
||||
QRectF bottomShadow(sceneRect.left() + 5, sceneRect.bottom(), sceneRect.width(), 5);
|
||||
if (rightShadow.intersects(rect) || rightShadow.contains(rect))
|
||||
painter->fillRect(rightShadow, Qt::darkGray);
|
||||
painter->fillRect(rightShadow, Qt::darkGray);
|
||||
if (bottomShadow.intersects(rect) || bottomShadow.contains(rect))
|
||||
painter->fillRect(bottomShadow, Qt::darkGray);
|
||||
painter->fillRect(bottomShadow, Qt::darkGray);
|
||||
|
||||
// Fill
|
||||
QLinearGradient gradient(sceneRect.topLeft(), sceneRect.bottomRight());
|
||||
|
@ -156,11 +156,11 @@ void MainWindow::printImage()
|
||||
{
|
||||
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
|
||||
if (model->rowCount(QModelIndex())*model->columnCount(QModelIndex()) > 90000) {
|
||||
QMessageBox::StandardButton answer;
|
||||
answer = QMessageBox::question(this, tr("Large Image Size"),
|
||||
tr("The printed image may be very large. Are you sure that "
|
||||
"you want to print it?"),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
QMessageBox::StandardButton answer;
|
||||
answer = QMessageBox::question(this, tr("Large Image Size"),
|
||||
tr("The printed image may be very large. Are you sure that "
|
||||
"you want to print it?"),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (answer == QMessageBox::No)
|
||||
return;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ void Dialog::createHorizontalGroupBox()
|
||||
|
||||
for (int i = 0; i < NumButtons; ++i) {
|
||||
buttons[i] = new QPushButton(tr("Button %1").arg(i + 1));
|
||||
layout->addWidget(buttons[i]);
|
||||
layout->addWidget(buttons[i]);
|
||||
}
|
||||
horizontalGroupBox->setLayout(layout);
|
||||
}
|
||||
|
@ -69,13 +69,13 @@ public:
|
||||
private:
|
||||
struct ItemWrapper
|
||||
{
|
||||
ItemWrapper(QLayoutItem *i, Position p) {
|
||||
item = i;
|
||||
position = p;
|
||||
}
|
||||
ItemWrapper(QLayoutItem *i, Position p) {
|
||||
item = i;
|
||||
position = p;
|
||||
}
|
||||
|
||||
QLayoutItem *item;
|
||||
Position position;
|
||||
QLayoutItem *item;
|
||||
Position position;
|
||||
};
|
||||
|
||||
enum SizeType { MinimumSize, SizeHint };
|
||||
|
@ -636,7 +636,7 @@ void BlueTitleBar::paintEvent(QPaintEvent*)
|
||||
centerPm.height(), centerPm);
|
||||
}
|
||||
|
||||
void BlueTitleBar::mousePressEvent(QMouseEvent *event)
|
||||
void BlueTitleBar::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
QPoint pos = event->pos();
|
||||
|
||||
|
@ -124,7 +124,7 @@ public:
|
||||
QSize minimumSizeHint() const;
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
public slots:
|
||||
void updateMask();
|
||||
|
||||
|
@ -145,13 +145,13 @@ void MdiChild::documentWasModified()
|
||||
bool MdiChild::maybeSave()
|
||||
{
|
||||
if (document()->isModified()) {
|
||||
QMessageBox::StandardButton ret;
|
||||
QMessageBox::StandardButton ret;
|
||||
ret = QMessageBox::warning(this, tr("MDI"),
|
||||
tr("'%1' has been modified.\n"
|
||||
"Do you want to save your changes?")
|
||||
.arg(userFriendlyCurrentFile()),
|
||||
QMessageBox::Save | QMessageBox::Discard
|
||||
| QMessageBox::Cancel);
|
||||
| QMessageBox::Cancel);
|
||||
if (ret == QMessageBox::Save)
|
||||
return save();
|
||||
else if (ret == QMessageBox::Cancel)
|
||||
|
@ -282,12 +282,12 @@ void MainWindow::writeSettings()
|
||||
bool MainWindow::maybeSave()
|
||||
{
|
||||
if (textEdit->document()->isModified()) {
|
||||
QMessageBox::StandardButton ret;
|
||||
QMessageBox::StandardButton ret;
|
||||
ret = QMessageBox::warning(this, tr("SDI"),
|
||||
tr("The document has been modified.\n"
|
||||
"Do you want to save your changes?"),
|
||||
QMessageBox::Save | QMessageBox::Discard
|
||||
| QMessageBox::Cancel);
|
||||
| QMessageBox::Cancel);
|
||||
if (ret == QMessageBox::Save)
|
||||
return save();
|
||||
else if (ret == QMessageBox::Cancel)
|
||||
|
@ -283,7 +283,7 @@ void TextEdit::setupTextActions()
|
||||
tr("&Bold"), this);
|
||||
actionTextBold->setShortcut(Qt::CTRL + Qt::Key_B);
|
||||
actionTextBold->setPriority(QAction::LowPriority);
|
||||
QFont bold;
|
||||
QFont bold;
|
||||
bold.setBold(true);
|
||||
actionTextBold->setFont(bold);
|
||||
connect(actionTextBold, SIGNAL(triggered()), this, SLOT(textBold()));
|
||||
|
@ -162,7 +162,7 @@ void MainWindow::createActions()
|
||||
QString text = tr("%1...").arg(QString(codec->name()));
|
||||
|
||||
QAction *action = new QAction(text, this);
|
||||
action->setData(codec->name());
|
||||
action->setData(codec->name());
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(save()));
|
||||
saveAsActs.append(action);
|
||||
}
|
||||
|
@ -77,14 +77,14 @@ bool MyModel::setData(const QModelIndex & index, const QVariant & value, int rol
|
||||
{
|
||||
//save value from editor to member m_gridData
|
||||
m_gridData[index.row()][index.column()] = value.toString();
|
||||
//for presentation purposes only: build and emit a joined string
|
||||
//for presentation purposes only: build and emit a joined string
|
||||
QString result;
|
||||
for(int row= 0; row < ROWS; row++)
|
||||
{
|
||||
for (int row= 0; row < ROWS; row++)
|
||||
{
|
||||
for(int col= 0; col < COLS; col++)
|
||||
{
|
||||
result += m_gridData[row][col] + " ";
|
||||
}
|
||||
{
|
||||
result += m_gridData[row][col] + " ";
|
||||
}
|
||||
}
|
||||
emit editCompleted( result );
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ Calculator::Calculator(QWidget *parent)
|
||||
|
||||
//! [4]
|
||||
for (int i = 0; i < NumDigitButtons; ++i) {
|
||||
digitButtons[i] = createButton(QString::number(i), SLOT(digitClicked()));
|
||||
digitButtons[i] = createButton(QString::number(i), SLOT(digitClicked()));
|
||||
}
|
||||
|
||||
Button *pointButton = createButton(tr("."), SLOT(pointClicked()));
|
||||
@ -144,7 +144,7 @@ void Calculator::digitClicked()
|
||||
|
||||
if (waitingForOperand) {
|
||||
display->clear();
|
||||
waitingForOperand = false;
|
||||
waitingForOperand = false;
|
||||
}
|
||||
display->setText(display->text() + QString::number(digitValue));
|
||||
}
|
||||
@ -169,8 +169,8 @@ void Calculator::unaryOperatorClicked()
|
||||
result = pow(operand, 2.0);
|
||||
} else if (clickedOperator == tr("1/x")) {
|
||||
if (operand == 0.0) {
|
||||
abortOperation();
|
||||
return;
|
||||
abortOperation();
|
||||
return;
|
||||
}
|
||||
result = 1.0 / operand;
|
||||
}
|
||||
@ -192,7 +192,7 @@ void Calculator::additiveOperatorClicked()
|
||||
//! [12] //! [13]
|
||||
if (!calculate(operand, pendingMultiplicativeOperator)) {
|
||||
abortOperation();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
display->setText(QString::number(factorSoFar));
|
||||
operand = factorSoFar;
|
||||
@ -205,7 +205,7 @@ void Calculator::additiveOperatorClicked()
|
||||
//! [14] //! [15]
|
||||
if (!calculate(operand, pendingAdditiveOperator)) {
|
||||
abortOperation();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
display->setText(QString::number(sumSoFar));
|
||||
} else {
|
||||
@ -229,7 +229,7 @@ void Calculator::multiplicativeOperatorClicked()
|
||||
if (!pendingMultiplicativeOperator.isEmpty()) {
|
||||
if (!calculate(operand, pendingMultiplicativeOperator)) {
|
||||
abortOperation();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
display->setText(QString::number(factorSoFar));
|
||||
} else {
|
||||
@ -249,7 +249,7 @@ void Calculator::equalClicked()
|
||||
if (!pendingMultiplicativeOperator.isEmpty()) {
|
||||
if (!calculate(operand, pendingMultiplicativeOperator)) {
|
||||
abortOperation();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
operand = factorSoFar;
|
||||
factorSoFar = 0.0;
|
||||
@ -258,7 +258,7 @@ void Calculator::equalClicked()
|
||||
if (!pendingAdditiveOperator.isEmpty()) {
|
||||
if (!calculate(operand, pendingAdditiveOperator)) {
|
||||
abortOperation();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
pendingAdditiveOperator.clear();
|
||||
} else {
|
||||
@ -387,9 +387,9 @@ bool Calculator::calculate(double rightOperand, const QString &pendingOperator)
|
||||
} else if (pendingOperator == tr("\303\227")) {
|
||||
factorSoFar *= rightOperand;
|
||||
} else if (pendingOperator == tr("\303\267")) {
|
||||
if (rightOperand == 0.0)
|
||||
return false;
|
||||
factorSoFar /= rightOperand;
|
||||
if (rightOperand == 0.0)
|
||||
return false;
|
||||
factorSoFar /= rightOperand;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ void Window::echoChanged(int index)
|
||||
echoLineEdit->setEchoMode(QLineEdit::Password);
|
||||
break;
|
||||
case 2:
|
||||
echoLineEdit->setEchoMode(QLineEdit::PasswordEchoOnEdit);
|
||||
echoLineEdit->setEchoMode(QLineEdit::PasswordEchoOnEdit);
|
||||
break;
|
||||
case 3:
|
||||
echoLineEdit->setEchoMode(QLineEdit::NoEcho);
|
||||
@ -221,7 +221,7 @@ void Window::alignmentChanged(int index)
|
||||
alignmentLineEdit->setAlignment(Qt::AlignCenter);
|
||||
break;
|
||||
case 2:
|
||||
alignmentLineEdit->setAlignment(Qt::AlignRight);
|
||||
alignmentLineEdit->setAlignment(Qt::AlignRight);
|
||||
}
|
||||
}
|
||||
//! [11]
|
||||
|
@ -219,7 +219,7 @@ bool MainWindow::maybeSave()
|
||||
tr("The image has been modified.\n"
|
||||
"Do you want to save your changes?"),
|
||||
QMessageBox::Save | QMessageBox::Discard
|
||||
| QMessageBox::Cancel);
|
||||
| QMessageBox::Cancel);
|
||||
if (ret == QMessageBox::Save) {
|
||||
return saveFile("png");
|
||||
} else if (ret == QMessageBox::Cancel) {
|
||||
|
@ -94,6 +94,16 @@ void Window::createSpinBoxes()
|
||||
priceSpinBox->setValue(99);
|
||||
//! [4] //! [5]
|
||||
|
||||
groupSeparatorSpinBox = new QSpinBox;
|
||||
groupSeparatorSpinBox->setRange(-99999999, 99999999);
|
||||
groupSeparatorSpinBox->setValue(1000);
|
||||
groupSeparatorSpinBox->setGroupSeparatorShown(true);
|
||||
QCheckBox *groupSeparatorChkBox = new QCheckBox;
|
||||
groupSeparatorChkBox->setText(tr("Show group separator"));
|
||||
groupSeparatorChkBox->setChecked(true);
|
||||
connect(groupSeparatorChkBox, &QCheckBox::toggled, groupSeparatorSpinBox,
|
||||
&QSpinBox::setGroupSeparatorShown);
|
||||
|
||||
QLabel *hexLabel = new QLabel(tr("Enter a value between "
|
||||
"%1 and %2:").arg('-' + QString::number(31, 16)).arg(QString::number(31, 16)));
|
||||
QSpinBox *hexSpinBox = new QSpinBox;
|
||||
@ -111,6 +121,8 @@ void Window::createSpinBoxes()
|
||||
spinBoxLayout->addWidget(priceSpinBox);
|
||||
spinBoxLayout->addWidget(hexLabel);
|
||||
spinBoxLayout->addWidget(hexSpinBox);
|
||||
spinBoxLayout->addWidget(groupSeparatorChkBox);
|
||||
spinBoxLayout->addWidget(groupSeparatorSpinBox);
|
||||
spinBoxesGroup->setLayout(spinBoxLayout);
|
||||
}
|
||||
//! [5]
|
||||
@ -182,12 +194,12 @@ void Window::setFormatString(const QString &formatString)
|
||||
meetingEdit->setDateRange(QDate(2004, 11, 1), QDate(2005, 11, 30));
|
||||
meetingLabel->setText(tr("Meeting date (between %0 and %1):")
|
||||
.arg(meetingEdit->minimumDate().toString(Qt::ISODate))
|
||||
.arg(meetingEdit->maximumDate().toString(Qt::ISODate)));
|
||||
.arg(meetingEdit->maximumDate().toString(Qt::ISODate)));
|
||||
} else {
|
||||
meetingEdit->setTimeRange(QTime(0, 7, 20, 0), QTime(21, 0, 0, 0));
|
||||
meetingLabel->setText(tr("Meeting time (between %0 and %1):")
|
||||
.arg(meetingEdit->minimumTime().toString(Qt::ISODate))
|
||||
.arg(meetingEdit->maximumTime().toString(Qt::ISODate)));
|
||||
.arg(meetingEdit->maximumTime().toString(Qt::ISODate)));
|
||||
}
|
||||
}
|
||||
//! [13]
|
||||
@ -237,6 +249,17 @@ void Window::createDoubleSpinBoxes()
|
||||
//! [17]
|
||||
this, SLOT(changePrecision(int)));
|
||||
|
||||
groupSeparatorSpinBox_d = new QDoubleSpinBox;
|
||||
groupSeparatorSpinBox_d->setRange(-99999999, 99999999);
|
||||
groupSeparatorSpinBox_d->setDecimals(2);
|
||||
groupSeparatorSpinBox_d->setValue(1000.00);
|
||||
groupSeparatorSpinBox_d->setGroupSeparatorShown(true);
|
||||
QCheckBox *groupSeparatorChkBox = new QCheckBox;
|
||||
groupSeparatorChkBox->setText(tr("Show group separator"));
|
||||
groupSeparatorChkBox->setChecked(true);
|
||||
connect(groupSeparatorChkBox, &QCheckBox::toggled, groupSeparatorSpinBox_d,
|
||||
&QDoubleSpinBox::setGroupSeparatorShown);
|
||||
|
||||
//! [18]
|
||||
QVBoxLayout *spinBoxLayout = new QVBoxLayout;
|
||||
spinBoxLayout->addWidget(precisionLabel);
|
||||
@ -247,6 +270,8 @@ void Window::createDoubleSpinBoxes()
|
||||
spinBoxLayout->addWidget(scaleSpinBox);
|
||||
spinBoxLayout->addWidget(priceLabel);
|
||||
spinBoxLayout->addWidget(priceSpinBox);
|
||||
spinBoxLayout->addWidget(groupSeparatorChkBox);
|
||||
spinBoxLayout->addWidget(groupSeparatorSpinBox_d);
|
||||
doubleSpinBoxesGroup->setLayout(spinBoxLayout);
|
||||
}
|
||||
//! [18]
|
||||
|
@ -45,6 +45,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QDateTimeEdit;
|
||||
class QSpinBox;
|
||||
class QDoubleSpinBox;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
@ -75,6 +76,8 @@ private:
|
||||
QGroupBox *editsGroup;
|
||||
QGroupBox *doubleSpinBoxesGroup;
|
||||
QLabel *meetingLabel;
|
||||
QSpinBox *groupSeparatorSpinBox;
|
||||
QDoubleSpinBox *groupSeparatorSpinBox_d;
|
||||
};
|
||||
//! [0]
|
||||
|
||||
|
@ -109,9 +109,9 @@ void TetrixBoard::pause()
|
||||
|
||||
isPaused = !isPaused;
|
||||
if (isPaused) {
|
||||
timer.stop();
|
||||
timer.stop();
|
||||
} else {
|
||||
timer.start(timeoutTime(), this);
|
||||
timer.start(timeoutTime(), this);
|
||||
}
|
||||
update();
|
||||
//! [5] //! [6]
|
||||
@ -128,7 +128,7 @@ void TetrixBoard::paintEvent(QPaintEvent *event)
|
||||
//! [7]
|
||||
|
||||
if (isPaused) {
|
||||
painter.drawText(rect, Qt::AlignCenter, tr("Pause"));
|
||||
painter.drawText(rect, Qt::AlignCenter, tr("Pause"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ void TetrixBoard::paintEvent(QPaintEvent *event)
|
||||
for (int i = 0; i < BoardHeight; ++i) {
|
||||
for (int j = 0; j < BoardWidth; ++j) {
|
||||
TetrixShape shape = shapeAt(j, BoardHeight - i - 1);
|
||||
if (shape != NoShape)
|
||||
if (shape != NoShape)
|
||||
drawSquare(painter, rect.left() + j * squareWidth(),
|
||||
boardTop + i * squareHeight(), shape);
|
||||
}
|
||||
@ -165,7 +165,7 @@ void TetrixBoard::paintEvent(QPaintEvent *event)
|
||||
void TetrixBoard::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (!isStarted || isPaused || curPiece.shape() == NoShape) {
|
||||
QFrame::keyPressEvent(event);
|
||||
QFrame::keyPressEvent(event);
|
||||
return;
|
||||
}
|
||||
//! [13]
|
||||
@ -174,24 +174,24 @@ void TetrixBoard::keyPressEvent(QKeyEvent *event)
|
||||
switch (event->key()) {
|
||||
case Qt::Key_Left:
|
||||
tryMove(curPiece, curX - 1, curY);
|
||||
break;
|
||||
break;
|
||||
case Qt::Key_Right:
|
||||
tryMove(curPiece, curX + 1, curY);
|
||||
break;
|
||||
break;
|
||||
case Qt::Key_Down:
|
||||
tryMove(curPiece.rotatedRight(), curX, curY);
|
||||
break;
|
||||
break;
|
||||
case Qt::Key_Up:
|
||||
tryMove(curPiece.rotatedLeft(), curX, curY);
|
||||
break;
|
||||
break;
|
||||
case Qt::Key_Space:
|
||||
dropDown();
|
||||
break;
|
||||
dropDown();
|
||||
break;
|
||||
case Qt::Key_D:
|
||||
oneLineDown();
|
||||
break;
|
||||
oneLineDown();
|
||||
break;
|
||||
default:
|
||||
QFrame::keyPressEvent(event);
|
||||
QFrame::keyPressEvent(event);
|
||||
}
|
||||
//! [14]
|
||||
}
|
||||
@ -201,9 +201,9 @@ void TetrixBoard::timerEvent(QTimerEvent *event)
|
||||
{
|
||||
if (event->timerId() == timer.timerId()) {
|
||||
if (isWaitingAfterLine) {
|
||||
isWaitingAfterLine = false;
|
||||
newPiece();
|
||||
timer.start(timeoutTime(), this);
|
||||
isWaitingAfterLine = false;
|
||||
newPiece();
|
||||
timer.start(timeoutTime(), this);
|
||||
} else {
|
||||
oneLineDown();
|
||||
}
|
||||
@ -243,7 +243,7 @@ void TetrixBoard::dropDown()
|
||||
void TetrixBoard::oneLineDown()
|
||||
{
|
||||
if (!tryMove(curPiece, curX, curY - 1))
|
||||
pieceDropped(0);
|
||||
pieceDropped(0);
|
||||
}
|
||||
//! [21]
|
||||
|
||||
@ -290,24 +290,24 @@ void TetrixBoard::removeFullLines()
|
||||
|
||||
if (lineIsFull) {
|
||||
//! [24] //! [25]
|
||||
++numFullLines;
|
||||
for (int k = i; k < BoardHeight - 1; ++k) {
|
||||
++numFullLines;
|
||||
for (int k = i; k < BoardHeight - 1; ++k) {
|
||||
for (int j = 0; j < BoardWidth; ++j)
|
||||
shapeAt(j, k) = shapeAt(j, k + 1);
|
||||
}
|
||||
}
|
||||
//! [25] //! [26]
|
||||
for (int j = 0; j < BoardWidth; ++j)
|
||||
for (int j = 0; j < BoardWidth; ++j)
|
||||
shapeAt(j, BoardHeight - 1) = NoShape;
|
||||
}
|
||||
}
|
||||
//! [26] //! [27]
|
||||
}
|
||||
//! [27]
|
||||
|
||||
//! [28]
|
||||
if (numFullLines > 0) {
|
||||
numLinesRemoved += numFullLines;
|
||||
score += 10 * numFullLines;
|
||||
emit linesRemovedChanged(numLinesRemoved);
|
||||
numLinesRemoved += numFullLines;
|
||||
score += 10 * numFullLines;
|
||||
emit linesRemovedChanged(numLinesRemoved);
|
||||
emit scoreChanged(score);
|
||||
|
||||
timer.start(500, this);
|
||||
@ -329,7 +329,7 @@ void TetrixBoard::newPiece()
|
||||
curY = BoardHeight - 1 + curPiece.minY();
|
||||
|
||||
if (!tryMove(curPiece, curX, curY)) {
|
||||
curPiece.setShape(NoShape);
|
||||
curPiece.setShape(NoShape);
|
||||
timer.stop();
|
||||
isStarted = false;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ void WigglyWidget::paintEvent(QPaintEvent * /* event */)
|
||||
//! [1] //! [2]
|
||||
{
|
||||
static const int sineTable[16] = {
|
||||
0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38
|
||||
0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38
|
||||
};
|
||||
|
||||
QFontMetrics metrics(font());
|
||||
@ -94,7 +94,7 @@ void WigglyWidget::timerEvent(QTimerEvent *event)
|
||||
++step;
|
||||
update();
|
||||
} else {
|
||||
QWidget::timerEvent(event);
|
||||
QWidget::timerEvent(event);
|
||||
}
|
||||
//! [6]
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ QMAKE_LINK_SHLIB = $$QMAKE_CXX
|
||||
CONFIG += clang_pch_style
|
||||
QMAKE_PCH_OUTPUT_EXT = .pch
|
||||
|
||||
QMAKE_CFLAGS_ISYSTEM = -isystem
|
||||
QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
|
||||
QMAKE_CFLAGS_USE_PRECOMPILE = -Xclang -include-pch -Xclang ${QMAKE_PCH_OUTPUT}
|
||||
QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
|
||||
|
@ -40,6 +40,7 @@ QMAKE_CFLAGS_DEBUG += -g
|
||||
QMAKE_CFLAGS_SHLIB += -fPIC
|
||||
QMAKE_CFLAGS_STATIC_LIB += -fPIC
|
||||
QMAKE_CFLAGS_APP += -fPIE
|
||||
QMAKE_CFLAGS_ISYSTEM = -isystem
|
||||
QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses
|
||||
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
|
||||
QMAKE_CFLAGS_EXCEPTIONS_OFF += -fno-exceptions
|
||||
|
@ -87,7 +87,7 @@
|
||||
|
||||
#define QT_SIGNAL_IGNORE (void (*)(int))1
|
||||
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
|
||||
#endif // QPLATFORMDEFS_H
|
||||
|
@ -63,48 +63,48 @@
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef QT_LARGEFILE_SUPPORT
|
||||
#define QT_STATBUF struct _stati64 // non-ANSI defs
|
||||
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
|
||||
#define QT_STAT ::_stati64
|
||||
#define QT_FSTAT ::_fstati64
|
||||
#define QT_STATBUF struct _stati64 // non-ANSI defs
|
||||
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
|
||||
#define QT_STAT ::_stati64
|
||||
#define QT_FSTAT ::_fstati64
|
||||
#else
|
||||
#define QT_STATBUF struct stat // non-ANSI defs
|
||||
#define QT_STATBUF4TSTAT struct stat // non-ANSI defs
|
||||
#define QT_STAT ::qt_wince_stat
|
||||
#define QT_FSTAT ::qt_wince__fstat
|
||||
#define QT_STATBUF struct stat // non-ANSI defs
|
||||
#define QT_STATBUF4TSTAT struct stat // non-ANSI defs
|
||||
#define QT_STAT ::qt_wince_stat
|
||||
#define QT_FSTAT ::qt_wince__fstat
|
||||
#endif
|
||||
#define QT_STAT_REG _S_IFREG
|
||||
#define QT_STAT_DIR _S_IFDIR
|
||||
#define QT_STAT_MASK _S_IFMT
|
||||
#define QT_STAT_REG _S_IFREG
|
||||
#define QT_STAT_DIR _S_IFDIR
|
||||
#define QT_STAT_MASK _S_IFMT
|
||||
#if defined(_S_IFLNK)
|
||||
# define QT_STAT_LNK _S_IFLNK
|
||||
# define QT_STAT_LNK _S_IFLNK
|
||||
#endif
|
||||
#define QT_FILENO ::qt_wince___fileno
|
||||
#define QT_OPEN ::qt_wince_open
|
||||
#define QT_CLOSE ::qt_wince__close
|
||||
#define QT_FILENO ::qt_wince___fileno
|
||||
#define QT_OPEN ::qt_wince_open
|
||||
#define QT_CLOSE ::qt_wince__close
|
||||
#ifdef QT_LARGEFILE_SUPPORT
|
||||
#define QT_LSEEK ::_lseeki64
|
||||
#define QT_TSTAT ::_tstati64
|
||||
#define QT_LSEEK ::_lseeki64
|
||||
#define QT_TSTAT ::_tstati64
|
||||
#else
|
||||
#define QT_LSEEK ::qt_wince__lseek
|
||||
#define QT_TSTAT ::_tstat
|
||||
#define QT_LSEEK ::qt_wince__lseek
|
||||
#define QT_TSTAT ::_tstat
|
||||
#endif
|
||||
#define QT_READ ::qt_wince__read
|
||||
#define QT_WRITE ::qt_wince__write
|
||||
#define QT_ACCESS ::qt_wince__access
|
||||
#define QT_GETCWD ::_getcwd
|
||||
#define QT_CHDIR ::_chdir
|
||||
#define QT_MKDIR ::qt_wince__mkdir
|
||||
#define QT_RMDIR ::qt_wince__rmdir
|
||||
#define QT_OPEN_LARGEFILE 0
|
||||
#define QT_OPEN_RDONLY _O_RDONLY
|
||||
#define QT_OPEN_WRONLY _O_WRONLY
|
||||
#define QT_OPEN_RDWR _O_RDWR
|
||||
#define QT_OPEN_CREAT _O_CREAT
|
||||
#define QT_OPEN_TRUNC _O_TRUNC
|
||||
#define QT_OPEN_APPEND _O_APPEND
|
||||
# define QT_OPEN_TEXT _O_TEXT
|
||||
# define QT_OPEN_BINARY _O_BINARY
|
||||
#define QT_READ ::qt_wince__read
|
||||
#define QT_WRITE ::qt_wince__write
|
||||
#define QT_ACCESS ::qt_wince__access
|
||||
#define QT_GETCWD ::_getcwd
|
||||
#define QT_CHDIR ::_chdir
|
||||
#define QT_MKDIR ::qt_wince__mkdir
|
||||
#define QT_RMDIR ::qt_wince__rmdir
|
||||
#define QT_OPEN_LARGEFILE 0
|
||||
#define QT_OPEN_RDONLY _O_RDONLY
|
||||
#define QT_OPEN_WRONLY _O_WRONLY
|
||||
#define QT_OPEN_RDWR _O_RDWR
|
||||
#define QT_OPEN_CREAT _O_CREAT
|
||||
#define QT_OPEN_TRUNC _O_TRUNC
|
||||
#define QT_OPEN_APPEND _O_APPEND
|
||||
# define QT_OPEN_TEXT _O_TEXT
|
||||
# define QT_OPEN_BINARY _O_BINARY
|
||||
|
||||
#define QT_FOPEN ::fopen
|
||||
#define QT_FSEEK ::fseek
|
||||
@ -115,17 +115,17 @@
|
||||
#define QT_FPOS_T fpos_t
|
||||
#define QT_OFF_T long
|
||||
|
||||
#define QT_SIGNAL_ARGS int
|
||||
#define QT_SIGNAL_ARGS int
|
||||
|
||||
#define QT_VSNPRINTF(buffer, count, format, arg) \
|
||||
_vsnprintf(buffer, count, format, arg)
|
||||
|
||||
#define QT_SNPRINTF ::_snprintf
|
||||
#define QT_SNPRINTF ::_snprintf
|
||||
|
||||
# define F_OK 0
|
||||
# define X_OK 1
|
||||
# define W_OK 2
|
||||
# define R_OK 4
|
||||
# define F_OK 0
|
||||
# define X_OK 1
|
||||
# define W_OK 2
|
||||
# define R_OK 4
|
||||
|
||||
typedef int mode_t;
|
||||
|
||||
|
BIN
mkspecs/common/winrt_winphone/assets/logo_large.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
mkspecs/common/winrt_winphone/assets/logo_medium.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
mkspecs/common/winrt_winphone/assets/logo_small.png
Normal file
After Width: | Height: | Size: 737 B |
BIN
mkspecs/common/winrt_winphone/assets/logo_splash.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
mkspecs/common/winrt_winphone/assets/logo_store.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
mkspecs/common/winrt_winphone/assets/tile_iconic_medium.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
mkspecs/common/winrt_winphone/assets/tile_iconic_small.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1,39 @@
|
||||
<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
||||
<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\">
|
||||
<Identity
|
||||
Name=\"$${WINRT_MANIFEST.identity}\"
|
||||
ProcessorArchitecture=\"$${WINRT_MANIFEST.architecture}\"
|
||||
Publisher=\"$${WINRT_MANIFEST.publisherid}\"
|
||||
Version=\"$${WINRT_MANIFEST.version}\" />
|
||||
<Properties>
|
||||
<DisplayName>$${WINRT_MANIFEST.name}</DisplayName>
|
||||
<PublisherDisplayName>$${WINRT_MANIFEST.publisher}</PublisherDisplayName>
|
||||
<Logo>$${WINRT_MANIFEST.logo_store}</Logo>
|
||||
</Properties>
|
||||
<Prerequisites>
|
||||
<OSMinVersion>6.2.0</OSMinVersion>
|
||||
<OSMaxVersionTested>6.3.0</OSMaxVersionTested>
|
||||
</Prerequisites>
|
||||
<Resources>
|
||||
<Resource Language=\"en\" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application
|
||||
Id=\"App\"
|
||||
Executable=\"$${WINRT_MANIFEST.target}.exe\"
|
||||
EntryPoint=\"$${WINRT_MANIFEST.target}.App\">
|
||||
<VisualElements
|
||||
DisplayName=\"$${WINRT_MANIFEST.name}\"
|
||||
Logo=\"$${WINRT_MANIFEST.logo_large}\"
|
||||
SmallLogo=\"$${WINRT_MANIFEST.logo_small}\"
|
||||
Description=\"$${WINRT_MANIFEST.description}\"
|
||||
BackgroundColor=\"$${WINRT_MANIFEST.background}\"
|
||||
ForegroundText=\"$${WINRT_MANIFEST.foreground}\">
|
||||
<SplashScreen Image=\"$${WINRT_MANIFEST.logo_splash}\" />
|
||||
</VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>$${WINRT_MANIFEST.capabilities}</Capabilities>
|
||||
<Dependencies>$${WINRT_MANIFEST.dependencies}</Dependencies>
|
||||
</Package>
|
||||
<!-- Generated by qmake using the $$[QMAKE_XSPEC] mkspec. Remove this line to prevent this file from getting overwritten by qmake. -->
|
@ -0,0 +1,39 @@
|
||||
<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
||||
<Deployment xmlns=\"http://schemas.microsoft.com/windowsphone/2012/deployment\" AppPlatformVersion=\"8.0\">
|
||||
<DefaultLanguage xmlns=\"\" code=\"en-US\" />
|
||||
<App xmlns=\"\"
|
||||
ProductID=\"$${WINRT_MANIFEST.identity}\"
|
||||
Title=\"$${WINRT_MANIFEST.name}\"
|
||||
RuntimeType=\"Modern Native\"
|
||||
Version=\"$${WINRT_MANIFEST.version}\"
|
||||
Genre=\"$${WINRT_MANIFEST.genre}\"
|
||||
Author=\"$${WINRT_MANIFEST.author}\"
|
||||
Description=\"$${WINRT_MANIFEST.description}\"
|
||||
Publisher=\"$${WINRT_MANIFEST.publisher}\"
|
||||
PublisherID=\"$${WINRT_MANIFEST.publisherid}\">
|
||||
<IconPath IsRelative=\"true\" IsResource=\"false\">$${WINRT_MANIFEST.logo_medium}</IconPath>
|
||||
<Capabilities>$${WINRT_MANIFEST.capabilities}</Capabilities>
|
||||
<Tasks>
|
||||
<DefaultTask
|
||||
Name=\"_default\"
|
||||
ImagePath=\"$${WINRT_MANIFEST.target}.exe\"
|
||||
ImageParams=\"$${WINRT_MANIFEST.arguments}\" />
|
||||
</Tasks>
|
||||
<Tokens>
|
||||
<PrimaryToken TokenID=\"$${WINRT_MANIFEST.target}\" TaskName=\"_default\">
|
||||
<TemplateIconic>
|
||||
<SmallImageURI IsRelative=\"true\" IsResource=\"false\">$${WINRT_MANIFEST.tile_iconic_small}</SmallImageURI>
|
||||
<IconImageURI IsRelative=\"true\" IsResource=\"false\">$${WINRT_MANIFEST.tile_iconic_medium}</IconImageURI>
|
||||
<Title>$${WINRT_MANIFEST.name}</Title>
|
||||
<BackgroundColor>$${WINRT_MANIFEST.background}</BackgroundColor>
|
||||
</TemplateIconic>
|
||||
</PrimaryToken>
|
||||
</Tokens>
|
||||
<ScreenResolutions>
|
||||
<ScreenResolution Name=\"ID_RESOLUTION_WVGA\" />
|
||||
<ScreenResolution Name=\"ID_RESOLUTION_WXGA\" />
|
||||
<ScreenResolution Name=\"ID_RESOLUTION_HD720P\" />
|
||||
</ScreenResolutions>
|
||||
</App>
|
||||
</Deployment>
|
||||
<!-- Generated by qmake using the $$[QMAKE_XSPEC] mkspec. Remove this line to prevent this file from getting overwritten by qmake. -->
|
@ -0,0 +1,44 @@
|
||||
<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
||||
<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:v2=\"http://schemas.microsoft.com/appx/2013/manifest\">
|
||||
<Identity
|
||||
Name=\"$${WINRT_MANIFEST.identity}\"
|
||||
ProcessorArchitecture=\"$${WINRT_MANIFEST.architecture}\"
|
||||
Publisher=\"$${WINRT_MANIFEST.publisherid}\"
|
||||
Version=\"$${WINRT_MANIFEST.version}\" />
|
||||
<Properties>
|
||||
<DisplayName>$${WINRT_MANIFEST.name}</DisplayName>
|
||||
<PublisherDisplayName>$${WINRT_MANIFEST.publisher}</PublisherDisplayName>
|
||||
<Logo>$${WINRT_MANIFEST.logo_store}</Logo>
|
||||
</Properties>
|
||||
<Prerequisites>
|
||||
<OSMinVersion>6.3.0</OSMinVersion>
|
||||
<OSMaxVersionTested>6.3.0</OSMaxVersionTested>
|
||||
</Prerequisites>
|
||||
<Resources>
|
||||
<Resource Language=\"en\" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application
|
||||
Id=\"App\"
|
||||
Executable=\"$${WINRT_MANIFEST.target}.exe\"
|
||||
EntryPoint=\"$${WINRT_MANIFEST.target}.App\">
|
||||
<v2:VisualElements
|
||||
DisplayName=\"$${WINRT_MANIFEST.name}\"
|
||||
Description=\"$${WINRT_MANIFEST.description}\"
|
||||
BackgroundColor=\"$${WINRT_MANIFEST.background}\"
|
||||
ForegroundText=\"$${WINRT_MANIFEST.foreground}\"
|
||||
Square150x150Logo=\"$${WINRT_MANIFEST.logo_large}\"
|
||||
Square30x30Logo=\"$${WINRT_MANIFEST.logo_small}\">
|
||||
<v2:DefaultTile>
|
||||
<v2:ShowNameOnTiles>
|
||||
<v2:ShowOn Tile=\"square150x150Logo\" />
|
||||
</v2:ShowNameOnTiles>
|
||||
</v2:DefaultTile>
|
||||
<v2:SplashScreen Image=\"$${WINRT_MANIFEST.logo_splash}\" />
|
||||
</v2:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>$${WINRT_MANIFEST.capabilities}</Capabilities>
|
||||
<Dependencies>$${WINRT_MANIFEST.dependencies}</Dependencies>
|
||||
</Package>
|
||||
<!-- Generated by qmake using the $$[QMAKE_XSPEC] mkspec. Remove this line to prevent this file from getting overwritten by qmake. -->
|
@ -1,16 +1,15 @@
|
||||
#
|
||||
# qmake configuration for winrt and windows phone 8
|
||||
#
|
||||
# Written for Microsoft Visual C++ 2012
|
||||
# Written for Microsoft Visual C++
|
||||
#
|
||||
|
||||
MAKEFILE_GENERATOR = MSBUILD
|
||||
QMAKE_COMPILER = msvc
|
||||
QMAKE_PLATFORM = winrt win32
|
||||
CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target no_generated_target_info autogen_wmappmanifest rtti
|
||||
DEFINES += UNICODE WINRT QT_LARGEFILE_SUPPORT Q_BYTE_ORDER=Q_LITTLE_ENDIAN \
|
||||
CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target no_generated_target_info package_manifest rtti
|
||||
DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT Q_BYTE_ORDER=Q_LITTLE_ENDIAN \
|
||||
QT_NO_PRINTER QT_NO_PRINTDIALOG # TODO: Remove when printing is re-enabled
|
||||
QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WINRT
|
||||
|
||||
DEPLOYMENT_PLUGIN += qwinrt
|
||||
|
||||
@ -19,7 +18,6 @@ QMAKE_LEX = flex
|
||||
QMAKE_LEXFLAGS =
|
||||
QMAKE_YACC = byacc
|
||||
QMAKE_YACCFLAGS = -d
|
||||
#QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t-
|
||||
QMAKE_CFLAGS = -nologo -Zm200
|
||||
QMAKE_CFLAGS_WARN_ON = -W3
|
||||
QMAKE_CFLAGS_WARN_OFF = -W0
|
||||
@ -64,22 +62,24 @@ QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ $<
|
||||
QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
|
||||
|
||||
QMAKE_LINK = link
|
||||
QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /NODEFAULTLIB:ole32.lib
|
||||
QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /NODEFAULTLIB:ole32.lib /APPCONTAINER
|
||||
QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
|
||||
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
|
||||
QMAKE_LFLAGS_DEBUG = /DEBUG
|
||||
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE
|
||||
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS
|
||||
QMAKE_LFLAGS_EXE = /WINMD /MANIFEST:NO
|
||||
QMAKE_LFLAGS_DLL = /WINMD /MANIFEST:NO /DLL /WINMDFILE:$(DESTDIR_TARGET).winmd
|
||||
QMAKE_LFLAGS_EXE = /MANIFEST:NO
|
||||
QMAKE_LFLAGS_DLL = /MANIFEST:NO /DLL
|
||||
QMAKE_LFLAGS_LTCG = /LTCG
|
||||
QMAKE_EXTENSION_STATICLIB = lib
|
||||
|
||||
QMAKE_LIBS += runtimeobject.lib
|
||||
QMAKE_LIBS_CORE =
|
||||
QMAKE_LIBS_GUI = d3d11.lib
|
||||
QMAKE_LIBS_GUI =
|
||||
QMAKE_LIBS_NETWORK =
|
||||
QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib
|
||||
QMAKE_LIBS_OPENGL_ES2_DEBUG = libEGLd.lib libGLESv2d.lib
|
||||
|
||||
QMAKE_LIBS_QT_ENTRY = -lqtmain /ENTRY:wmainCRTStartup
|
||||
QMAKE_LIBS_QT_ENTRY = -lqtmain
|
||||
|
||||
QMAKE_IDL = midl
|
||||
QMAKE_LIB = lib /NOLOGO
|
||||
@ -89,5 +89,6 @@ include(../shell-win32.conf)
|
||||
|
||||
VCPROJ_EXTENSION = .vcxproj
|
||||
VCSOLUTION_EXTENSION = .sln
|
||||
VCPROJ_KEYWORD = Qt4VSv1.0
|
||||
VCPROJ_KEYWORD = Qt4VSv1.0
|
||||
WINRT_ASSETS_PATH = $$PWD/assets
|
||||
load(qt_config)
|
||||
|
141
mkspecs/common/winrt_winphone/qplatformdefs.h
Normal file
@ -0,0 +1,141 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the qmake spec 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 Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QPLATFORMDEFS_H
|
||||
#define QPLATFORMDEFS_H
|
||||
|
||||
#ifdef UNICODE
|
||||
#ifndef _UNICODE
|
||||
#define _UNICODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Get Qt defines/settings
|
||||
|
||||
#include "qglobal.h"
|
||||
#include "qfunctions_winrt.h"
|
||||
|
||||
#define _POSIX_
|
||||
#include <limits.h>
|
||||
#undef _POSIX_
|
||||
|
||||
#include <tchar.h>
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef QT_LARGEFILE_SUPPORT
|
||||
#define QT_STATBUF struct _stati64 // non-ANSI defs
|
||||
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
|
||||
#define QT_STAT ::_stati64
|
||||
#define QT_FSTAT ::_fstati64
|
||||
#else
|
||||
#define QT_STATBUF struct _stat // non-ANSI defs
|
||||
#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
|
||||
#define QT_STAT ::_stat
|
||||
#define QT_FSTAT ::_fstat
|
||||
#endif
|
||||
#define QT_STAT_REG _S_IFREG
|
||||
#define QT_STAT_DIR _S_IFDIR
|
||||
#define QT_STAT_MASK _S_IFMT
|
||||
#if defined(_S_IFLNK)
|
||||
# define QT_STAT_LNK _S_IFLNK
|
||||
#endif
|
||||
#define QT_FILENO _fileno
|
||||
#define QT_OPEN ::_open
|
||||
#define QT_CLOSE ::_close
|
||||
#ifdef QT_LARGEFILE_SUPPORT
|
||||
#define QT_LSEEK ::_lseeki64
|
||||
#define QT_TSTAT ::_tstati64
|
||||
#else
|
||||
#define QT_LSEEK ::_lseek
|
||||
#define QT_TSTAT ::_tstat
|
||||
#endif
|
||||
#define QT_READ ::_read
|
||||
#define QT_WRITE ::_write
|
||||
#define QT_ACCESS ::_access
|
||||
#define QT_GETCWD ::_getcwd
|
||||
#define QT_CHDIR ::_chdir
|
||||
#define QT_MKDIR ::_mkdir
|
||||
#define QT_RMDIR ::_rmdir
|
||||
#define QT_OPEN_LARGEFILE 0
|
||||
#define QT_OPEN_RDONLY _O_RDONLY
|
||||
#define QT_OPEN_WRONLY _O_WRONLY
|
||||
#define QT_OPEN_RDWR _O_RDWR
|
||||
#define QT_OPEN_CREAT _O_CREAT
|
||||
#define QT_OPEN_TRUNC _O_TRUNC
|
||||
#define QT_OPEN_APPEND _O_APPEND
|
||||
#if defined(O_TEXT)
|
||||
# define QT_OPEN_TEXT _O_TEXT
|
||||
# define QT_OPEN_BINARY _O_BINARY
|
||||
#endif
|
||||
|
||||
#include "../common/c89/qplatformdefs.h"
|
||||
|
||||
#ifdef QT_LARGEFILE_SUPPORT
|
||||
#undef QT_FSEEK
|
||||
#undef QT_FTELL
|
||||
#undef QT_OFF_T
|
||||
|
||||
#define QT_FSEEK ::_fseeki64
|
||||
#define QT_FTELL ::_ftelli64
|
||||
#define QT_OFF_T __int64
|
||||
#endif
|
||||
|
||||
#define QT_SIGNAL_ARGS int
|
||||
|
||||
#define QT_VSNPRINTF(buffer, count, format, arg) \
|
||||
vsnprintf_s(buffer, count, count-1, format, arg)
|
||||
|
||||
#define QT_SNPRINTF ::_snprintf
|
||||
|
||||
# define F_OK 0
|
||||
# define X_OK 1
|
||||
# define W_OK 2
|
||||
# define R_OK 4
|
||||
|
||||
typedef int mode_t;
|
||||
|
||||
#endif // QPLATFORMDEFS_H
|
@ -73,7 +73,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
// Cygwin does not provide <sys/ipc.h> and <sys/shm.h> because it
|
||||
// doesn't support SysV IPC or shared memory. See for example:
|
||||
// http://afni.nimh.nih.gov/afni/afniboard/messages/1725.html
|
||||
// http://afni.nimh.nih.gov/afni/afniboard/messages/1725.html
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
@ -88,8 +88,8 @@
|
||||
#define QT_OPEN_LARGEFILE 0
|
||||
|
||||
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
#endif
|
||||
|
||||
#endif // QPLATFORMDEFS_H
|
||||
|
@ -79,7 +79,7 @@
|
||||
#undef QT_OPEN_LARGEFILE
|
||||
#define QT_OPEN_LARGEFILE 0
|
||||
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
|
||||
#endif // QPLATFORMDEFS_H
|
||||
|
@ -40,7 +40,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qeglfshooks.h"
|
||||
#include "qeglfscursor.h"
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
@ -107,12 +106,6 @@ static void moveDispmanxLayer(EGLNativeWindowType window, const QPoint &pos)
|
||||
dst_rect.width = size.width();
|
||||
dst_rect.height = size.height();
|
||||
|
||||
VC_RECT_T src_rect;
|
||||
src_rect.x = 0;
|
||||
src_rect.y = 0;
|
||||
src_rect.width = size.width() << 16;
|
||||
src_rect.height = size.height() << 16;
|
||||
|
||||
DISPMANX_UPDATE_HANDLE_T dispman_update = vc_dispmanx_update_start(0);
|
||||
vc_dispmanx_element_change_attributes(dispman_update,
|
||||
eglWindow->element,
|
||||
|
@ -6,9 +6,7 @@
|
||||
# A typical configure line looks like this:
|
||||
# <path-to-qt-src>/configure -opensource -confirm-license -make libs -prefix /usr/local/Qt-5.0.0/Qt5-tegra2
|
||||
# -device tegra2 -device-option CROSS_COMPILE=<path-to-crosstoolchain>/bin/arm-none-linux-gnueabi- \
|
||||
# -sysroot <path-to-rootfs> -no-neon
|
||||
|
||||
# CAUTION: The Tegra2 chips don't support neon, make sure it will not be used (-no-neon)
|
||||
# -sysroot <path-to-rootfs>
|
||||
|
||||
include(../common/linux_device_pre.conf)
|
||||
|
||||
|
@ -53,6 +53,12 @@ defineTest(qtCompileTest) {
|
||||
# Disable qmake features which are typically counterproductive for tests
|
||||
qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\""
|
||||
|
||||
# On WinRT we need to change the entry point as we cannot create windows
|
||||
# applications
|
||||
winrt {
|
||||
qmake_configs += " \"QMAKE_LFLAGS+=/ENTRY:main\""
|
||||
}
|
||||
|
||||
# Clean up after previous run
|
||||
exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")
|
||||
|
||||
|
@ -195,7 +195,7 @@ mac {
|
||||
CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.dll
|
||||
CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll
|
||||
|
||||
win32-g++ {
|
||||
mingw {
|
||||
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}d.a
|
||||
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a
|
||||
|
||||
|
@ -51,7 +51,7 @@ load(cmake_functions)
|
||||
|
||||
CMAKE_BUILD_TYPE = Debug
|
||||
CONFIG(release, debug|release):CMAKE_BUILD_TYPE = Release
|
||||
win32-g++*:isEmpty(CROSS_COMPILE):CMAKE_GENERATOR = -G \"MinGW Makefiles\"
|
||||
mingw:isEmpty(CROSS_COMPILE):CMAKE_GENERATOR = -G \"MinGW Makefiles\"
|
||||
win32:equals(QT_ARCH, x86_64) {
|
||||
win32-msvc2010:CMAKE_GENERATOR = -G \"Visual Studio 10 Win64\"
|
||||
win32-msvc2012:CMAKE_GENERATOR = -G \"Visual Studio 11 Win64\"
|
||||
|
@ -82,5 +82,7 @@ breakpad {
|
||||
!isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote($$QMAKE_STRIP $$DEBUGFILENAME)
|
||||
}
|
||||
|
||||
!precompile_header: SOURCES += $$NO_PCH_SOURCES
|
||||
|
||||
QMAKE_INCDIR += $$QMAKE_INCDIR_POST
|
||||
QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST
|
||||
|
@ -15,8 +15,26 @@ qt:!isEmpty(QT_CONFIG) {
|
||||
contains(QT_CONFIG, x86_64):!contains(QT_CONFIG, x86):CONFIG += x86_64
|
||||
}
|
||||
|
||||
# Ensure that C++11 is always used when linking against a static Qt build
|
||||
contains(QT_CONFIG, static):contains(QT_CONFIG, c++11): CONFIG += c++11
|
||||
contains(QT_CONFIG, static) {
|
||||
# C++11 support means using libc++ instead of libstd++. As the
|
||||
# two libraries are incompatible we need to ensure the end user
|
||||
# project is built using the same C++11 support/no support as Qt.
|
||||
contains(QT_CONFIG, c++11) {
|
||||
CONFIG += c++11
|
||||
} else: c++11 {
|
||||
warning("Qt was not built with C++11 enabled, disabling feature")
|
||||
CONFIG -= c++11
|
||||
}
|
||||
|
||||
!c++11 {
|
||||
# Explicitly use libstdc++ if C++11 support is not enabled,
|
||||
# as otherwise the compiler will choose the standard library
|
||||
# based on the deployment target, which for iOS 7 and OS X 10.9
|
||||
# is libc++, and we can't mix and match the two.
|
||||
QMAKE_CXXFLAGS += -stdlib=libstdc++
|
||||
QMAKE_LFLAGS += -stdlib=libstdc++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
|
||||
|
@ -5,49 +5,36 @@ isEmpty(MOC_DIR):MOC_DIR = .
|
||||
isEmpty(QMAKE_H_MOD_MOC):QMAKE_H_MOD_MOC = moc_
|
||||
isEmpty(QMAKE_EXT_CPP_MOC):QMAKE_EXT_CPP_MOC = .moc
|
||||
|
||||
MOC_INCLUDEPATH =
|
||||
for (inc, INCLUDEPATH): \
|
||||
MOC_INCLUDEPATH += $$absolute_path($$inc, $$_PRO_FILE_PWD_)
|
||||
!no_include_pwd:!isEqual(OUT_PWD, $$_PRO_FILE_PWD_): \
|
||||
MOC_INCLUDEPATH += .
|
||||
MOC_INCLUDEPATH = $$QMAKESPEC $$_PRO_FILE_PWD_ $$MOC_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS
|
||||
|
||||
# On Windows, put the includes into a .inc file which moc will read, if the project
|
||||
# has too many includes. We do this to overcome a command-line limit on Win < XP
|
||||
INCLUDETEMP=
|
||||
WIN_INCLUDETEMP=
|
||||
win32:count(INCLUDEPATH, 40, >) {
|
||||
INCLUDETEMP = $$MOC_DIR/mocinclude.tmp
|
||||
win32:count(MOC_INCLUDEPATH, 40, >) {
|
||||
WIN_INCLUDETEMP = $$MOC_DIR/mocinclude.tmp
|
||||
|
||||
WIN_INCLUDETEMP=$$INCLUDETEMP
|
||||
|
||||
EOC = $$escape_expand(\\n\\t)
|
||||
|
||||
contains(TEMPLATE, "vc.*") {
|
||||
# the VCPROJ generator will replace the \r\h with the coded \r\n: 

|
||||
EOC = $$escape_expand(\\r\\h)
|
||||
}
|
||||
|
||||
unset(INCFILELIST)
|
||||
RET =
|
||||
for(incfile, INCLUDEPATH) {
|
||||
INCFILELIST = -I$$incfile
|
||||
isEmpty(RET): RET += @echo $$INCFILELIST> $$WIN_INCLUDETEMP $$EOC
|
||||
else: RET += @echo $$INCFILELIST>> $$WIN_INCLUDETEMP $$EOC
|
||||
}
|
||||
!isEmpty(INCFILELIST):RET += @echo $$INCFILELIST>> $$WIN_INCLUDETEMP $$EOC
|
||||
|
||||
build_pass|isEmpty(BUILDS) {
|
||||
mocinclude.target = $$INCLUDETEMP
|
||||
mocinclude.commands = $$RET
|
||||
QMAKE_EXTRA_TARGETS += mocinclude
|
||||
}
|
||||
WIN_INCLUDETEMP_CONT =
|
||||
for (inc, MOC_INCLUDEPATH): \
|
||||
WIN_INCLUDETEMP_CONT += -I$$inc
|
||||
write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONT)|error("Aborting.")
|
||||
}
|
||||
|
||||
defineReplace(mocCmdBase) {
|
||||
RET =
|
||||
!isEmpty(WIN_INCLUDETEMP) {
|
||||
contains(TEMPLATE, "vc.*") {
|
||||
RET += $$mocinclude.commands
|
||||
}
|
||||
incvar = @$$WIN_INCLUDETEMP
|
||||
} else {
|
||||
incvar = $(INCPATH)
|
||||
incvar =
|
||||
for (inc, MOC_INCLUDEPATH): \
|
||||
incvar += -I$$shell_quote($$inc)
|
||||
incvar += $$QMAKE_FRAMEWORKPATH_FLAGS
|
||||
}
|
||||
RET += $$QMAKE_MOC $(DEFINES) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$incvar $$join(QMAKE_DEFAULT_INCDIRS, " -I", -I) $$QMAKE_MOC_OPTIONS
|
||||
RET += $$QMAKE_MOC $(DEFINES) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$incvar $$QMAKE_MOC_OPTIONS
|
||||
return($$RET)
|
||||
}
|
||||
|
||||
@ -59,9 +46,7 @@ moc_header.output = $$MOC_DIR/$${QMAKE_H_MOD_MOC}${QMAKE_FILE_BASE}$${first(QMAK
|
||||
moc_header.input = HEADERS
|
||||
moc_header.variable_out = SOURCES
|
||||
moc_header.name = MOC ${QMAKE_FILE_IN}
|
||||
!contains(TEMPLATE, "vc.*") {
|
||||
!isEmpty(INCLUDETEMP):moc_header.depends += $$INCLUDETEMP
|
||||
}
|
||||
moc_header.depends += $$WIN_INCLUDETEMP
|
||||
silent:moc_header.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_header.commands
|
||||
QMAKE_EXTRA_COMPILERS += moc_header
|
||||
INCREDIBUILD_XGE += moc_header
|
||||
@ -73,9 +58,7 @@ moc_source.commands = ${QMAKE_FUNC_mocCmdBase} ${QMAKE_FILE_IN} -o ${QMAKE_FILE_
|
||||
moc_source.output = $$MOC_DIR/$${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_EXT_CPP_MOC}
|
||||
moc_source.input = SOURCES OBJECTIVE_SOURCES
|
||||
moc_source.name = MOC ${QMAKE_FILE_IN}
|
||||
!contains(TEMPLATE, "vc.*") {
|
||||
!isEmpty(INCLUDETEMP):moc_source.depends += $$INCLUDETEMP
|
||||
}
|
||||
moc_source.depends += $$WIN_INCLUDETEMP
|
||||
silent:moc_source.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_source.commands
|
||||
QMAKE_EXTRA_COMPILERS += moc_source
|
||||
INCREDIBUILD_XGE += moc_source
|
||||
|
24
mkspecs/features/precompile_header.prf
Normal file
@ -0,0 +1,24 @@
|
||||
#
|
||||
# W A R N I N G
|
||||
# -------------
|
||||
#
|
||||
# This file is not part of the Qt API. It exists purely as an
|
||||
# implementation detail. It may change from version to version
|
||||
# without notice, or even be removed.
|
||||
#
|
||||
# We mean it.
|
||||
#
|
||||
|
||||
#
|
||||
# Set up extra compiler for PCH disabled sources
|
||||
#
|
||||
no_pch_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN}
|
||||
msvc: no_pch_compiler.commands += -Fo${QMAKE_FILE_OUT}
|
||||
else: no_pch_compiler.commands += -o ${QMAKE_FILE_OUT}
|
||||
no_pch_compiler.dependency_type = TYPE_C
|
||||
no_pch_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
|
||||
no_pch_compiler.input = NO_PCH_SOURCES
|
||||
no_pch_compiler.variable_out = OBJECTS
|
||||
no_pch_compiler.name = compiling[no_pch] ${QMAKE_FILE_IN}
|
||||
silent: no_pch_compiler.commands = @echo compiling[no_pch] ${QMAKE_FILE_IN} && $$no_pch_compiler.commands
|
||||
QMAKE_EXTRA_COMPILERS += no_pch_compiler
|
49
mkspecs/features/qlalr.prf
Normal file
@ -0,0 +1,49 @@
|
||||
qtPrepareTool(QMAKE_QLALR, qlalr)
|
||||
|
||||
isEmpty(QLALR_DIR): QLALR_DIR = .
|
||||
|
||||
!isEmpty(QLALRSOURCES) {
|
||||
INCLUDEPATH += $$absolute_path($$QLALR_DIR, $$OUT_PWD)
|
||||
}
|
||||
|
||||
for (s, QLALRSOURCES) {
|
||||
sf = $$absolute_path($$s, $$_PRO_FILE_PWD_)
|
||||
QMAKE_INTERNAL_INCLUDED_FILES += $$sf
|
||||
sfl = $$cat($$sf, lines)
|
||||
parser = $$lower($$member($$list($$find(sfl, "^%parser\\s")), 1))
|
||||
isEmpty(parser): error("Could not extract %parser from $$sf")
|
||||
decl = $$member($$list($$find(sfl, "^%decl\\s")), 1)
|
||||
isEmpty(decl): error("Could not extract %decl from $$sf")
|
||||
impl = $$member($$list($$find(sfl, "^%impl\\s")), 1)
|
||||
isEmpty(impl): error("Could not extract %impl from $$sf")
|
||||
base = qlalr_$$replace(sf, ^.*/([^./]+)[^/]*$, \\1)
|
||||
|
||||
invar = $$upper($$base)_SOURCES
|
||||
$$invar = $$sf
|
||||
$${base}.input = $$invar
|
||||
$${base}.output = $$QLALR_DIR/$${parser}.cpp
|
||||
$${base}.variable_out = GENERATED_SOURCES
|
||||
$${base}.commands = $$QMAKE_QLALR $$QMAKE_QLALRFLAGS ${QMAKE_FILE_IN}
|
||||
silent: $${base}.commands = @echo qlalr ${QMAKE_FILE_IN} && $${base}.commands
|
||||
$${base}.name = QLALR ${QMAKE_FILE_IN}
|
||||
|
||||
$${base}_h.input = $$invar
|
||||
$${base}_h.output = $$QLALR_DIR/$${parser}_p.h
|
||||
$${base}_h.CONFIG = no_link
|
||||
$${base}_h.depends = $$QLALR_DIR/$${parser}.cpp
|
||||
$${base}_h.commands = $$escape_expand(\\n) # force creation of rule
|
||||
|
||||
$${base}_decl.input = $$invar
|
||||
$${base}_decl.output = $$QLALR_DIR/$${decl}
|
||||
$${base}_decl.CONFIG = no_link
|
||||
$${base}_decl.depends = $$QLALR_DIR/$${parser}.cpp
|
||||
$${base}_decl.commands = $$escape_expand(\\n) # force creation of rule
|
||||
|
||||
$${base}_impl.input = $$invar
|
||||
$${base}_impl.output = $$QLALR_DIR/$${impl}
|
||||
$${base}_impl.variable_out = GENERATED_SOURCES
|
||||
$${base}_impl.depends = $$QLALR_DIR/$${parser}.cpp
|
||||
$${base}_impl.commands = $$escape_expand(\\n) # force creation of rule
|
||||
|
||||
QMAKE_EXTRA_COMPILERS += $$base $${base}_h $${base}_decl $${base}_impl
|
||||
}
|
@ -101,7 +101,7 @@ load(qt_common)
|
||||
|
||||
load(qml_module)
|
||||
|
||||
unix|win32-g++* {
|
||||
unix|mingw {
|
||||
!isEmpty(_QMAKE_SUPER_CACHE_): \
|
||||
lib_replace.match = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*/lib
|
||||
else: \
|
||||
|
@ -172,6 +172,8 @@ contains(QT_CONFIG, static) {
|
||||
else: \
|
||||
QTPLUGIN += $$QT_DEFAULT_QPA_PLUGIN
|
||||
}
|
||||
needs_printsupport_plugin: \
|
||||
QTPLUGIN += $$QT_DEFAULT_PRINTSUPPORTPLUGIN
|
||||
import_plugins:!isEmpty(QTPLUGIN) {
|
||||
IMPORT_FILE_CONT = \
|
||||
"// This file is autogenerated by qmake. It imports static plugin classes for" \
|
||||
|
@ -27,11 +27,15 @@ warnings_are_errors:warning_clean {
|
||||
# This setting is compiler-dependent anyway because it depends on the version of the
|
||||
# compiler.
|
||||
clang {
|
||||
# Apple clang 4.0-4.2
|
||||
# Regular clang is not tested
|
||||
ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
|
||||
contains(ver, "4\\.[012]") {
|
||||
QMAKE_CXXFLAGS += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR
|
||||
# Apple clang 4.0-4.2,5.0
|
||||
# Regular clang 3.3 & 3.4
|
||||
apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
|
||||
reg_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
|
||||
contains(apple_ver, "4\\.[012]|5\\.0")|contains(reg_ver, "3\\.[34]") {
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR
|
||||
|
||||
# glibc's bswap_XX macros use the "register" keyword
|
||||
linux:equals(reg_ver, "3.4"): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=deprecated-register
|
||||
}
|
||||
} else:intel_icc:linux {
|
||||
# Intel CC 13.0 - 14.0, on Linux only
|
||||
@ -43,20 +47,20 @@ warnings_are_errors:warning_clean {
|
||||
# 1478: function "entity" (declared at line N) was declared deprecated
|
||||
# 1881: argument must be a constant null pointer value
|
||||
# (NULL in C++ is usually a literal 0)
|
||||
QMAKE_CXXFLAGS += -Werror -ww177,1224,1478,1881 $$WERROR
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1881 $$WERROR
|
||||
}
|
||||
} else:gcc:!clang:!intel_icc {
|
||||
# GCC 4.6-4.8
|
||||
ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION}
|
||||
contains(ver, "4\\.[678]") {
|
||||
QMAKE_CXXFLAGS += -Werror -Wno-error=cpp -Wno-error=deprecated-declarations $$WERROR
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=cpp -Wno-error=deprecated-declarations $$WERROR
|
||||
|
||||
# GCC prints this bogus warning, after it has inlined a lot of code
|
||||
# error: assuming signed overflow does not occur when assuming that (X + c) < X is always false
|
||||
QMAKE_CXXFLAGS += -Wno-error=strict-overflow
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Wno-error=strict-overflow
|
||||
|
||||
# Work-around for bug https://code.google.com/p/android/issues/detail?id=58135
|
||||
android: QMAKE_CXXFLAGS += -Wno-error=literal-suffix
|
||||
android: QMAKE_CXXFLAGS_WARN_ON += -Wno-error=literal-suffix
|
||||
}
|
||||
}
|
||||
unset(ver)
|
||||
|
@ -134,6 +134,33 @@ aix-g++* {
|
||||
QMAKE_CXXFLAGS += -mminimal-toc
|
||||
}
|
||||
|
||||
sse2:!contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):!host_build:!if(static:contains(QT_CONFIG, shared)) {
|
||||
# If the compiler supports SSE2, enable it unconditionally in all of Qt shared libraries
|
||||
# (and only the libraries). This is not expected to be a problem because:
|
||||
# - on Windows, sharing of libraries is uncommon
|
||||
# - on Mac OS X, all x86 CPUs already have SSE2 support (we won't even reach here)
|
||||
# - on Linux, the dynamic loader can find the libraries on LIBDIR/sse2/
|
||||
# The last guarantee does not apply to executables and plugins, so we can't enable for them.
|
||||
QT_CPU_FEATURES.$$QT_ARCH += sse sse2
|
||||
QMAKE_CFLAGS += $$QMAKE_CFLAGS_SSE2
|
||||
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE2
|
||||
}
|
||||
|
||||
clang {
|
||||
apple_clang_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
|
||||
reg_clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
|
||||
!lessThan(apple_clang_ver, "5.1")|!lessThan(reg_clang_ver, "3.4"): \
|
||||
CONFIG += compiler_supports_fpmath
|
||||
} else: gcc {
|
||||
CONFIG += compiler_supports_fpmath
|
||||
}
|
||||
|
||||
equals(QT_ARCH, i386):contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):compiler_supports_fpmath {
|
||||
# Turn on SSE-based floating-point math
|
||||
QMAKE_CFLAGS += -mfpmath=sse
|
||||
QMAKE_CXXFLAGS += -mfpmath=sse
|
||||
}
|
||||
|
||||
android: CONFIG += qt_android_deps
|
||||
|
||||
#install directives
|
||||
@ -154,7 +181,7 @@ else: \
|
||||
lib_replace.CONFIG = path
|
||||
QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
|
||||
|
||||
unix|win32-g++* {
|
||||
unix|mingw {
|
||||
CONFIG += create_pc
|
||||
QMAKE_PKGCONFIG_LIBDIR = $$lib_replace.replace
|
||||
QMAKE_PKGCONFIG_INCDIR = $$include_replace.replace
|
||||
@ -169,7 +196,7 @@ unix {
|
||||
QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace
|
||||
}
|
||||
|
||||
unix|win32-g++* {
|
||||
unix|mingw {
|
||||
QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$section(VERSION, ., 0, 0) ")
|
||||
QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$section(VERSION, ., 0, 0))
|
||||
for(i, MODULE_DEPENDS): \
|
||||
|
@ -60,7 +60,7 @@ exists($$_PRO_FILE_PWD_/tests/tests.pro) {
|
||||
sub_tests.CONFIG = no_default_install
|
||||
!contains(QT_BUILD_PARTS, tests) {
|
||||
sub_tests.CONFIG += no_default_target
|
||||
} else {
|
||||
} else: !ios {
|
||||
# Make sure these are there in case we need them
|
||||
sub_tools.CONFIG -= no_default_target
|
||||
sub_examples.CONFIG -= no_default_target
|
||||
|
@ -55,7 +55,7 @@ load(qt_common)
|
||||
wince*:LIBS += $$QMAKE_LIBS_GUI
|
||||
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
|
||||
|
||||
unix|win32-g++* {
|
||||
unix|mingw {
|
||||
!isEmpty(_QMAKE_SUPER_CACHE_): \
|
||||
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
|
||||
else: \
|
||||
|
@ -18,7 +18,7 @@ QT_CPU_FEATURES = $$eval(QT_CPU_FEATURES.$$QT_ARCH)
|
||||
#
|
||||
# Set up compilers for SIMD (SSE/AVX, NEON etc)
|
||||
#
|
||||
*-g++*|linux-icc*|*-clang*|*-qcc* {
|
||||
*-g++*|intel_icc|*-clang*|*-qcc* {
|
||||
sse2 {
|
||||
HEADERS += $$SSE2_HEADERS
|
||||
|
||||
@ -289,7 +289,7 @@ QT_CPU_FEATURES = $$eval(QT_CPU_FEATURES.$$QT_ARCH)
|
||||
avx2 {
|
||||
HEADERS += $$AVX2_HEADERS
|
||||
|
||||
avx2_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) -D_M_AVX2
|
||||
avx2_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
|
||||
!contains(QT_CPU_FEATURES, avx):avx2_compiler.commands += $$QMAKE_CFLAGS_AVX2
|
||||
avx2_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT}
|
||||
avx2_compiler.dependency_type = TYPE_C
|
||||
|
19
mkspecs/features/win32/windeployqt.prf
Normal file
@ -0,0 +1,19 @@
|
||||
# Extra target for running windeployqt
|
||||
qtPrepareTool(QMAKE_WINDEPLOYQT, windeployqt)
|
||||
build_pass {
|
||||
load(resolve_target)
|
||||
|
||||
isEmpty(WINDEPLOYQT_OPTIONS): WINDEPLOYQT_OPTIONS = -qmldir $$shell_quote($$shell_path($$_PRO_FILE_PWD_))
|
||||
WINDEPLOYQT_TARGET = $$shell_quote($$shell_path($$QMAKE_RESOLVED_TARGET))
|
||||
WINDEPLOYQT_OUTPUT = $$shell_quote($$shell_path($$dirname(QMAKE_RESOLVED_TARGET)/$$basename(TARGET).windeployqt))
|
||||
windeployqt.target = windeployqt
|
||||
windeployqt.commands = $$QMAKE_WINDEPLOYQT $$WINDEPLOYQT_OPTIONS -list target $$WINDEPLOYQT_TARGET > $$WINDEPLOYQT_OUTPUT
|
||||
|
||||
windeployqt_clean.commands = if exist $$WINDEPLOYQT_OUTPUT for /f %i in ($$WINDEPLOYQT_OUTPUT) do $$QMAKE_DEL_FILE %~fi && $$QMAKE_DEL_DIR %~pi
|
||||
QMAKE_EXTRA_TARGETS += windeployqt_clean
|
||||
DISTCLEAN_DEPS += windeployqt_clean
|
||||
QMAKE_DISTCLEAN += $$WINDEPLOYQT_OUTPUT
|
||||
} else {
|
||||
windeployqt.CONFIG += recursive
|
||||
}
|
||||
QMAKE_EXTRA_TARGETS += windeployqt
|
@ -1,7 +1,7 @@
|
||||
CONFIG -= console
|
||||
contains(TEMPLATE, ".*app"){
|
||||
QMAKE_LFLAGS += $$QMAKE_LFLAGS_WINDOWS $$QMAKE_LFLAGS_EXE
|
||||
win32-g++:DEFINES += QT_NEEDS_QMAIN
|
||||
mingw:DEFINES += QT_NEEDS_QMAIN
|
||||
|
||||
qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) {
|
||||
isEqual(entryLib, -lqtmain): {
|
||||
|
5
mkspecs/features/winrt/console.prf
Normal file
@ -0,0 +1,5 @@
|
||||
# This is an empty prf file to overwrite the win32 version.
|
||||
# On Windows RT all applications need to be windows applications
|
||||
# and also link to winmain. Inside winmain we create the launch
|
||||
# arguments and also initialize the UI.
|
||||
|
121
mkspecs/features/winrt/package_manifest.prf
Normal file
@ -0,0 +1,121 @@
|
||||
# This performs basic variable replacement on the contents of the WinRT manifest template, as
|
||||
# specified by WINRT_MANIFEST. The resulting manifest file is written to the output directory.
|
||||
# While the most common options are covered by the default template, the developer is expected
|
||||
# to make an application-level copy of the template in order to customize the manifest further.
|
||||
# Afterwards, they can override the default template by assigning their template to WINRT_MANIFEST.
|
||||
#
|
||||
# All subkeys in WINRT_MANIFEST will be replaced if defined/found, so new variables can be easily
|
||||
# added. The following keys have default values and are present in the default templates:
|
||||
# WINRT_MANIFEST: The name of the input manifest file. Defaults to a file defined by the mkspec.
|
||||
# WINRT_MANIFEST.target: The name of the target (.exe). Defaults to TARGET.
|
||||
# WINRT_MANIFEST.identity: The unique ID of the app. Defaults to reusing the existing generated manifest's UUID, or generates a new UUID if none is present.
|
||||
# WINRT_MANIFEST.name: The name of the package as displayed to the user. Defaults to TARGET.
|
||||
# WINRT_MANIFEST.architecture: The target architecture. Defaults to VCPROJ_ARCH.
|
||||
# WINRT_MANIFEST.version: The version number of the package. Defaults to "1.0.0.0".
|
||||
# WINRT_MANIFEST.arguments: Allows arguments to be passed to the executable.
|
||||
# WINRT_MANIFEST.publisher: Display name of the publisher. Defaults to "Default publisher display name".
|
||||
# WINRT_MANIFEST.publisher_id: On Windows 8/RT, the publisher's distinguished name (default: CN=MyCN). On Windows Phone, the publisher's UUID (default: invalid UUID string).
|
||||
# WINRT_MANIFEST.description: Package description. Defaults to "Default package description".
|
||||
# WINRT_MANIFEST.author: Package author (Windows Phone only). Defaults to "Default package author".
|
||||
# WINRT_MANIFEST.genre: Package genre (Windows Phone only). Defaults to "apps.normal".
|
||||
# WINRT_MANIFEST.background: Tile background color. Defaults to "green".
|
||||
# WINRT_MANIFEST.foreground: Tile foreground (text) color (Windows 8/RT only). Defaults to "light".
|
||||
# WINRT_MANIFEST.logo_store: Logo image file for Windows Store. Default provided by the mkspec.
|
||||
# WINRT_MANIFEST.logo_small: Small logo image file. Default provided by the mkspec.
|
||||
# WINRT_MANIFEST.logo_medium: Medium logo image file. Default provided by the mkspec.
|
||||
# WINRT_MANIFEST.logo_large: Large logo image file. Default provided by the mkspec.
|
||||
# WINRT_MANIFEST.splash_screen: Splash screen image file. Default provided by the mkspec.
|
||||
# WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec.
|
||||
# WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec.
|
||||
# WINRT_MANIFEST.capabilities: Specifies capabilities to add to the capability list.
|
||||
# WINRT_MANIFEST.dependencies: Specifies dependencies required by the package.
|
||||
|
||||
# The manifest is generated for each build pass for normal apps, and only once for vcapps.
|
||||
# - Normal apps have their package root directory in the same place as the target (one for each build pass).
|
||||
# - Visual Studio requires a design-mode manifest in the same location as the vcproj.
|
||||
!isEmpty(WINRT_MANIFEST): \
|
||||
if(build_pass:equals(TEMPLATE, "app"))| \
|
||||
if(!build_pass:equals(TEMPLATE, "vcapp")) {
|
||||
|
||||
manifest_file.input = $$WINRT_MANIFEST
|
||||
|
||||
load(resolve_target)
|
||||
BUILD_DIR = $$dirname(QMAKE_RESOLVED_TARGET)
|
||||
winphone: \
|
||||
manifest_file.output = $$BUILD_DIR/WMAppManifest.xml
|
||||
else: contains(TEMPLATE, "vc.*"): \
|
||||
manifest_file.output = $$BUILD_DIR/Package.appxmanifest
|
||||
else: \
|
||||
manifest_file.output = $$BUILD_DIR/AppxManifest.xml
|
||||
|
||||
# Provide the C-runtime dependency
|
||||
equals(TEMPLATE, "app") {
|
||||
VCLIBS = Microsoft.VCLibs.$$replace(MSVC_VER, \\., ).00
|
||||
CONFIG(debug, debug|release): \
|
||||
WINRT_MANIFEST.dependencies += $${VCLIBS}.Debug
|
||||
else: \
|
||||
WINRT_MANIFEST.dependencies += $$VCLIBS
|
||||
}
|
||||
|
||||
# Provide default values for required variables
|
||||
isEmpty(WINRT_MANIFEST.target): WINRT_MANIFEST.target = $$TARGET
|
||||
isEmpty(WINRT_MANIFEST.identity) {
|
||||
# Reuse the existing UUID if possible
|
||||
UUID_CACHE = $$OUT_PWD/.qmake.winrt_uuid_$$TARGET
|
||||
exists($$UUID_CACHE) {
|
||||
include($$UUID_CACHE)
|
||||
} else {
|
||||
WINRT_UUID = "WINRT_MANIFEST.identity = $$system(uuidgen)"
|
||||
write_file($$UUID_CACHE, WINRT_UUID)|error("Unable to write the UUID cache; aborting.")
|
||||
eval($$WINRT_UUID)
|
||||
}
|
||||
winphone: WINRT_MANIFEST.identity = {$$WINRT_MANIFEST.identity}
|
||||
}
|
||||
isEmpty(WINRT_MANIFEST.name): WINRT_MANIFEST.name = $$TARGET
|
||||
isEmpty(WINRT_MANIFEST.architecture): WINRT_MANIFEST.architecture = $$VCPROJ_ARCH
|
||||
isEmpty(WINRT_MANIFEST.version): WINRT_MANIFEST.version = 1.0.0.0
|
||||
isEmpty(WINRT_MANIFEST.publisher): WINRT_MANIFEST.publisher = Default publisher display name
|
||||
isEmpty(WINRT_MANIFEST.publisherid) {
|
||||
winphone: WINRT_MANIFEST.publisherid = {00000000-0000-0000-0000-000000000000}
|
||||
else: WINRT_MANIFEST.publisherid = CN=$$(USERNAME)
|
||||
}
|
||||
isEmpty(WINRT_MANIFEST.description): WINRT_MANIFEST.description = Default package description
|
||||
isEmpty(WINRT_MANIFEST.author): WINRT_MANIFEST.author = Default package author
|
||||
isEmpty(WINRT_MANIFEST.genre): WINRT_MANIFEST.genre = apps.normal
|
||||
isEmpty(WINRT_MANIFEST.background): WINRT_MANIFEST.background = green
|
||||
isEmpty(WINRT_MANIFEST.foreground): WINRT_MANIFEST.foreground = light
|
||||
|
||||
winphone: INDENT = "$$escape_expand(\\r\\n) "
|
||||
else: INDENT = "$$escape_expand(\\r\\n) "
|
||||
# Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)
|
||||
WINRT_MANIFEST.capabilities = $$unique(WINRT_MANIFEST.capabilities)
|
||||
for(CAPABILITY, WINRT_MANIFEST.capabilities): \
|
||||
MANIFEST_CAPABILITIES += " <Capability Name=\"$$CAPABILITY\" />"
|
||||
WINRT_MANIFEST.capabilities = $$join(MANIFEST_CAPABILITIES, $$INDENT, $$INDENT, $$INDENT)
|
||||
# Dependencies are given as a string list. The CRT dependency is added automatically above.
|
||||
WINRT_MANIFEST.dependencies = $$unique(WINRT_MANIFEST.dependencies)
|
||||
for(DEPENDENCY, WINRT_MANIFEST.dependencies): \
|
||||
MANIFEST_DEPENDENCIES += " <PackageDependency Name=\"$$DEPENDENCY\" />"
|
||||
WINRT_MANIFEST.dependencies = $$join(MANIFEST_DEPENDENCIES, $$INDENT, $$INDENT, $$INDENT)
|
||||
|
||||
# Provide default icons where needed
|
||||
isEmpty(WINRT_ASSETS_PATH): WINRT_ASSETS_PATH = $$[QT_HOST_DATA/get]/mkspecs/common/winrt_winphone/assets
|
||||
TEMPLATE_CONTENTS = $$cat($$WINRT_MANIFEST, lines)
|
||||
ICONS_FOUND = $$find(TEMPLATE_CONTENTS, \\\$\\\$\\{WINRT_MANIFEST\\.(logo|tile)_)
|
||||
ICONS_FOUND ~= s/.*\\\$\\\$\\{WINRT_MANIFEST\\.((logo|tile)_[^\}]+)\\}.*/\\1/g
|
||||
for (ICON_NAME, ICONS_FOUND) {
|
||||
ICON_FILE = $$eval(WINRT_MANIFEST.$$ICON_NAME)
|
||||
isEmpty(ICON_FILE) {
|
||||
icon_$${ICON_NAME}.input = $$WINRT_ASSETS_PATH/$${ICON_NAME}.png
|
||||
icon_$${ICON_NAME}.output = $$BUILD_DIR/assets/$${ICON_NAME}.png
|
||||
WINRT_MANIFEST.$${ICON_NAME} = assets/$${ICON_NAME}.png
|
||||
} else {
|
||||
icon_$${ICON_NAME}.input = $$ICON_FILE
|
||||
icon_$${ICON_NAME}.output = $$BUILD_DIR/$$ICON_FILE
|
||||
}
|
||||
icon_$${ICON_NAME}.CONFIG = verbatim
|
||||
QMAKE_SUBSTITUTES += icon_$${ICON_NAME}
|
||||
}
|
||||
|
||||
QMAKE_SUBSTITUTES += manifest_file
|
||||
}
|
@ -82,7 +82,7 @@
|
||||
|
||||
#define QT_OPEN_LARGEFILE 0
|
||||
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
|
||||
#endif // QPLATFORMDEFS_H
|
||||
|