2 Copyright (C) 2009 Robert Hogan <robert@roberthogan.net>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
21 #include <qwebkitversion.h>
22 #include <WebKitVersion.h>
27 Returns the version number of WebKit at run-time as a string (for
30 This version is commonly used in WebKit based browsers as part
31 of the user agent string. Web servers and JavaScript might use
32 it to identify the presence of certain WebKit engine features
35 The evolution of this version is bound to the releases of Apple's
36 Safari browser. For a version specific to the QtWebKit library,
39 \sa QWebPage::userAgentForUrl()
41 QString qWebKitVersion()
43 return QString::fromLatin1("%1.%2").arg(WEBKIT_MAJOR_VERSION).arg(WEBKIT_MINOR_VERSION);
49 Returns the 'major' version number of WebKit at run-time as an integer
50 (for example, 531). This is the version of WebKit the application
55 int qWebKitMajorVersion()
57 return WEBKIT_MAJOR_VERSION;
63 Returns the 'minor' version number of WebKit at run-time as an integer
64 (for example, 3). This is the version of WebKit the application
69 int qWebKitMinorVersion()
71 return WEBKIT_MINOR_VERSION;
75 \macro QTWEBKIT_VERSION
78 This macro expands a numeric value of the form 0xMMNNPP (MM =
79 major, NN = minor, PP = patch) that specifies QtWebKit's version
80 number. For example, if you compile your application against QtWebKit
81 2.1.2, the QTWEBKIT_VERSION macro will expand to 0x020102.
83 You can use QTWEBKIT_VERSION to use the latest QtWebKit API where
90 \macro QTWEBKIT_VERSION_STR
93 This macro expands to a string that specifies QtWebKit's version number
94 (for example, "2.1.2"). This is the version against which the
95 application is compiled.
101 \macro QTWEBKIT_VERSION_CHECK
104 Turns the major, minor and patch numbers of a version into an
105 integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can
106 be compared with another similarly processed version id, for example
107 in a preprocessor statement:
110 #if QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 1, 0)
111 // code to use API new in QtWebKit 2.1.0