From e7eed096a0c33607a7a37baaf06e5952dc9d556b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Mon, 9 Aug 2010 14:07:01 +0200 Subject: Remove dependency of OpenGL Utility Library (GLU). GLU is not part of standard OpenGL and is not used internally in Qt, so we should not depend on it. Task-number: QT-12227 Reviewed-by: kim --- config.tests/x11/glxfbconfig/glxfbconfig.pro | 2 +- config.tests/x11/opengl/opengl.cpp | 5 ----- config.tests/x11/opengl/opengl.pro | 2 +- dist/changes-4.8.0 | 4 ++++ mkspecs/aix-g++-64/qmake.conf | 2 +- mkspecs/aix-g++/qmake.conf | 2 +- mkspecs/aix-xlc-64/qmake.conf | 2 +- mkspecs/aix-xlc/qmake.conf | 2 +- mkspecs/common/linux.conf | 2 +- mkspecs/cygwin-g++/qmake.conf | 2 +- mkspecs/darwin-g++/qmake.conf | 2 +- mkspecs/freebsd-g++/qmake.conf | 2 +- mkspecs/freebsd-g++34/qmake.conf | 2 +- mkspecs/freebsd-g++40/qmake.conf | 2 +- mkspecs/freebsd-icc/qmake.conf | 2 +- mkspecs/hpux-acc-64/qmake.conf | 2 +- mkspecs/hpux-acc-o64/qmake.conf | 2 +- mkspecs/hpux-acc/qmake.conf | 2 +- mkspecs/hpux-g++-64/qmake.conf | 2 +- mkspecs/hpux-g++/qmake.conf | 2 +- mkspecs/hpuxi-acc-32/qmake.conf | 2 +- mkspecs/hpuxi-acc-64/qmake.conf | 2 +- mkspecs/hpuxi-g++-64/qmake.conf | 2 +- mkspecs/hurd-g++/qmake.conf | 2 +- mkspecs/irix-cc-64/qmake.conf | 2 +- mkspecs/irix-cc/qmake.conf | 2 +- mkspecs/irix-g++-64/qmake.conf | 2 +- mkspecs/irix-g++/qmake.conf | 2 +- mkspecs/linux-cxx/qmake.conf | 2 +- mkspecs/linux-ecc-64/qmake.conf | 2 +- mkspecs/linux-icc/qmake.conf | 2 +- mkspecs/linux-kcc/qmake.conf | 2 +- mkspecs/linux-pgcc/qmake.conf | 2 +- mkspecs/lynxos-g++/qmake.conf | 2 +- mkspecs/netbsd-g++/qmake.conf | 2 +- mkspecs/openbsd-g++/qmake.conf | 2 +- mkspecs/sco-cc/qmake.conf | 2 +- mkspecs/sco-g++/qmake.conf | 2 +- mkspecs/solaris-cc-64/qmake.conf | 2 +- mkspecs/solaris-cc/qmake.conf | 2 +- mkspecs/solaris-g++-64/qmake.conf | 2 +- mkspecs/solaris-g++/qmake.conf | 2 +- mkspecs/tru64-cxx/qmake.conf | 2 +- mkspecs/tru64-g++/qmake.conf | 2 +- mkspecs/unixware-cc/qmake.conf | 2 +- mkspecs/unixware-g++/qmake.conf | 2 +- mkspecs/unsupported/linux-host-g++/qmake.conf | 2 +- mkspecs/unsupported/qnx-g++/qmake.conf | 2 +- mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf | 2 +- mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf | 2 +- src/opengl/qgl.h | 4 ---- 51 files changed, 52 insertions(+), 57 deletions(-) diff --git a/config.tests/x11/glxfbconfig/glxfbconfig.pro b/config.tests/x11/glxfbconfig/glxfbconfig.pro index 4705ca6..65f855a 100644 --- a/config.tests/x11/glxfbconfig/glxfbconfig.pro +++ b/config.tests/x11/glxfbconfig/glxfbconfig.pro @@ -7,4 +7,4 @@ for(p, QMAKE_LIBDIR_OPENGL) { } CONFIG -= qt -LIBS += -lGL -lGLU +LIBS += -lGL diff --git a/config.tests/x11/opengl/opengl.cpp b/config.tests/x11/opengl/opengl.cpp index 3802365..6c1815d 100644 --- a/config.tests/x11/opengl/opengl.cpp +++ b/config.tests/x11/opengl/opengl.cpp @@ -40,11 +40,6 @@ ****************************************************************************/ #include -#include - -#ifndef GLU_VERSION_1_2 -# error "Required GLU version 1.2 not found." -#endif int main(int, char **) { diff --git a/config.tests/x11/opengl/opengl.pro b/config.tests/x11/opengl/opengl.pro index 5fd41d3..5c3a1c5 100644 --- a/config.tests/x11/opengl/opengl.pro +++ b/config.tests/x11/opengl/opengl.pro @@ -8,4 +8,4 @@ for(p, QMAKE_LIBDIR_OPENGL) { CONFIG -= qt win32-g++*:LIBS += -lopengl32 -else:LIBS += -lGL -lGLU +else:LIBS += -lGL diff --git a/dist/changes-4.8.0 b/dist/changes-4.8.0 index 9d16f11..f22460f 100644 --- a/dist/changes-4.8.0 +++ b/dist/changes-4.8.0 @@ -43,6 +43,10 @@ QtGui - QTabBar: reduced minimumSizeHint if ElideMode is set. + QtOpenGL + -------- + - Removed dependency of OpenGL Utility Library (GLU) + **************************************************************************** * Database Drivers * diff --git a/mkspecs/aix-g++-64/qmake.conf b/mkspecs/aix-g++-64/qmake.conf index d9d9c38..b0179d5 100644 --- a/mkspecs/aix-g++-64/qmake.conf +++ b/mkspecs/aix-g++-64/qmake.conf @@ -63,7 +63,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthreads diff --git a/mkspecs/aix-g++/qmake.conf b/mkspecs/aix-g++/qmake.conf index 5fc4c17..2e2e991 100644 --- a/mkspecs/aix-g++/qmake.conf +++ b/mkspecs/aix-g++/qmake.conf @@ -63,7 +63,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthreads diff --git a/mkspecs/aix-xlc-64/qmake.conf b/mkspecs/aix-xlc-64/qmake.conf index ae87b88..486b8c6 100644 --- a/mkspecs/aix-xlc-64/qmake.conf +++ b/mkspecs/aix-xlc-64/qmake.conf @@ -62,7 +62,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthreads diff --git a/mkspecs/aix-xlc/qmake.conf b/mkspecs/aix-xlc/qmake.conf index fe91236..8655db6 100644 --- a/mkspecs/aix-xlc/qmake.conf +++ b/mkspecs/aix-xlc/qmake.conf @@ -63,7 +63,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthreads diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf index 4fbe2dc..e443be1 100644 --- a/mkspecs/common/linux.conf +++ b/mkspecs/common/linux.conf @@ -28,7 +28,7 @@ QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -lnsl QMAKE_LIBS_EGL = -lEGL -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 diff --git a/mkspecs/cygwin-g++/qmake.conf b/mkspecs/cygwin-g++/qmake.conf index 29d0958..ddfceb0 100644 --- a/mkspecs/cygwin-g++/qmake.conf +++ b/mkspecs/cygwin-g++/qmake.conf @@ -65,7 +65,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/darwin-g++/qmake.conf b/mkspecs/darwin-g++/qmake.conf index fc55503..84dc764 100644 --- a/mkspecs/darwin-g++/qmake.conf +++ b/mkspecs/darwin-g++/qmake.conf @@ -74,7 +74,7 @@ QMAKE_LFLAGS_RPATH = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = diff --git a/mkspecs/freebsd-g++/qmake.conf b/mkspecs/freebsd-g++/qmake.conf index 51a1960..ac52e0f 100644 --- a/mkspecs/freebsd-g++/qmake.conf +++ b/mkspecs/freebsd-g++/qmake.conf @@ -28,7 +28,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = diff --git a/mkspecs/freebsd-g++34/qmake.conf b/mkspecs/freebsd-g++34/qmake.conf index 810efab..0f52993 100644 --- a/mkspecs/freebsd-g++34/qmake.conf +++ b/mkspecs/freebsd-g++34/qmake.conf @@ -63,7 +63,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = diff --git a/mkspecs/freebsd-g++40/qmake.conf b/mkspecs/freebsd-g++40/qmake.conf index 4b0ac4c..3d0851a 100644 --- a/mkspecs/freebsd-g++40/qmake.conf +++ b/mkspecs/freebsd-g++40/qmake.conf @@ -63,7 +63,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = diff --git a/mkspecs/freebsd-icc/qmake.conf b/mkspecs/freebsd-icc/qmake.conf index 99d6126..acc8f14 100644 --- a/mkspecs/freebsd-icc/qmake.conf +++ b/mkspecs/freebsd-icc/qmake.conf @@ -86,7 +86,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = diff --git a/mkspecs/hpux-acc-64/qmake.conf b/mkspecs/hpux-acc-64/qmake.conf index 38c8555..b9aaf5a 100644 --- a/mkspecs/hpux-acc-64/qmake.conf +++ b/mkspecs/hpux-acc-64/qmake.conf @@ -106,7 +106,7 @@ QMAKE_LIBS = -lm QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL -lXt +QMAKE_LIBS_OPENGL = -lGL -lXt QMAKE_LIBS_OPENGL_QT = -lGL -lXt QMAKE_LIBS_THREAD = -lpthread QMAKE_LIBS_YACC = -ly diff --git a/mkspecs/hpux-acc-o64/qmake.conf b/mkspecs/hpux-acc-o64/qmake.conf index 630129c..389e813 100644 --- a/mkspecs/hpux-acc-o64/qmake.conf +++ b/mkspecs/hpux-acc-o64/qmake.conf @@ -104,7 +104,7 @@ QMAKE_LIBS_DYNLOAD = -ldld QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread QMAKE_LIBS_YACC = -ly diff --git a/mkspecs/hpux-acc/qmake.conf b/mkspecs/hpux-acc/qmake.conf index 1c732c6..d1b6e5c 100644 --- a/mkspecs/hpux-acc/qmake.conf +++ b/mkspecs/hpux-acc/qmake.conf @@ -85,7 +85,7 @@ QMAKE_LIBS = -lm QMAKE_LIBS_DYNLOAD = -ldld QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL -lXt +QMAKE_LIBS_OPENGL = -lGL -lXt QMAKE_LIBS_OPENGL_QT = -lGL -lXt QMAKE_LIBS_THREAD = -lpthread QMAKE_LIBS_YACC = -ly diff --git a/mkspecs/hpux-g++-64/qmake.conf b/mkspecs/hpux-g++-64/qmake.conf index d8b0a4a..f796496 100644 --- a/mkspecs/hpux-g++-64/qmake.conf +++ b/mkspecs/hpux-g++-64/qmake.conf @@ -68,7 +68,7 @@ QMAKE_LIBS = -lm QMAKE_LIBS_DYNLOAD = -ldld QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread QMAKE_LIBS_YACC = -ly diff --git a/mkspecs/hpux-g++/qmake.conf b/mkspecs/hpux-g++/qmake.conf index 312c44b..e9891e7 100644 --- a/mkspecs/hpux-g++/qmake.conf +++ b/mkspecs/hpux-g++/qmake.conf @@ -68,7 +68,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldld QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread QMAKE_LIBS_YACC = -ly diff --git a/mkspecs/hpuxi-acc-32/qmake.conf b/mkspecs/hpuxi-acc-32/qmake.conf index a26cb32..d7e4a0a 100644 --- a/mkspecs/hpuxi-acc-32/qmake.conf +++ b/mkspecs/hpuxi-acc-32/qmake.conf @@ -60,7 +60,7 @@ QMAKE_LIBS = -lm QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL -lXt +QMAKE_LIBS_OPENGL = -lGL -lXt QMAKE_LIBS_OPENGL_QT = -lGL -lXt QMAKE_LIBS_THREAD = -lpthread QMAKE_LIBS_YACC = -ly diff --git a/mkspecs/hpuxi-acc-64/qmake.conf b/mkspecs/hpuxi-acc-64/qmake.conf index 3e2d59f..3ed9b55 100644 --- a/mkspecs/hpuxi-acc-64/qmake.conf +++ b/mkspecs/hpuxi-acc-64/qmake.conf @@ -103,7 +103,7 @@ QMAKE_LIBS = -lm QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL -lXt +QMAKE_LIBS_OPENGL = -lGL -lXt QMAKE_LIBS_OPENGL_QT = -lGL -lXt QMAKE_LIBS_THREAD = -lpthread QMAKE_LIBS_YACC = -ly diff --git a/mkspecs/hpuxi-g++-64/qmake.conf b/mkspecs/hpuxi-g++-64/qmake.conf index 3151d85..a8f445c 100644 --- a/mkspecs/hpuxi-g++-64/qmake.conf +++ b/mkspecs/hpuxi-g++-64/qmake.conf @@ -71,7 +71,7 @@ QMAKE_LIBS = -lm QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread QMAKE_LIBS_YACC = -ly diff --git a/mkspecs/hurd-g++/qmake.conf b/mkspecs/hurd-g++/qmake.conf index 6570e40..d89f2e4 100644 --- a/mkspecs/hurd-g++/qmake.conf +++ b/mkspecs/hurd-g++/qmake.conf @@ -67,7 +67,7 @@ QMAKE_LIBS_NIS = -lnsl QMAKE_LIBS_QT_THREAD = -lqt-mt QMAKE_LIBS_THREAD = -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_MOC = $$[QT_INSTALL_BINS]/moc diff --git a/mkspecs/irix-cc-64/qmake.conf b/mkspecs/irix-cc-64/qmake.conf index b8d316e..ec94824 100644 --- a/mkspecs/irix-cc-64/qmake.conf +++ b/mkspecs/irix-cc-64/qmake.conf @@ -94,7 +94,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL -lm +QMAKE_LIBS_OPENGL = -lGL -lm QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/irix-cc/qmake.conf b/mkspecs/irix-cc/qmake.conf index 2f4f03f..777da9b 100644 --- a/mkspecs/irix-cc/qmake.conf +++ b/mkspecs/irix-cc/qmake.conf @@ -94,7 +94,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL -lm +QMAKE_LIBS_OPENGL = -lGL -lm QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/irix-g++-64/qmake.conf b/mkspecs/irix-g++-64/qmake.conf index 610d92c..aa853de 100644 --- a/mkspecs/irix-g++-64/qmake.conf +++ b/mkspecs/irix-g++-64/qmake.conf @@ -67,7 +67,7 @@ QMAKE_LIBS_X11SM = -lSM -lICE # libGLU is using the SGI C++ library internally and this somehow clashes # with the GNU C++ library (similar name mangling and symbol names?) # so we add -lC so that the SGI C++ library is used first... -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/irix-g++/qmake.conf b/mkspecs/irix-g++/qmake.conf index 41841f3..77d47a9 100644 --- a/mkspecs/irix-g++/qmake.conf +++ b/mkspecs/irix-g++/qmake.conf @@ -67,7 +67,7 @@ QMAKE_LIBS_X11SM = -lSM -lICE # libGLU is using the SGI C++ library internally and this somehow clashes # with the GNU C++ library (similar name mangling and symbol names?) # so we add -lC so that the SGI C++ library is used first... -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/linux-cxx/qmake.conf b/mkspecs/linux-cxx/qmake.conf index 879c78a..ce303b7 100644 --- a/mkspecs/linux-cxx/qmake.conf +++ b/mkspecs/linux-cxx/qmake.conf @@ -60,7 +60,7 @@ QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -lnsl -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_MOC = $$[QT_INSTALL_BINS]/moc diff --git a/mkspecs/linux-ecc-64/qmake.conf b/mkspecs/linux-ecc-64/qmake.conf index aa50b87..61a056b 100644 --- a/mkspecs/linux-ecc-64/qmake.conf +++ b/mkspecs/linux-ecc-64/qmake.conf @@ -63,7 +63,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -lnsl -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index 3b26f7d..16e5197 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -70,7 +70,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -lnsl -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/linux-kcc/qmake.conf b/mkspecs/linux-kcc/qmake.conf index 5c6001c..01e3b73 100644 --- a/mkspecs/linux-kcc/qmake.conf +++ b/mkspecs/linux-kcc/qmake.conf @@ -72,7 +72,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -lnsl -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = diff --git a/mkspecs/linux-pgcc/qmake.conf b/mkspecs/linux-pgcc/qmake.conf index 16d0023..63ede78 100644 --- a/mkspecs/linux-pgcc/qmake.conf +++ b/mkspecs/linux-pgcc/qmake.conf @@ -63,7 +63,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -lnsl -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/lynxos-g++/qmake.conf b/mkspecs/lynxos-g++/qmake.conf index fc0fc43..6b6f405 100644 --- a/mkspecs/lynxos-g++/qmake.conf +++ b/mkspecs/lynxos-g++/qmake.conf @@ -66,7 +66,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -lnsl -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/netbsd-g++/qmake.conf b/mkspecs/netbsd-g++/qmake.conf index 1d3fd2b..4d4270d 100644 --- a/mkspecs/netbsd-g++/qmake.conf +++ b/mkspecs/netbsd-g++/qmake.conf @@ -64,7 +64,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = diff --git a/mkspecs/openbsd-g++/qmake.conf b/mkspecs/openbsd-g++/qmake.conf index c948c90..f4bb223 100644 --- a/mkspecs/openbsd-g++/qmake.conf +++ b/mkspecs/openbsd-g++/qmake.conf @@ -65,7 +65,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = diff --git a/mkspecs/sco-cc/qmake.conf b/mkspecs/sco-cc/qmake.conf index 6eb5ca1..179b774 100644 --- a/mkspecs/sco-cc/qmake.conf +++ b/mkspecs/sco-cc/qmake.conf @@ -60,7 +60,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL -lXt +QMAKE_LIBS_OPENGL = -lGL -lXt QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_MOC = $$[QT_INSTALL_BINS]/moc diff --git a/mkspecs/sco-g++/qmake.conf b/mkspecs/sco-g++/qmake.conf index d4091ff..9b321a4 100644 --- a/mkspecs/sco-g++/qmake.conf +++ b/mkspecs/sco-g++/qmake.conf @@ -61,7 +61,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lsocket -lm -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_MOC = $$[QT_INSTALL_BINS]/moc diff --git a/mkspecs/solaris-cc-64/qmake.conf b/mkspecs/solaris-cc-64/qmake.conf index a026756..80709af 100644 --- a/mkspecs/solaris-cc-64/qmake.conf +++ b/mkspecs/solaris-cc-64/qmake.conf @@ -83,7 +83,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread -lrt QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl diff --git a/mkspecs/solaris-cc/qmake.conf b/mkspecs/solaris-cc/qmake.conf index 8a8f1ac..0672841 100644 --- a/mkspecs/solaris-cc/qmake.conf +++ b/mkspecs/solaris-cc/qmake.conf @@ -66,7 +66,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread -lrt QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl diff --git a/mkspecs/solaris-g++-64/qmake.conf b/mkspecs/solaris-g++-64/qmake.conf index 01e331c..7bc7b9f 100644 --- a/mkspecs/solaris-g++-64/qmake.conf +++ b/mkspecs/solaris-g++-64/qmake.conf @@ -87,7 +87,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread -lrt QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl diff --git a/mkspecs/solaris-g++/qmake.conf b/mkspecs/solaris-g++/qmake.conf index c7f6406..be21cdd 100644 --- a/mkspecs/solaris-g++/qmake.conf +++ b/mkspecs/solaris-g++/qmake.conf @@ -70,7 +70,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread -lrt QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl diff --git a/mkspecs/tru64-cxx/qmake.conf b/mkspecs/tru64-cxx/qmake.conf index d2c6937..afabf3e 100644 --- a/mkspecs/tru64-cxx/qmake.conf +++ b/mkspecs/tru64-cxx/qmake.conf @@ -60,7 +60,7 @@ QMAKE_LIBS = -lm QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lrt diff --git a/mkspecs/tru64-g++/qmake.conf b/mkspecs/tru64-g++/qmake.conf index f2b8e39..6acd5cd 100644 --- a/mkspecs/tru64-g++/qmake.conf +++ b/mkspecs/tru64-g++/qmake.conf @@ -62,7 +62,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lpthread -lexc -lrt diff --git a/mkspecs/unixware-cc/qmake.conf b/mkspecs/unixware-cc/qmake.conf index 5f88b80..74478d6 100644 --- a/mkspecs/unixware-cc/qmake.conf +++ b/mkspecs/unixware-cc/qmake.conf @@ -64,7 +64,7 @@ QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL -lXt +QMAKE_LIBS_OPENGL = -lGL -lXt QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = diff --git a/mkspecs/unixware-g++/qmake.conf b/mkspecs/unixware-g++/qmake.conf index 34d6d61..a158d95 100644 --- a/mkspecs/unixware-g++/qmake.conf +++ b/mkspecs/unixware-g++/qmake.conf @@ -64,7 +64,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lresolv -lsocket -lnsl -lm QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL -lXt +QMAKE_LIBS_OPENGL = -lGL -lXt QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = -lthread diff --git a/mkspecs/unsupported/linux-host-g++/qmake.conf b/mkspecs/unsupported/linux-host-g++/qmake.conf index 38849f8..46ecf37 100644 --- a/mkspecs/unsupported/linux-host-g++/qmake.conf +++ b/mkspecs/unsupported/linux-host-g++/qmake.conf @@ -101,7 +101,7 @@ QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -lnsl QMAKE_LIBS_EGL = -lEGL -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 diff --git a/mkspecs/unsupported/qnx-g++/qmake.conf b/mkspecs/unsupported/qnx-g++/qmake.conf index 37e7bce..dfe9bed 100644 --- a/mkspecs/unsupported/qnx-g++/qmake.conf +++ b/mkspecs/unsupported/qnx-g++/qmake.conf @@ -31,7 +31,7 @@ QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 -lm -lsocket QMAKE_LIBS_X11SM = -lSM -lICE -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = QMAKE_LIBS_NETWORK = -lsocket diff --git a/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf b/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf index e3eb6cd..a3b571b 100644 --- a/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf +++ b/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf @@ -78,7 +78,7 @@ QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -lnsl -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = QMAKE_LIBS_NETWORK = # -lnetwrap # only needed if kernel is missing gethostbyname and friends diff --git a/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf b/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf index d0aeff6..8bdf1c5 100644 --- a/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf +++ b/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf @@ -78,7 +78,7 @@ QMAKE_LIBS_DYNLOAD = QMAKE_LIBS_X11 = -lXext -lX11 QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_NIS = -lnsl -QMAKE_LIBS_OPENGL = -lGLU -lGL +QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_THREAD = QMAKE_LIBS_NETWORK = # -lnet # only needed if kernel is missing gethostbyname and friends diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 9315ac4..2ac4cb6 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -56,7 +56,6 @@ QT_BEGIN_HEADER #if defined(Q_WS_MAC) # include -# include #elif defined(QT_OPENGL_ES_1) # include #ifndef GL_DOUBLE @@ -75,9 +74,6 @@ typedef GLfloat GLdouble; #endif #else # include -# ifndef QT_LINUXBASE -# include -# endif #endif QT_BEGIN_NAMESPACE -- cgit v0.12 From ac6323c4346be5fb5b1111194b2ee98706a69ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Mon, 9 Aug 2010 14:48:12 +0200 Subject: Replace gluPerspective with qgluPerspective. GLU dependency was removed in commit: c67b4cac2e53ae77c4e16487838c17be85e73aa3, so we have to implement the function ourselves. Reviewed-by: kim --- demos/boxes/glbuffers.cpp | 10 ++++++++++ demos/boxes/glbuffers.h | 2 ++ demos/boxes/qtbox.cpp | 2 +- demos/boxes/scene.cpp | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/demos/boxes/glbuffers.cpp b/demos/boxes/glbuffers.cpp index 694d05b..84ab26c 100644 --- a/demos/boxes/glbuffers.cpp +++ b/demos/boxes/glbuffers.cpp @@ -42,6 +42,16 @@ #include "glbuffers.h" #include + +void qgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) +{ + const GLdouble ymax = zNear * tan(fovy * M_PI / 360.0); + const GLdouble ymin = -ymax; + const GLdouble xmin = ymin * aspect; + const GLdouble xmax = ymax * aspect; + glFrustum(xmin, xmax, ymin, ymax, zNear, zFar); +} + //============================================================================// // GLTexture // //============================================================================// diff --git a/demos/boxes/glbuffers.h b/demos/boxes/glbuffers.h index 67a4ea6..8c1e209 100644 --- a/demos/boxes/glbuffers.h +++ b/demos/boxes/glbuffers.h @@ -58,6 +58,8 @@ if (m_failed || !(assertion)) { returnStatement; \ } +void qgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); + QT_BEGIN_NAMESPACE class QMatrix4x4; QT_END_NAMESPACE diff --git a/demos/boxes/qtbox.cpp b/demos/boxes/qtbox.cpp index 3aaf985..e3a5978 100644 --- a/demos/boxes/qtbox.cpp +++ b/demos/boxes/qtbox.cpp @@ -324,7 +324,7 @@ void QtBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadMatrixf(moveToRectMatrix); - gluPerspective(60.0, 1.0, 0.01, 10.0); + qgluPerspective(60.0, 1.0, 0.01, 10.0); glMatrixMode(GL_MODELVIEW); glPushMatrix(); diff --git a/demos/boxes/scene.cpp b/demos/boxes/scene.cpp index 97953f2..d65af22 100644 --- a/demos/boxes/scene.cpp +++ b/demos/boxes/scene.cpp @@ -922,7 +922,7 @@ void Scene::drawBackground(QPainter *painter, const QRectF &) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); - gluPerspective(60.0, width / height, 0.01, 15.0); + qgluPerspective(60.0, width / height, 0.01, 15.0); glMatrixMode(GL_MODELVIEW); -- cgit v0.12 From 0650ec9effe5d9dd643d1bc19d2af591244671d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 10 Aug 2010 15:03:12 +0200 Subject: Fix documentation for QAccessible::InterfaceFactory Reported to me by Martin P. --- .../snippets/code/src_gui_accessible_qaccessible.cpp | 4 ++++ src/gui/accessible/qaccessible.cpp | 17 +++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp b/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp index 8434d81..c5ca441 100644 --- a/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp +++ b/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp @@ -46,3 +46,7 @@ if (child) { delete child; } //! [0] + +//! [1] +typedef QAccessibleInterface* myFactoryFunction(const QString &key, QObject *); +//! [1] \ No newline at end of file diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index 0921bdb..a6d1dbd 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -409,13 +409,18 @@ static void qAccessibleCleanup() /*! \typedef QAccessible::InterfaceFactory - A function pointer type. Use a function with this prototype to install - interface factories with installFactory(). + This is a typedef for a pointer to a function with the following + signature: - The function receives a QObject pointer. If the QObject - provides a QAccessibleInterface, it sets the second parameter to - point to the corresponding QAccessibleInterface, and returns true; - otherwise returns false. + \snippet doc/src/snippets/code/src_gui_accessible_qaccessible.cpp 1 + + The function receives a QString and a QObject pointer, where the + QString is the key identifying the interface. The QObject is used + to pass on to the QAccessibleInterface so that it can hold a reference + to it. + + If the key and the QObject does not have a corresponding + QAccessibleInterface, a null-pointer will be returned. Installed factories are called by queryAccessibilityInterface() until one provides an interface. -- cgit v0.12 From dd2a5c1556cf29fac03ae789dd5c43f482011d68 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 28 Jul 2010 12:40:30 +0200 Subject: Fix compilation on 64-bit Windows. When compiling for 64-bit with Visual Studio 2008, inline assembly is not supported. Use intrisic instead. Reviewed-by: Benjamin Poulain --- src/corelib/tools/qsimd.cpp | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index 5aa7217..8005d7d 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -46,6 +46,10 @@ #include #endif +#if defined(Q_OS_WIN64) && !defined(Q_CC_GNU) +#include +#endif + QT_BEGIN_NAMESPACE uint qDetectCPUFeatures() @@ -261,31 +265,10 @@ uint qDetectCPUFeatures() : "%eax", "%ecx", "%edx" ); #elif defined (Q_OS_WIN64) - _asm { - push rax - push rbx - push rcx - push rdx - pushfd - pop rax - mov ebx, eax - xor eax, 00200000h - push rax - popfd - pushfd - pop rax - mov edx, 0 - xor eax, ebx - jz skip - - mov eax, 1 - cpuid - mov feature_result, ecx - skip: - pop rdx - pop rcx - pop rbx - pop rax + { + int info[4]; + __cpuid(info, 1); + feature_result = info[2]; } #endif -- cgit v0.12 From 99fd5825dfb4d50cff93165995701a65b7a8e4ed Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Tue, 10 Aug 2010 15:58:25 +0200 Subject: Make selection work across ligatures For widgets like QPlainTextEdit, selection across ligatures (typically 'fi', 'ffi', 'fl', etc.) end up highlighting the entire ligature glyphs, this patch fixed that by dividing width inside the ligature so that selection will not expand past the actual selected characters. Since cursor position already considered this, we merely adopted the algorithm and made it a separated helper function for all necessary cases. Dividing width directly looks like a temporary workaround but works well enough so far for cursor positions. Task-number: QTBUG-11969 Reviewed-by: Eskil --- src/gui/text/qtextlayout.cpp | 64 +++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 531e46b..9d27343 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1035,6 +1035,35 @@ QScriptItem &QTextLineItemIterator::next() return *si; } +static QFixed offsetInLigature(const unsigned short *logClusters, + const QGlyphLayout &glyphs, + int pos, int max, int glyph_pos) +{ + int offsetInCluster = 0; + for (int i = pos - 1; i >= 0; i--) { + if (logClusters[i] == glyph_pos) + offsetInCluster++; + else + break; + } + + // in the case that the offset is inside a (multi-character) glyph, + // interpolate the position. + if (offsetInCluster > 0) { + int clusterLength = 0; + for (int i = pos - offsetInCluster; i < max; i++) { + if (logClusters[i] == glyph_pos) + clusterLength++; + else + break; + } + if (clusterLength) + return glyphs.advances_x[glyph_pos] * offsetInCluster / clusterLength; + } + + return 0; +} + bool QTextLineItemIterator::getSelectionBounds(QFixed *selectionX, QFixed *selectionWidth) const { *selectionX = *selectionWidth = 0; @@ -1074,8 +1103,19 @@ bool QTextLineItemIterator::getSelectionBounds(QFixed *selectionX, QFixed *selec swidth += glyphs.effectiveAdvance(g); } - *selectionX = x + soff; - *selectionWidth = swidth; + // If the starting character is in the middle of a ligature, + // selection should only contain the right part of that ligature + // glyph, so we need to get the width of the left part here and + // add it to *selectionX + QFixed leftOffsetInLigature = offsetInLigature(logClusters, glyphs, from, + to, start_glyph); + *selectionX = x + soff + leftOffsetInLigature; + *selectionWidth = swidth - leftOffsetInLigature; + // If the ending character is also part of a ligature, swidth does + // not contain that part yet, we also need to find out the width of + // that left part + *selectionWidth += offsetInLigature(logClusters, glyphs, to, + eng->length(item), end_glyph); } return true; } @@ -2633,14 +2673,6 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const if(pos == l) x += si->width; } else { - int offsetInCluster = 0; - for (int i=pos-1; i >= 0; i--) { - if (logClusters[i] == glyph_pos) - offsetInCluster++; - else - break; - } - if (reverse) { int end = qMin(lineEnd, si->position + l) - si->position; int glyph_end = end == l ? si->num_glyphs : logClusters[end]; @@ -2652,17 +2684,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const for (int i = glyph_start; i < glyph_pos; i++) x += glyphs.effectiveAdvance(i); } - if (offsetInCluster > 0) { // in the case that the offset is inside a (multi-character) glyph, interpolate the position. - int clusterLength = 0; - for (int i=pos - offsetInCluster; i < line.length; i++) { - if (logClusters[i] == glyph_pos) - clusterLength++; - else - break; - } - if (clusterLength) - x+= glyphs.advances_x[glyph_pos] * offsetInCluster / clusterLength; - } + x += offsetInLigature(logClusters, glyphs, pos, line.length, glyph_pos); } *cursorPos = pos + si->position; -- cgit v0.12 From ca8d92f1d30b1519ccbfdab44e3868e9556b3fb5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 6 Aug 2010 11:46:52 +0200 Subject: Optimize QSharedPointer::operator=(const QSharedPointer &) internalSet check that stringref is > 0 Which is not required as we do not assign from a QWeakPointer Reviewed-by: Thiago Task-number: QTBUG-12700 --- src/corelib/tools/qsharedpointer_impl.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index dd27f7e..7f0de5f 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -387,7 +387,13 @@ namespace QtSharedPointer { template inline void internalCopy(const ExternalRefCount &other) { - internalSet(other.d, other.data()); + Data *o = other.d; + T *actual = other.value; + if (o) + other.ref(); + qSwap(d, o); + qSwap(this->value, actual); + deref(o, actual); } inline void internalSwap(ExternalRefCount &other) -- cgit v0.12 From 4e626903d0f6df00fa83c18061a12cb3a5dbd603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 10 Aug 2010 16:53:18 +0200 Subject: Replace gluOrtho2d with glOrtho. GLU dependency was removed in commit: c67b4cac2e53ae77c4e16487838c17be85e73aa3, so instead of using gluOrtho2d we simply use glOrtho with near=-1 and far=1. --- src/3rdparty/phonon/qt7/videowidget.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/qt7/videowidget.mm b/src/3rdparty/phonon/qt7/videowidget.mm index 736dcdf..c281e16 100644 --- a/src/3rdparty/phonon/qt7/videowidget.mm +++ b/src/3rdparty/phonon/qt7/videowidget.mm @@ -278,7 +278,7 @@ public: glMatrixMode(GL_PROJECTION); glLoadIdentity(); glViewport(0, 0, GLsizei(w), GLsizei(h)); - gluOrtho2D(0, GLsizei(w), 0, GLsizei(h)); + glOrtho(0, GLsizei(w), 0, GLsizei(h), -1, 1); updateGL(); } -- cgit v0.12 From 0c9866d6b23062bc08e739b66f41de200b660df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kimmo=20Kotaj=C3=A4rvi?= Date: Wed, 26 May 2010 14:53:23 +0200 Subject: Fix for QTBUG-2182: "connection still in use" warnings. --- src/sql/kernel/qsqldatabase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index 76bc2b0..324a3ce 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -163,7 +163,7 @@ public: static QSqlDatabase database(const QString& name, bool open); static void addDatabase(const QSqlDatabase &db, const QString & name); static void removeDatabase(const QString& name); - static void invalidateDb(const QSqlDatabase &db, const QString &name); + static void invalidateDb(const QSqlDatabase &db, const QString &name, bool doWarn = true); static DriverDict &driverDict(); static void cleanConnections(); }; @@ -197,7 +197,7 @@ void QSqlDatabasePrivate::cleanConnections() QConnectionDict::iterator it = dict->begin(); while (it != dict->end()) { - invalidateDb(it.value(), it.key()); + invalidateDb(it.value(), it.key(), false); ++it; } dict->clear(); @@ -229,9 +229,9 @@ QSqlDatabasePrivate *QSqlDatabasePrivate::shared_null() return &n; } -void QSqlDatabasePrivate::invalidateDb(const QSqlDatabase &db, const QString &name) +void QSqlDatabasePrivate::invalidateDb(const QSqlDatabase &db, const QString &name, bool doWarn) { - if (db.d->ref != 1) { + if (db.d->ref != 1 && doWarn) { qWarning("QSqlDatabasePrivate::removeDatabase: connection '%s' is still in use, " "all queries will cease to work.", name.toLocal8Bit().constData()); db.d->disable(); -- cgit v0.12 From 1023209b9c335d72dc489d67e632d80cadac924d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 11 Aug 2010 09:59:53 +0200 Subject: Fix build os QSharedPointer on MSVC Which does not support template friends Reviewed-by: Thiago --- src/corelib/tools/qsharedpointer_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 7f0de5f..bb06f3a 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -322,7 +322,6 @@ namespace QtSharedPointer { protected: typedef ExternalRefCountData Data; - inline void ref() const { d->weakref.ref(); d->strongref.ref(); } inline void deref() { deref(d, this->value); } static inline void deref(Data *d, T *value) @@ -409,6 +408,7 @@ namespace QtSharedPointer { template friend class QT_PREPEND_NAMESPACE(QWeakPointer); template friend QSharedPointer copyAndSetPointer(X * ptr, const QSharedPointer &src); #endif + inline void ref() const { d->weakref.ref(); d->strongref.ref(); } inline void internalSet(Data *o, T *actual) { -- cgit v0.12