Changeset 124879 in webkit


Ignore:
Timestamp:
Aug 7, 2012 5:06:52 AM (12 years ago)
Author:
Simon Hausmann
Message:

[Qt] Remove Qt 4 specific code paths
https://bugs.webkit.org/show_bug.cgi?id=88161

Reviewed by Kenneth Rohde Christiansen.

.:

  • Source/api.pri:
  • WebKit.pro:

Source/WebCore:

  • Target.pri:
  • WebCore.pri:
  • bridge/qt/qt_class.cpp:

(JSC::Bindings::QtClass::fallbackObject):

  • bridge/qt/qt_instance.cpp:

(JSC::Bindings::QtInstance::getPropertyNames):
(JSC::Bindings::QtInstance::stringValue):
(JSC::Bindings::QtField::setValueToInstance):

  • bridge/qt/qt_runtime.h:

(QtConnectionObject):

  • bridge/qt/qt_runtime_qt4.cpp: Removed.
  • editing/qt/SmartReplaceQt.cpp: Removed.
  • page/qt/EventHandlerQt.cpp:

(WebCore::EventHandler::tabsToAllFormControls):

  • platform/graphics/GraphicsContext3D.h:
  • platform/graphics/OpenGLShims.cpp:

(WebCore::getProcAddress):

  • platform/graphics/OpenGLShims.h:
  • platform/graphics/gstreamer/PlatformVideoWindowPrivate.h:
  • platform/graphics/gstreamer/PlatformVideoWindowQt.cpp:

(FullScreenVideoWindow::FullScreenVideoWindow):
(FullScreenVideoWindow::keyPressEvent):
(FullScreenVideoWindow::event):
(FullScreenVideoWindow::showFullScreen):
(PlatformVideoWindow::PlatformVideoWindow):

  • platform/graphics/qt/GraphicsContext3DQt.cpp:

(WebCore::GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext):
(WebCore::GraphicsContext3DPrivate::makeCurrentIfNeeded):

  • platform/graphics/qt/GraphicsContextQt.cpp:

(WebCore::GraphicsContext::releaseWindowsContext):

  • platform/graphics/qt/ImageQt.cpp:

(WebCore::BitmapImage::create):

  • platform/graphics/qt/SimpleFontDataQt.cpp:

(WebCore::SimpleFontData::platformInit):

  • platform/graphics/texmap/TextureMapper.h:
  • platform/graphics/texmap/TextureMapperGL.cpp:

(WebCore::TextureMapperGLData::SharedGLData::getCurrentGLContext):

  • platform/qt/DeviceMotionProviderQt.h:
  • platform/qt/DeviceOrientationProviderQt.h:
  • platform/qt/KURLQt.cpp:

(WebCore::KURL::operator QUrl):

  • platform/qt/PlatformScreenQt.cpp:

(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenIsMonochrome):
(WebCore::screenRect):
(WebCore::screenAvailableRect):

  • platform/qt/QWebPageClient.h:

(QWebPageClient):

  • platform/qt/RenderThemeQt.cpp:
  • platform/text/qt/TextBreakIteratorQt.cpp: Removed.
  • plugins/qt/PluginContainerQt.cpp: Removed.
  • plugins/qt/PluginContainerQt.h: Removed.
  • plugins/qt/PluginPackageQt.cpp:

(WebCore::PluginPackage::isPluginBlacklisted):

  • plugins/qt/PluginViewQt.cpp:

(WebCore::PluginView::setFocus):
(WebCore::PluginView::paintUsingXPixmap):
(WebCore::setSharedXEventFields):
(WebCore::PluginView::setNPWindowIfNeeded):
(WebCore::PluginView::setParentVisible):
(WebCore::PluginView::platformGetValue):
(WebCore::PluginView::invalidateRect):
(WebCore::getVisualAndColormap):
(WebCore::PluginView::platformStart):

  • plugins/win/PluginViewWin.cpp:

(windowHandleForPageClient):

Source/WebKit:

  • WebKit.pri:
  • WebKit1.pri:
  • WebKit1.pro:

Source/WebKit/qt:

  • Api/qgraphicswebview.cpp:

(QGraphicsWebView::sceneEvent):

  • Api/qgraphicswebview.h:
  • Api/qwebframe.cpp:
  • Api/qwebframe.h:
  • Api/qwebframe_p.h:
  • Api/qwebpage.cpp:

(QWebPage::event):

  • Api/qwebpage.h:
  • Api/qwebsettings.cpp:

(QWebSettings::enablePersistentStorage):

  • Api/qwebview.cpp:

(QWebView::QWebView):
(QWebView::event):

  • Api/qwebview.h:
  • WebCoreSupport/ChromeClientQt.cpp:

(WebCore::ChromeClientQt::setToolTip):

  • WebCoreSupport/FrameLoaderClientQt.cpp:

(WebCore::FrameLoaderClientQt::createPlugin):

  • WebCoreSupport/GeolocationClientQt.cpp:
  • WebCoreSupport/GeolocationClientQt.h:
  • WebCoreSupport/PageClientQt.cpp:

(createPlatformGraphicsContext3DFromWidget):
(QWebPageClient::ownerWindow):

  • WebCoreSupport/WebEventConversion.cpp:

(WebCore::WebKitPlatformTouchEvent::WebKitPlatformTouchEvent):

  • declarative/declarative.pro:
  • declarative/plugin.cpp:
  • declarative/public.pri:
  • examples/platformplugin/WebPlugin.cpp:

(WebPlugin::createExtension):

  • examples/platformplugin/WebPlugin.h:

(WebPlugin):

  • examples/platformplugin/platformplugin.pro:
  • tests/qobjectbridge/tst_qobjectbridge.cpp:

(tst_QObjectBridge::arrayObjectEnumerable):
(tst_QObjectBridge::ownership):
(tst_QObjectBridge::qObjectWrapperWithSameIdentity):

  • tests/tests.pri:
  • tests/util.h:

Source/WebKit2:

  • UIProcess/API/qt/qquickwebview.cpp:
  • UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:

(gatherAPI):

  • WebKit2.pri:

Source/WTF:

  • WTF.pri:
  • WTF.pro:
  • wtf/qt/StringQt.cpp:

(WTF::String::String):
(WTF::String::operator QString):

  • wtf/qt/UtilsQt.h: Removed.
  • wtf/qt/compat/QGuiApplication: Removed.
  • wtf/qt/compat/qguiapplication.h: Removed.
  • wtf/text/StringImpl.cpp:

(WTF::StringImpl::~StringImpl):
(WTF):

  • wtf/text/StringImpl.h:

(StringImpl):

Tools:

  • DumpRenderTree/qt/DumpRenderTree.pro:
  • DumpRenderTree/qt/EventSenderQt.cpp:

(EventSender::touchCancel):
(EventSender::sendTouchEvent):

  • DumpRenderTree/qt/EventSenderQt.h:

(EventSender):

  • DumpRenderTree/qt/ImageDiff.pro:
  • DumpRenderTree/qt/main.cpp:

(main):

  • QtTestBrowser/QtTestBrowser.pro:
  • QtTestBrowser/cookiejar.cpp:

(TestBrowserCookieJar::TestBrowserCookieJar):

  • QtTestBrowser/launcherwindow.cpp:

(LauncherWindow::setDiskCache):

  • qmake/configure.pri:
  • qmake/mkspecs/features/default_post.prf:
  • qmake/mkspecs/features/default_pre.prf:
  • qmake/mkspecs/features/features.prf:
  • qmake/mkspecs/features/functions.prf:
  • qmake/mkspecs/features/qtwebkit.prf: Removed.
  • qmake/mkspecs/features/unix/default_pre.prf:
Location:
trunk
Files:
9 deleted
85 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r124856 r124879  
     12012-07-19  Simon Hausmann  <simon.hausmann@nokia.com>
     2
     3        [Qt] Remove Qt 4 specific code paths
     4        https://bugs.webkit.org/show_bug.cgi?id=88161
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * Source/api.pri:
     9        * WebKit.pro:
     10
    1112012-08-06  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    212
  • trunk/Source/WTF/ChangeLog

    r124823 r124879  
     12012-07-19  Simon Hausmann  <simon.hausmann@nokia.com>
     2
     3        [Qt] Remove Qt 4 specific code paths
     4        https://bugs.webkit.org/show_bug.cgi?id=88161
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * WTF.pri:
     9        * WTF.pro:
     10        * wtf/qt/StringQt.cpp:
     11        (WTF::String::String):
     12        (WTF::String::operator QString):
     13        * wtf/qt/UtilsQt.h: Removed.
     14        * wtf/qt/compat/QGuiApplication: Removed.
     15        * wtf/qt/compat/qguiapplication.h: Removed.
     16        * wtf/text/StringImpl.cpp:
     17        (WTF::StringImpl::~StringImpl):
     18        (WTF):
     19        * wtf/text/StringImpl.h:
     20        (StringImpl):
     21
    1222012-08-06  Patrick Gansterer  <paroga@webkit.org>
    223
  • trunk/Source/WTF/WTF.pri

    r122845 r124879  
    99INCLUDEPATH += $$PWD
    1010
    11 haveQt(5) {
    12     mac {
    13         # Mac OS does ship libicu but not the associated header files.
    14         # Therefore WebKit provides adequate header files.
    15         INCLUDEPATH += $${ROOT_WEBKIT_DIR}/Source/WTF/icu
    16         LIBS += -licucore
     11mac {
     12    # Mac OS does ship libicu but not the associated header files.
     13    # Therefore WebKit provides adequate header files.
     14    INCLUDEPATH += $${ROOT_WEBKIT_DIR}/Source/WTF/icu
     15    LIBS += -licucore
     16} else {
     17    contains(QT_CONFIG,icu) {
     18        win32: LIBS += -licuin -licuuc -licudt
     19        else: LIBS += -licui18n -licuuc -licudata
    1720    } else {
    18         contains(QT_CONFIG,icu) {
    19             win32: LIBS += -licuin -licuuc -licudt
    20             else: LIBS += -licui18n -licuuc -licudata
    21         } else {
    22             error("To build QtWebKit with Qt 5 you need ICU")
    23         }
     21        error("To build QtWebKit with Qt 5 you need ICU")
    2422    }
    2523}
  • trunk/Source/WTF/WTF.pro

    r124365 r124879  
    111111    Platform.h \
    112112    PossiblyNull.h \
    113     qt/UtilsQt.h \
    114113    RandomNumber.h \
    115114    RandomNumberSeed.h \
  • trunk/Source/WTF/wtf/qt/StringQt.cpp

    r119222 r124879  
    3838    if (qstr.isNull())
    3939        return;
    40 #if HAVE(QT5)
    4140    m_impl = StringImpl::adopt(const_cast<QString&>(qstr).data_ptr());
    42 #else
    43     m_impl = StringImpl::create(reinterpret_cast_ptr<const UChar*>(qstr.constData()), qstr.length());
    44 #endif
    4541}
    4642
     
    5753        return QString();
    5854
    59 #if HAVE(QT5)
    6055    if (QStringData* qStringData = m_impl->qStringData()) {
    6156        // The WTF string was adopted from a QString at some point, so we
     
    6560        return QString(qStringDataPointer);
    6661    }
    67 #endif
     62
    6863    if (is8Bit() && !m_impl->has16BitShadow()) {
    6964        // Asking for characters() of an 8-bit string will make a 16-bit copy internally
  • trunk/Source/WTF/wtf/text/StringImpl.cpp

    r124611 r124879  
    7070        return;
    7171    }
    72 #if PLATFORM(QT) && HAVE(QT5)
     72#if PLATFORM(QT)
    7373    if (ownership == BufferAdoptedQString) {
    7474        if (!m_qStringData->ref.deref())
     
    16581658}
    16591659
    1660 #if PLATFORM(QT) && HAVE(QT5)
     1660#if PLATFORM(QT)
    16611661PassRefPtr<StringImpl> StringImpl::adopt(QStringData* qStringData)
    16621662{
  • trunk/Source/WTF/wtf/text/StringImpl.h

    r124611 r124879  
    3232#include <wtf/unicode/Unicode.h>
    3333
    34 #if PLATFORM(QT) && HAVE(QT5)
     34#if PLATFORM(QT)
    3535#include <QString>
    3636#endif
     
    8989        BufferOwned,
    9090        BufferSubstring,
    91 #if PLATFORM(QT) && HAVE(QT5)
     91#if PLATFORM(QT)
    9292        BufferAdoptedQString
    9393#endif
     
    239239    }
    240240
    241 #if PLATFORM(QT) && HAVE(QT5)
     241#if PLATFORM(QT)
    242242    // Used to create new strings that adopt an existing QString's data
    243243    enum ConstructAdoptedQStringTag { ConstructAdoptedQString };
     
    365365    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> adopt(StringBuffer<LChar>&);
    366366
    367 #if PLATFORM(QT) && HAVE(QT5)
     367#if PLATFORM(QT)
    368368    static PassRefPtr<StringImpl> adopt(QStringData*);
    369369#endif
     
    430430    }
    431431
    432 #if PLATFORM(QT) && HAVE(QT5)
     432#if PLATFORM(QT)
    433433    QStringData* qStringData() { return bufferOwnership() == BufferAdoptedQString ? m_qStringData : 0; }
    434434#endif
     
    658658        StringImpl* m_substringBuffer;
    659659        mutable UChar* m_copyData16;
    660 #if PLATFORM(QT) && HAVE(QT5)
     660#if PLATFORM(QT)
    661661        QStringData* m_qStringData;
    662662#endif
  • trunk/Source/WebCore/ChangeLog

    r124878 r124879  
     12012-08-02  Simon Hausmann  <simon.hausmann@nokia.com>
     2
     3        [Qt] Remove Qt 4 specific code paths
     4        https://bugs.webkit.org/show_bug.cgi?id=88161
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * Target.pri:
     9        * WebCore.pri:
     10        * bridge/qt/qt_class.cpp:
     11        (JSC::Bindings::QtClass::fallbackObject):
     12        * bridge/qt/qt_instance.cpp:
     13        (JSC::Bindings::QtInstance::getPropertyNames):
     14        (JSC::Bindings::QtInstance::stringValue):
     15        (JSC::Bindings::QtField::setValueToInstance):
     16        * bridge/qt/qt_runtime.h:
     17        (QtConnectionObject):
     18        * bridge/qt/qt_runtime_qt4.cpp: Removed.
     19        * editing/qt/SmartReplaceQt.cpp: Removed.
     20        * page/qt/EventHandlerQt.cpp:
     21        (WebCore::EventHandler::tabsToAllFormControls):
     22        * platform/graphics/GraphicsContext3D.h:
     23        * platform/graphics/OpenGLShims.cpp:
     24        (WebCore::getProcAddress):
     25        * platform/graphics/OpenGLShims.h:
     26        * platform/graphics/gstreamer/PlatformVideoWindowPrivate.h:
     27        * platform/graphics/gstreamer/PlatformVideoWindowQt.cpp:
     28        (FullScreenVideoWindow::FullScreenVideoWindow):
     29        (FullScreenVideoWindow::keyPressEvent):
     30        (FullScreenVideoWindow::event):
     31        (FullScreenVideoWindow::showFullScreen):
     32        (PlatformVideoWindow::PlatformVideoWindow):
     33        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     34        (WebCore::GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext):
     35        (WebCore::GraphicsContext3DPrivate::makeCurrentIfNeeded):
     36        * platform/graphics/qt/GraphicsContextQt.cpp:
     37        (WebCore::GraphicsContext::releaseWindowsContext):
     38        * platform/graphics/qt/ImageQt.cpp:
     39        (WebCore::BitmapImage::create):
     40        * platform/graphics/qt/SimpleFontDataQt.cpp:
     41        (WebCore::SimpleFontData::platformInit):
     42        * platform/graphics/texmap/TextureMapper.h:
     43        * platform/graphics/texmap/TextureMapperGL.cpp:
     44        (WebCore::TextureMapperGLData::SharedGLData::getCurrentGLContext):
     45        * platform/qt/DeviceMotionProviderQt.h:
     46        * platform/qt/DeviceOrientationProviderQt.h:
     47        * platform/qt/KURLQt.cpp:
     48        (WebCore::KURL::operator QUrl):
     49        * platform/qt/PlatformScreenQt.cpp:
     50        (WebCore::screenDepth):
     51        (WebCore::screenDepthPerComponent):
     52        (WebCore::screenIsMonochrome):
     53        (WebCore::screenRect):
     54        (WebCore::screenAvailableRect):
     55        * platform/qt/QWebPageClient.h:
     56        (QWebPageClient):
     57        * platform/qt/RenderThemeQt.cpp:
     58        * platform/text/qt/TextBreakIteratorQt.cpp: Removed.
     59        * plugins/qt/PluginContainerQt.cpp: Removed.
     60        * plugins/qt/PluginContainerQt.h: Removed.
     61        * plugins/qt/PluginPackageQt.cpp:
     62        (WebCore::PluginPackage::isPluginBlacklisted):
     63        * plugins/qt/PluginViewQt.cpp:
     64        (WebCore::PluginView::setFocus):
     65        (WebCore::PluginView::paintUsingXPixmap):
     66        (WebCore::setSharedXEventFields):
     67        (WebCore::PluginView::setNPWindowIfNeeded):
     68        (WebCore::PluginView::setParentVisible):
     69        (WebCore::PluginView::platformGetValue):
     70        (WebCore::PluginView::invalidateRect):
     71        (WebCore::getVisualAndColormap):
     72        (WebCore::PluginView::platformStart):
     73        * plugins/win/PluginViewWin.cpp:
     74        (windowHandleForPageClient):
     75
    1762012-08-06  Andrey Kosyakov  <caseq@chromium.org>
    277
  • trunk/Source/WebCore/Target.pri

    r124857 r124879  
    1616
    1717DEFINES += QT_MAKEDLL
    18 
    19 !haveQt(5) {
    20     INCLUDEPATH += $$PWD/../WTF/wtf/qt/compat
    21 }
    2218
    2319RESOURCES += \
     
    232228     bridge/qt/qt_instance.cpp \
    233229     bridge/qt/qt_pixmapruntime.cpp \
     230     bridge/qt/qt_runtime.cpp \
    234231     bridge/runtime_array.cpp \
    235232     bridge/runtime_method.cpp \
     
    238235     testing/js/WebCoreTestSupport.cpp
    239236
    240 haveQt(5) {
    241     SOURCES += bridge/qt/qt_runtime.cpp
    242 } else {
    243     SOURCES += bridge/qt/qt_runtime_qt4.cpp
    244 }
    245237
    246238SOURCES += \
     
    28192811}
    28202812
    2821 haveQt(5) {
    2822     contains(QT_CONFIG,icu)|mac: SOURCES += platform/text/TextBreakIteratorICU.cpp
    2823     mac {
    2824         # For Mac we use the same SmartReplace implementation as the Apple port.
    2825         SOURCES += editing/SmartReplaceCF.cpp
    2826         INCLUDEPATH += $$PWD/icu
    2827     } else {
    2828         SOURCES += editing/SmartReplaceICU.cpp
    2829     }
     2813contains(QT_CONFIG,icu)|mac: SOURCES += platform/text/TextBreakIteratorICU.cpp
     2814mac {
     2815    # For Mac we use the same SmartReplace implementation as the Apple port.
     2816    SOURCES += editing/SmartReplaceCF.cpp
     2817    INCLUDEPATH += $$PWD/icu
    28302818} else {
    2831     SOURCES += platform/text/qt/TextBreakIteratorQt.cpp \
    2832                editing/qt/SmartReplaceQt.cpp
     2819    SOURCES += editing/SmartReplaceICU.cpp
    28332820}
    28342821
     
    28492836                plugins/qt/PluginPackageQt.cpp \
    28502837                plugins/qt/PluginViewQt.cpp
    2851 
    2852             haveQt(4) {
    2853                 SOURCES += plugins/qt/PluginContainerQt.cpp
    2854                 HEADERS += plugins/qt/PluginContainerQt.h
    2855             }
    28562838        }
    28572839    }
  • trunk/Source/WebCore/WebCore.pri

    r124492 r124879  
    88SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebCore
    99
    10 QT *= network sql
    11 haveQt(5): QT *= core-private gui-private
     10QT *= network sql core-private gui-private
    1211
    1312WEBCORE_GENERATED_SOURCES_DIR = $${ROOT_BUILD_DIR}/Source/WebCore/$${GENERATED_SOURCES_DESTDIR}
     
    151150}
    152151
    153 contains(DEFINES, ENABLE_GEOLOCATION=1) {
    154     CONFIG *= mobility
    155     MOBILITY *= location
    156 }
    157 
    158152contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1)|contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
    159     haveQt(5) {
    160         QT += sensors
    161     } else {
    162         CONFIG *= mobility
    163         MOBILITY *= sensors
    164     }
     153    QT += sensors
    165154}
    166155
     
    194183    mac: LIBS += -framework IOSurface -framework CoreFoundation
    195184    linux-*:contains(DEFINES, HAVE_XCOMPOSITE=1): LIBS += -lXcomposite
    196     haveQt(4): QT *= opengl
    197185}
    198186
     
    205193}
    206194
    207 haveQt(5) {
    208     # Qt5 allows us to use config tests to check for the presence of these libraries
    209     config_libjpeg {
    210         DEFINES += WTF_USE_LIBJPEG=1
    211         LIBS += -ljpeg
    212     } else {
    213         warning("JPEG library not found! QImageDecoder will decode JPEG images.")
    214     }
    215     config_libpng {
    216         DEFINES += WTF_USE_LIBPNG=1
    217         LIBS += -lpng
    218     } else {
    219         warning("PNG library not found! QImageDecoder will decode PNG images.")
    220     }
    221     config_libwebp {
    222         DEFINES += WTF_USE_WEBP=1
    223         LIBS += -lwebp
    224     }
     195# Qt5 allows us to use config tests to check for the presence of these libraries
     196config_libjpeg {
     197    DEFINES += WTF_USE_LIBJPEG=1
     198    LIBS += -ljpeg
    225199} else {
    226     !win32-*:!mac {
    227         DEFINES += WTF_USE_LIBJPEG=1 WTF_USE_LIBPNG=1
    228         LIBS += -ljpeg -lpng
    229     }
     200    warning("JPEG library not found! QImageDecoder will decode JPEG images.")
     201}
     202config_libpng {
     203    DEFINES += WTF_USE_LIBPNG=1
     204    LIBS += -lpng
     205} else {
     206    warning("PNG library not found! QImageDecoder will decode PNG images.")
     207}
     208config_libwebp {
     209    DEFINES += WTF_USE_WEBP=1
     210    LIBS += -lwebp
    230211}
    231212
     
    277258
    278259unix|win32-g++* {
    279     QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork
    280     haveQt(5): QMAKE_PKGCONFIG_REQUIRES += QtWidgets
     260    QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork QtWidgets
    281261}
    282262
  • trunk/Source/WebCore/bridge/qt/qt_class.cpp

    r119584 r124879  
    100100            continue;
    101101
    102 #if !HAVE(QT5)
    103         int iter = 0;
    104         const char* signature = m.signature();
    105         while (signature[iter] && signature[iter] != '(')
    106             ++iter;
    107 
    108         if (normal == QByteArray::fromRawData(signature, iter)) {
    109 #else
    110102        if (normal == m.name()) {
    111 #endif
    112103            QtRuntimeMetaMethod* val = QtRuntimeMetaMethod::create(exec, ustring, static_cast<QtInstance*>(inst), index, normal, false);
    113104            qtinst->m_methods.insert(name, val);
  • trunk/Source/WebCore/bridge/qt/qt_instance.cpp

    r121381 r124879  
    224224            QMetaMethod method = meta->method(i);
    225225            if (method.access() != QMetaMethod::Private) {
    226 #if HAVE(QT5)
    227226                QByteArray sig = method.methodSignature();
    228227                array.add(Identifier(exec, UString(sig.constData(), sig.length())));
    229 #else
    230                 array.add(Identifier(exec, method.signature()));
    231 #endif
    232228            }
    233229        }
     
    276272            if (m.access() != QMetaMethod::Private
    277273                && m.methodType() != QMetaMethod::Signal
    278 #if HAVE(QT5)
    279274                && m.parameterCount() == 0
    280275                && m.returnType() != QMetaType::Void) {
     
    287282                        buf = ret.toString().toLatin1().constData(); // ### Latin 1? Ascii?
    288283                        useDefault = false;
    289 #else
    290                 && m.parameterTypes().isEmpty()) {
    291                 const char* retsig = m.typeName();
    292                 if (retsig && *retsig) {
    293                     QVariant ret(QMetaType::type(retsig), (void*)0);
    294                     void * qargs[1];
    295                     qargs[0] = ret.data();
    296 
    297                     if (QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, index, qargs) < 0) {
    298                         if (ret.isValid() && ret.canConvert(QVariant::String)) {
    299                             buf = ret.toString().toLatin1().constData(); // ### Latin 1? Ascii?
    300                             useDefault = false;
    301                         }
    302 #endif
    303284                    }
    304285                }
     
    390371        QMetaType::Type argtype = QMetaType::Void;
    391372        if (m_type == MetaProperty)
    392 #if HAVE(QT5)
    393373            argtype = (QMetaType::Type) m_property.userType();
    394 #else
    395             argtype = (QMetaType::Type) QMetaType::type(m_property.typeName());
    396 #endif
    397374
    398375        // dynamic properties just get any QVariant
  • trunk/Source/WebCore/bridge/qt/qt_runtime.h

    r120704 r124879  
    239239class QtConnectionObject : public QObject
    240240{
    241 #if HAVE(QT5)
    242241    Q_OBJECT_FAKE
    243 #endif
    244242public:
    245243    QtConnectionObject(JSContextRef, PassRefPtr<QtInstance> senderInstance, int signalIndex, JSObjectRef receiver, JSObjectRef receiverFunction);
    246244    ~QtConnectionObject();
    247 
    248 #if !HAVE(QT5)
    249     // Explicitly define these because want a custom qt_metacall(), so we can't use Q_OBJECT macro.
    250     static const QMetaObject staticMetaObject;
    251     virtual const QMetaObject *metaObject() const;
    252     virtual void *qt_metacast(const char *);
    253     virtual int qt_metacall(QMetaObject::Call, int, void **argv);
    254 #endif
    255245
    256246    void execute(void **argv);
  • trunk/Source/WebCore/page/qt/EventHandlerQt.cpp

    r119098 r124879  
    5151#include "Scrollbar.h"
    5252
    53 #if !HAVE(QT5)
    54 QT_BEGIN_NAMESPACE
    55 Q_GUI_EXPORT extern bool qt_tab_all_widgets; // from qapplication.cpp
    56 QT_END_NAMESPACE
    57 #endif
    58 
    5953namespace WebCore {
    6054
     
    6761bool EventHandler::tabsToAllFormControls(KeyboardEvent* event) const
    6862{
    69 #if HAVE(QT5)
    7063    return !isKeyboardOptionTab(event);
    71 #else
    72     return (isKeyboardOptionTab(event) ? !qt_tab_all_widgets : qt_tab_all_widgets);
    73 #endif
    7464}
    7565
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h

    r123702 r124879  
    6969typedef CGLContextObj PlatformGraphicsContext3D;
    7070#elif PLATFORM(QT)
    71 #if HAVE(QT5)
    7271typedef QOpenGLContext* PlatformGraphicsContext3D;
    7372typedef QSurface* PlatformGraphicsSurface3D;
    74 #else
    75 typedef QGLContext* PlatformGraphicsContext3D;
    76 typedef QGLWidget* PlatformGraphicsSurface3D;
    77 #endif
    7873#else
    7974typedef void* PlatformGraphicsContext3D;
  • trunk/Source/WebCore/platform/graphics/OpenGLShims.cpp

    r122175 r124879  
    4343static void* getProcAddress(const char* procName)
    4444{
    45 #if HAVE(QT5)
    4645    return reinterpret_cast<void*>(QOpenGLContext::currentContext()->getProcAddress(procName));
    47 #else
    48     return reinterpret_cast<void*>(QGLContext::currentContext()->getProcAddress(QString::fromLatin1(procName)));
    49 #endif
    5046}
    5147#else
  • trunk/Source/WebCore/platform/graphics/OpenGLShims.h

    r119098 r124879  
    2323#if PLATFORM(QT)
    2424#include <qglobal.h>
    25 #if HAVE(QT5)
    2625#include <qopenglfunctions.h>
    2726#include <QOpenGLContext>
    2827#include <QSurface>
    29 #else
    30 #include <QGLContext>
    31 #endif
    3228#else
    3329#include <GL/gl.h>
  • trunk/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h

    r119098 r124879  
    2424#include <QTimer>
    2525
    26 #if defined(HAVE_QT5) && HAVE_QT5
    2726#include <QWindow>
    28 #else
    29 #include <QWidget>
    30 #endif
    3127
    3228namespace WebCore {
     
    3430class HTMLVideoElement;
    3531
    36 #if defined(HAVE_QT5) && HAVE_QT5
    37 typedef QWindow Base;
    38 #else
    39 typedef QWidget Base;
    40 #endif
    41 
    42 class FullScreenVideoWindow: public Base {
     32class FullScreenVideoWindow: public QWindow {
    4333Q_OBJECT
    4434public:
  • trunk/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp

    r119098 r124879  
    3939    : m_mediaElement(0)
    4040{
    41 #if !HAVE(QT5)
    42     setAttribute(Qt::WA_NativeWindow);
    43     setAttribute(Qt::WA_NoSystemBackground, true);
    44     setAttribute(Qt::WA_PaintOnScreen, true);
    45 #endif
    4641    setWindowModality(Qt::ApplicationModal);
    4742
     
    6661    } else if (ev->key() == Qt::Key_Escape)
    6762        emit closed();
    68     Base::keyPressEvent(ev);
     63    QWindow::keyPressEvent(ev);
    6964}
    7065
     
    8479        m_cursorTimer.stop();
    8580#endif
    86 #if !HAVE(QT5)
    87         setMouseTracking(false);
    88         releaseMouse();
    89 #endif
    9081#ifndef QT_NO_CURSOR
    9182        QGuiApplication::restoreOverrideCursor();
     
    9586        break;
    9687    }
    97     return Base::event(ev);
     88    return QWindow::event(ev);
    9889}
    9990
    10091void FullScreenVideoWindow::showFullScreen()
    10192{
    102     Base::showFullScreen();
    103 #if !HAVE(QT5)
    104     setMouseTracking(true);
    105 #endif
     93    QWindow::showFullScreen();
    10694    raise();
    107 #if !HAVE(QT5)
    108     setFocus();
    109 #endif
    11095    hideCursor();
    11196}
     
    129114PlatformVideoWindow::PlatformVideoWindow()
    130115{
    131     Base* win = new FullScreenVideoWindow();
     116    QWindow* win = new FullScreenVideoWindow();
    132117    m_window = win;
    133118    win->setWindowFlags(win->windowFlags() | Qt::FramelessWindowHint);
    134119    // FIXME: Port to Qt 5.
    135 #if !HAVE(QT5)
    136     QPalette p;
    137     p.setColor(QPalette::Base, Qt::black);
    138     p.setColor(QPalette::Window, Qt::black);
    139     win->setPalette(p);
    140 #endif
    141120    win->showFullScreen();
    142121    m_videoWindowId = win->winId();
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r122953 r124879  
    3535#include "QWebPageClient.h"
    3636#include "SharedBuffer.h"
    37 #if HAVE(QT5)
    3837#include <QWindow>
    3938#include <qpa/qplatformpixmap.h>
    40 #endif
    4139#include <wtf/UnusedParam.h>
    4240#include <wtf/text/CString.h>
     
    256254        return;
    257255
    258 #if HAVE(QT5)
    259256    const QOpenGLContext* currentContext = QOpenGLContext::currentContext();
    260257    QSurface* currentSurface = 0;
     
    266263    if (currentSurface)
    267264        const_cast<QOpenGLContext*>(currentContext)->makeCurrent(currentSurface);
    268 #else
    269     const QGLContext* currentContext = QGLContext::currentContext();
    270     const QGLContext* widgetContext = m_surface->context();
    271     if (currentContext != widgetContext)
    272         m_surface->makeCurrent();
    273     blitMultisampleFramebuffer();
    274     if (currentContext) {
    275         if (currentContext != widgetContext)
    276             const_cast<QGLContext*>(currentContext)->makeCurrent();
    277     } else
    278         m_surface->doneCurrent();
    279 #endif
    280265}
    281266
    282267bool GraphicsContext3DPrivate::makeCurrentIfNeeded() const
    283268{
    284 #if HAVE(QT5)
    285269    const QOpenGLContext* currentContext = QOpenGLContext::currentContext();
    286270    if (currentContext == m_platformContext)
    287271        return true;
    288272    return m_platformContext->makeCurrent(m_surface);
    289 #else
    290     const QGLContext* currentContext = QGLContext::currentContext();
    291     const QGLContext* widgetContext = m_surface->context();
    292     if (currentContext != widgetContext)
    293         m_surface->makeCurrent();
    294 
    295     return QGLContext::currentContext() == widgetContext;
    296 #endif
    297273}
    298274
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp

    r123912 r124879  
    6767#include <wtf/MathExtras.h>
    6868
    69 #if OS(WINDOWS) && HAVE(QT5)
     69#if OS(WINDOWS)
    7070Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP, int hbitmapFormat = 0);
    7171
     
    14711471            ASSERT(info.bmBitsPixel == 32);
    14721472
    1473 #if HAVE(QT5)
    14741473            QPixmap pixmap = qt_pixmapFromWinHBITMAP(bitmap, supportAlphaBlend ? HBitmapPremultipliedAlpha : HBitmapNoAlpha);
    1475 #else
    1476             QPixmap pixmap = QPixmap::fromWinHBITMAP(bitmap, supportAlphaBlend ? QPixmap::PremultipliedAlpha : QPixmap::NoAlpha);
    1477 #endif
    14781474            m_data->p()->drawPixmap(dstRect, pixmap);
    14791475
  • trunk/Source/WebCore/platform/graphics/qt/ImageQt.cpp

    r122726 r124879  
    5353#include <math.h>
    5454
    55 #if OS(WINDOWS) && HAVE(QT5)
     55#if OS(WINDOWS)
    5656Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP, int hbitmapFormat = 0);
    5757#endif
     
    300300PassRefPtr<BitmapImage> BitmapImage::create(HBITMAP hBitmap)
    301301{
    302 #if HAVE(QT5)
    303302    QImage* nativeImage = new QImage(qt_pixmapFromWinHBITMAP(hBitmap).toImage());
    304 #else
    305     QImage* nativeImage = new QImage(QPixmap::fromWinHBITMAP(hBitmap).toImage());
     303
     304    return BitmapImage::create(nativeImage);
     305}
    306306#endif
    307307
    308     return BitmapImage::create(nativeImage);
    309 }
    310 #endif
    311 
    312308}
    313309
  • trunk/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp

    r119098 r124879  
    149149#endif
    150150
    151 #if !HAVE(QT5)
    152     // Qt subtracts 1 from the descent to account for the baseline,
    153     // we add it back here to get correct metrics for WebKit.
    154     descent += 1;
    155 #endif
    156 
    157151    // The line spacing should always be >= (ascent + descent), but this
    158152    // may be false in some cases due to misbehaving platform libraries.
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h

    r122275 r124879  
    2525#if PLATFORM(QT)
    2626#include <qglobal.h>
    27 
    28 #if defined(QT_OPENGL_LIB) || HAVE(QT5)
    29     #if defined(QT_OPENGL_ES_2) && !defined(TEXMAP_OPENGL_ES_2)
    30         #define TEXMAP_OPENGL_ES_2
    31     #endif
     27#if defined(QT_OPENGL_ES_2) && !defined(TEXMAP_OPENGL_ES_2)
     28    #define TEXMAP_OPENGL_ES_2
    3229#endif
    3330#endif
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp

    r123894 r124879  
    3939#if PLATFORM(QT)
    4040#include "NativeImageQt.h"
    41 #if HAVE(QT5)
    4241#include <QOpenGLContext>
    43 #else
    44 #include <QGLContext>
    45 #endif // QT_VERSION
    4642#elif OS(WINDOWS)
    4743#include <windows.h>
     
    6359    struct SharedGLData : public RefCounted<SharedGLData> {
    6460#if PLATFORM(QT)
    65 #if QT_VERSION >= 0x050000
    6661        typedef QOpenGLContext* GLContext;
    6762        static GLContext getCurrentGLContext()
     
    6964            return QOpenGLContext::currentContext();
    7065        }
    71 #else
    72         typedef const QGLContext* GLContext;
    73         static GLContext getCurrentGLContext()
    74         {
    75             return QGLContext::currentContext();
    76         }
    77 #endif
    7866#elif OS(WINDOWS)
    7967        typedef HGLRC GLContext;
  • trunk/Source/WebCore/platform/qt/DeviceMotionProviderQt.h

    r120224 r124879  
    2525#include <QAccelerometerFilter>
    2626#include <wtf/RefPtr.h>
    27 
    28 #if !HAVE(QT5)
    29 using QTM_NAMESPACE::QAccelerometer;
    30 using QTM_NAMESPACE::QAccelerometerFilter;
    31 using QTM_NAMESPACE::QAccelerometerReading;
    32 #endif
    3327
    3428namespace WebCore {
  • trunk/Source/WebCore/platform/qt/DeviceOrientationProviderQt.h

    r121016 r124879  
    2626#include <wtf/RefPtr.h>
    2727
    28 #if !HAVE(QT5)
    29 using QTM_NAMESPACE::QRotationFilter;
    30 using QTM_NAMESPACE::QRotationReading;
    31 using QTM_NAMESPACE::QRotationSensor;
    32 #endif
    33 
    3428namespace WebCore {
    3529
  • trunk/Source/WebCore/platform/qt/KURLQt.cpp

    r119098 r124879  
    3535KURL::operator QUrl() const
    3636{
    37 #if !HAVE(QT5)
    38     QString str = QString::fromRawData(reinterpret_cast<const QChar*>(m_string.characters()), m_string.length());
    39     QByteArray ba = str.toUtf8();
    40 
    41     QUrl url = QUrl::fromEncoded(ba);
    42     return url;
    43 #else
    4437    return QUrl(m_string);
    45 #endif
    4638}
    4739
  • trunk/Source/WebCore/platform/qt/PlatformScreenQt.cpp

    r122655 r124879  
    3939#include "Widget.h"
    4040#include "QWebPageClient.h"
    41 #if HAVE(QT5)
    4241#include <QGuiApplication>
    4342#include <QScreen>
    44 #else
    45 #include <QApplication>
    46 #include <QDesktopWidget>
    47 #endif
    4843
    4944namespace WebCore {
     
    7267int screenDepth(Widget* w)
    7368{
    74 #if HAVE(QT5)
    7569    return QGuiApplication::screens().value(screenNumber(w))->depth();
    76 #else
    77     return QApplication::desktop()->screen(screenNumber(w))->depth();
    78 #endif
    7970}
    8071
    8172int screenDepthPerComponent(Widget* w)
    8273{
    83 #if HAVE(QT5)
    8474    int depth = QGuiApplication::primaryScreen()->depth();
    8575    // FIXME: Use widget's screen
    8676    Q_UNUSED(w);
    87 #else
    88     int depth = QApplication::desktop()->screen(0)->depth();
    89     if (w) {
    90         QWebPageClient* client = w->root()->hostWindow()->platformPageClient();
    91 
    92         if (client) {
    93             QWidget* view = client->ownerWidget();
    94             if (view)
    95                 depth = view->depth();
    96         }
    97     }
    98 #endif
    9977    // An interface to establish the actual number of bits per color
    10078    // doesn't exist in Qt, or probably at all, so use common-sense
     
    11593bool screenIsMonochrome(Widget* w)
    11694{
    117 #if HAVE(QT5)
    11895    Q_UNUSED(w);
    11996    // FIXME: In Qt 5 colorCount() isn't even implemented beyond returning 256 :)
    12097    return false;
    121 #else
    122     return QApplication::desktop()->screen(screenNumber(w))->colorCount() == 2;
    123 #endif
    12498}
    12599
    126100FloatRect screenRect(Widget* widget)
    127101{
    128 #if HAVE(QT5)
    129102    QRect r = QGuiApplication::screens().value(screenNumber(widget))->geometry();
    130 #else
    131     QRect r = QApplication::desktop()->screenGeometry(screenNumber(widget));
    132 #endif
    133103    return FloatRect(r.x(), r.y(), r.width(), r.height());
    134104}
     
    136106FloatRect screenAvailableRect(Widget* widget)
    137107{
    138 #if HAVE(QT5)
    139108    QRect r = QGuiApplication::screens().value(screenNumber(widget))->availableGeometry();
    140 #else
    141     QRect r = QApplication::desktop()->availableGeometry(screenNumber(widget));
    142 #endif
    143109    return FloatRect(r.x(), r.y(), r.width(), r.height());
    144110}
  • trunk/Source/WebCore/platform/qt/QWebPageClient.h

    r122175 r124879  
    111111                                                 PlatformGraphicsSurface3D*) = 0;
    112112#endif
    113 #if HAVE(QT5)
    114113    virtual QWindow* ownerWindow() const;
    115 #endif
    116114
    117115protected:
  • trunk/Source/WebCore/platform/qt/RenderThemeQt.cpp

    r123443 r124879  
    6666#include <QFontMetrics>
    6767
    68 #if QT_VERSION >= 0x050000
    6968#include <QStyleHints>
    70 #endif
    7169
    7270namespace WebCore {
  • trunk/Source/WebCore/plugins/qt/PluginPackageQt.cpp

    r119098 r124879  
    133133bool PluginPackage::isPluginBlacklisted()
    134134{
    135 #if HAVE(QT5)
    136135    // TODO: enumerate all plugins that are incompatible with Qt5.
    137136    const QLatin1String pluginBlacklist[] = {
     
    144143            return true;
    145144    }
    146 #endif
    147145    return false;
    148146}
  • trunk/Source/WebCore/plugins/qt/PluginViewQt.cpp

    r121710 r124879  
    8080#include <runtime/JSValue.h>
    8181
    82 #if HAVE(QT5)
    8382#include "QtX11ImageConversion.h"
    8483#include <QGuiApplication>
    8584#include <qpa/qplatformnativeinterface.h>
    8685#include <QWindow>
    87 #else
    88 #include "PluginContainerQt.h"
    89 #include <QApplication>
    90 #include <QDesktopWidget>
    91 #include <QGraphicsWidget>
    92 #include <QStyleOptionGraphicsItem>
    93 #include <QWidget>
    94 #include <QX11Info>
    95 #endif
    9686
    9787using JSC::ExecState;
     
    200190void PluginView::setFocus(bool focused)
    201191{
    202 #if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet (so platformPluginWidget() is always null).
    203     if (platformPluginWidget()) {
    204         if (focused)
    205             static_cast<QWidget*>(platformPluginWidget())->setFocus(Qt::OtherFocusReason);
    206     } else
    207 #endif
    208         Widget::setFocus(focused);
     192    Widget::setFocus(focused);
    209193}
    210194
     
    239223    XEvent xevent;
    240224
    241 #if HAVE(QT5)
    242225    setupGraphicsExposeEvent(m_drawable, exposedRect, xevent);
    243 #else
    244     QPixmap qtDrawable = QPixmap::fromX11Pixmap(m_drawable, QPixmap::ExplicitlyShared);
    245     const int drawableDepth = ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth;
    246     ASSERT(drawableDepth == qtDrawable.depth());
    247 
    248     // When printing, Qt uses a QPicture to capture the output in preview mode. The
    249     // QPicture holds a reference to the X Pixmap. As a result, the print preview would
    250     // update itself when the X Pixmap changes. To prevent this, we create a copy.
    251     if (m_element->document()->printing())
    252         qtDrawable = qtDrawable.copy();
    253 
    254     if (m_isTransparent && drawableDepth != 32) {
    255         // Attempt content propagation for drawable with no alpha by copying over from the backing store
    256         QPoint offset;
    257         QPaintDevice* backingStoreDevice =  QPainter::redirected(painter->device(), &offset);
    258         offset = -offset; // negating the offset gives us the offset of the view within the backing store pixmap
    259 
    260         const bool hasValidBackingStore = backingStoreDevice && backingStoreDevice->devType() == QInternal::Pixmap;
    261         QPixmap* backingStorePixmap = static_cast<QPixmap*>(backingStoreDevice);
    262 
    263         // We cannot grab contents from the backing store when painting on QGraphicsView items
    264         // (because backing store contents are already transformed). What we really mean to do
    265         // here is to check if we are painting on QWebView, but let's be a little permissive :)
    266         QWebPageClient* client = platformPageClient();
    267         const bool backingStoreHasUntransformedContents = client && qobject_cast<QWidget*>(client->pluginParent());
    268 
    269         if (hasValidBackingStore && backingStorePixmap->depth() == drawableDepth
    270             && backingStoreHasUntransformedContents) {
    271             GC gc = XDefaultGC(QX11Info::display(), QX11Info::appScreen());
    272             XCopyArea(QX11Info::display(), backingStorePixmap->handle(), m_drawable, gc,
    273                 offset.x() + m_windowRect.x() + exposedRect.x(), offset.y() + m_windowRect.y() + exposedRect.y(),
    274                 exposedRect.width(), exposedRect.height(), exposedRect.x(), exposedRect.y());
    275         } else { // no backing store, clean the pixmap because the plugin thinks its transparent
    276             QPainter painter(&qtDrawable);
    277             painter.fillRect(exposedRect, Qt::white);
    278         }
    279 
    280         if (shouldSyncX)
    281             syncX();
    282     }
    283 
    284     setupGraphicsExposeEvent(qtDrawable.handle(), exposedRect, xevent);
    285 #endif
    286 
    287226    dispatchNPEvent(xevent);
    288227
     
    290229        XSync(m_pluginDisplay, false); // sync changes by plugin
    291230
    292 #if HAVE(QT5)
    293231    XImage* xImage = XGetImage(x11Display(), m_drawable, exposedRect.x(), exposedRect.y(),
    294232                               exposedRect.width(), exposedRect.height(), ULONG_MAX, ZPixmap);
    295233    painter->drawImage(QPoint(exposedRect.x(), exposedRect.y()), qimageFromXImage(xImage), exposedRect);
    296234    XDestroyImage(xImage);
    297 #else
    298     painter->drawPixmap(QPoint(exposedRect.x(), exposedRect.y()), qtDrawable, exposedRect);
    299 #endif
    300235}
    301236
     
    370305    // but does in the case of KeyPress, KeyRelease, ButtonPress, ButtonRelease, and MotionNotify
    371306    // events; thus, this is right:
    372 #if HAVE(QT5)
    373307    QWindow* window = pageClient ? pageClient->ownerWindow() : 0;
    374308    xEvent->xany.window = window ? window->winId() : 0;
    375 #else
    376     QWidget* ownerWidget = pageClient ? pageClient->ownerWidget() : 0;
    377     xEvent->xany.window = ownerWidget ? ownerWidget->window()->winId() : 0;
    378 #endif
    379309}
    380310
     
    607537    m_hasPendingGeometryChange = false;
    608538
    609 #if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet
    610     if (m_isWindowed) {
    611         QWidget* widget = static_cast<QWidget*>(platformPluginWidget());
    612         widget->setGeometry(m_windowRect);
    613 
    614         // Cut out areas of the plugin occluded by iframe shims
    615         Vector<IntRect> cutOutRects;
    616         QRegion clipRegion = QRegion(m_clipRect);
    617         getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
    618         for (size_t i = 0; i < cutOutRects.size(); i++) {
    619             cutOutRects[i].move(-frameRect().x(), -frameRect().y());
    620             clipRegion = clipRegion.subtracted(QRegion(cutOutRects[i]));
    621         }
    622         // if setMask is set with an empty QRegion, no clipping will
    623         // be performed, so in that case we hide the plugin view
    624         widget->setVisible(!clipRegion.isEmpty());
    625         widget->setMask(clipRegion);
    626 
    627         m_npWindow.x = m_windowRect.x();
    628         m_npWindow.y = m_windowRect.y();
    629     } else
    630 #endif
    631     {
    632         m_npWindow.x = 0;
    633         m_npWindow.y = 0;
    634     }
     539    m_npWindow.x = 0;
     540    m_npWindow.y = 0;
    635541
    636542    // If the width or height are null, set the clipRect to null, indicating that
     
    677583
    678584    Widget::setParentVisible(visible);
    679 
    680 #if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet.
    681     if (isSelfVisible() && platformPluginWidget())
    682         static_cast<QWidget*>(platformPluginWidget())->setVisible(visible);
    683 #endif
    684585}
    685586
     
    752653    case NPNVnetscapeWindow: {
    753654        QWebPageClient* client = platformPageClient();
    754 #if HAVE(QT5)
    755655        QWindow* window = client ? client->ownerWindow() : 0;
    756656        *reinterpret_cast<XID*>(value) = window ? window->winId() : 0;
    757 #else
    758         *reinterpret_cast<XID*>(value) = client ? client->ownerWidget()->window()->winId() : 0;
    759 #endif
    760657        *result = NPERR_NO_ERROR;
    761658        return true;
     
    777674void PluginView::invalidateRect(const IntRect& rect)
    778675{
    779 #if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet.
    780     if (m_isWindowed) {
    781         if (platformWidget()) {
    782             // update() will schedule a repaint of the widget so ensure
    783             // its knowledge of its position on the page is up to date.
    784             QWidget* w = static_cast<QWidget*>(platformWidget());
    785             w->setGeometry(m_windowRect);
    786             w->update(rect);
    787         }
    788         return;
    789     }
    790 #endif
    791 
    792676    invalidateWindowlessPluginRect(rect);
    793677}
     
    850734    colormap = 0;
    851735
    852 #if !HAVE(QT5) && !defined(QT_NO_XRENDER)
    853     static const bool useXRender = qgetenv("QT_X11_NO_XRENDER").isNull(); // Should also check for XRender >= 0.5
    854 #else
    855     static const bool useXRender = false;
    856 #endif
    857     if (!useXRender && forceARGB32)
     736    if (forceARGB32)
    858737        return false;
    859738
     
    868747        return false;
    869748
    870 #if !HAVE(QT5) && !defined(QT_NO_XRENDER)
    871     if (forceARGB32) {
    872         for (int idx = 0; idx < nvi; ++idx) {
    873             XRenderPictFormat* format = XRenderFindVisualFormat(x11Display(), xvi[idx].visual);
    874             if (format->type == PictTypeDirect && format->direct.alphaMask) {
    875                  visual = xvi[idx].visual;
    876                  break;
    877             }
    878         }
    879         if (!visual)
    880             return false;
    881     } else
    882 #endif
    883     {
    884         visual = xvi[0].visual;
    885     }
     749    visual = xvi[0].visual;
    886750    ASSERT(visual);
    887751
     
    899763    if (!x11Environment.display) {
    900764        Display* display;
    901 #if HAVE(QT5)
    902765        display = static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("display", 0));
    903 #else
    904         display = QX11Info::display();
    905 #endif
    906766        x11Environment.display = display;
    907767        x11Environment.screenID = XDefaultScreen(display);
     
    910770    }
    911771
    912 #if HAVE(QT5)
    913772    // Windowed mode is not supported with Qt5 yet.
    914773    if (m_isWindowed)
    915774        return false;
    916 #else
    917     if (m_plugin->pluginFuncs()->getvalue) {
    918         PluginView::setCurrentPluginView(this);
    919 #if USE(JSC)
    920         JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonJSGlobalData());
    921 #endif
    922         setCallingPlugin(true);
    923         m_plugin->pluginFuncs()->getvalue(m_instance, NPPVpluginNeedsXEmbed, &m_needsXEmbed);
    924         setCallingPlugin(false);
    925         PluginView::setCurrentPluginView(0);
    926     }
    927 
    928     if (m_isWindowed) {
    929         QWebPageClient* client = platformPageClient();
    930         if (m_needsXEmbed && client) {
    931             setPlatformWidget(new PluginContainerQt(this, client->ownerWidget()));
    932             // sync our XEmbed container window creation before sending the xid to plugins.
    933             QApplication::syncX();
    934         } else {
    935             notImplemented();
    936             m_status = PluginStatusCanNotLoadPlugin;
    937             return false;
    938         }
    939     } else
    940 #endif // HAVE(QT5)
    941     {
    942         setPlatformWidget(0);
    943         m_pluginDisplay = getPluginDisplay();
    944     }
     775    setPlatformWidget(0);
     776    m_pluginDisplay = getPluginDisplay();
    945777
    946778    // If the width and the height are not zero we show the PluginView.
     
    951783    wsi->type = 0;
    952784
    953 #if !HAVE(QT5)
    954     if (m_isWindowed) {
    955         const QX11Info* x11Info = &static_cast<QWidget*>(platformPluginWidget())->x11Info();
    956 
    957         wsi->display = x11Info->display();
    958         wsi->visual = (Visual*)x11Info->visual();
    959         wsi->depth = x11Info->depth();
    960         wsi->colormap = x11Info->colormap();
    961 
    962         m_npWindow.type = NPWindowTypeWindow;
    963         m_npWindow.window = (void*)static_cast<QWidget*>(platformPluginWidget())->winId();
    964         m_npWindow.width = -1;
    965         m_npWindow.height = -1;
    966     } else
    967 #endif
    968     {
    969 #if !HAVE(QT5)
    970         const QX11Info* x11Info = &QApplication::desktop()->x11Info();
    971         if ((x11Info->depth() == 32 || !m_plugin->quirks().contains(PluginQuirkRequiresDefaultScreenDepth))
    972              && getVisualAndColormap(32, m_visual, m_colormap, /* forceARGB32 = */ true))
    973             wsi->depth = 32;
    974         else
    975 #endif
    976         {
    977             int depth = displayDepth();
    978             bool found = getVisualAndColormap(depth, m_visual, m_colormap, /* forceARGB32 = */ false);
    979             ASSERT_UNUSED(found, found);
    980             wsi->depth = depth;
    981         }
    982 
    983         wsi->display = x11Display();
    984         wsi->visual = m_visual;
    985         wsi->colormap = m_colormap;
    986 
    987         m_npWindow.type = NPWindowTypeDrawable;
    988         m_npWindow.window = 0; // Not used?
    989         m_npWindow.x = 0;
    990         m_npWindow.y = 0;
    991         m_npWindow.width = -1;
    992         m_npWindow.height = -1;
    993     }
     785    int depth = displayDepth();
     786    bool found = getVisualAndColormap(depth, m_visual, m_colormap, /* forceARGB32 = */ false);
     787    ASSERT_UNUSED(found, found);
     788    wsi->depth = depth;
     789
     790    wsi->display = x11Display();
     791    wsi->visual = m_visual;
     792    wsi->colormap = m_colormap;
     793
     794    m_npWindow.type = NPWindowTypeDrawable;
     795    m_npWindow.window = 0; // Not used?
     796    m_npWindow.x = 0;
     797    m_npWindow.y = 0;
     798    m_npWindow.width = -1;
     799    m_npWindow.height = -1;
    994800
    995801    m_npWindow.ws_info = wsi;
  • trunk/Source/WebCore/plugins/win/PluginViewWin.cpp

    r121441 r124879  
    9494#if PLATFORM(QT)
    9595#include "QWebPageClient.h"
    96 #if HAVE(QT5)
    9796#include <QWindow>
    98 #else
    99 #include <QWidget>
    100 #endif
    10197#endif
    10298
     
    117113    if (!client)
    118114        return 0;
    119 #if HAVE(QT5)
    120115    if (QWindow* window = client->ownerWindow())
    121116        return reinterpret_cast<HWND>(window->winId());
    122 #else
    123     if (QWidget* pluginParent = qobject_cast<QWidget*>(client->pluginParent()))
    124         return pluginParent->winId();
    125 #endif
    126117    return 0;
    127118#elif PLATFORM(WX)
  • trunk/Source/WebKit/ChangeLog

    r124866 r124879  
     12012-07-19  Simon Hausmann  <simon.hausmann@nokia.com>
     2
     3        [Qt] Remove Qt 4 specific code paths
     4        https://bugs.webkit.org/show_bug.cgi?id=88161
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * WebKit.pri:
     9        * WebKit1.pri:
     10        * WebKit1.pro:
     11
    1122012-08-07  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    213
  • trunk/Source/WebKit/WebKit.pri

    r122702 r124879  
    3838    $$PWD/qt/Api/qhttpheader_p.h
    3939
    40 haveQt(5): contains(CONFIG, accessibility) {
     40contains(CONFIG, accessibility) {
    4141    SOURCES += $$PWD/qt/Api/qwebviewaccessible.cpp
    4242    HEADERS += $$PWD/qt/Api/qwebviewaccessible_p.h
  • trunk/Source/WebKit/WebKit1.pri

    r124002 r124879  
    3131
    3232contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1)|contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1) {
    33     haveQt(5) {
    34         QT += sensors
    35     } else {
    36         CONFIG *= mobility
    37         MOBILITY *= sensors
    38     }
     33    QT += sensors
    3934}
    4035
    41 contains(DEFINES, ENABLE_GEOLOCATION=1):haveQt(5): QT += location
     36contains(DEFINES, ENABLE_GEOLOCATION=1): QT += location
    4237
    4338contains(CONFIG, texmap): DEFINES += WTF_USE_TEXTURE_MAPPER=1
     
    4540plugin_backend_xlib: PKGCONFIG += x11
    4641
    47 QT += network
    48 haveQt(5): QT += widgets printsupport quick
     42QT += network widgets printsupport quick
    4943
    5044contains(DEFINES, WTF_USE_TEXTURE_MAPPER_GL=1)|contains(DEFINES, ENABLE_WEBGL=1) {
  • trunk/Source/WebKit/WebKit1.pro

    r122702 r124879  
    9595    $$PWD/qt/WebCoreSupport/WebEventConversion.h
    9696
    97 haveQt(5): contains(QT_CONFIG,accessibility) {
     97contains(QT_CONFIG,accessibility) {
    9898    SOURCES += $$PWD/qt/Api/qwebviewaccessible.cpp
    9999    HEADERS += $$PWD/qt/Api/qwebviewaccessible_p.h
  • trunk/Source/WebKit/qt/Api/qgraphicswebview.cpp

    r121710 r124879  
    310310                || event->type() == QEvent::TouchEnd
    311311                || event->type() == QEvent::TouchUpdate
    312 #if HAVE(QT5)
    313312                || event->type() == QEvent::TouchCancel
    314 #endif
    315313       )) {
    316314        d->page->event(event);
  • trunk/Source/WebKit/qt/Api/qgraphicswebview.h

    r119381 r124879  
    2424#include "qwebpage.h"
    2525#include <QtCore/qurl.h>
    26 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    2726#include <QtWidgets/qgraphicswidget.h>
    28 #else
    29 #include <QtGui/qgraphicswidget.h>
    30 #endif
    3127#include <QtGui/qevent.h>
    3228#include <QtGui/qicon.h>
  • trunk/Source/WebKit/qt/Api/qwebframe.cpp

    r122845 r124879  
    9898#include <qnetworkrequest.h>
    9999
    100 #if ENABLE(ORIENTATION_EVENTS) && !HAVE(QT5)
    101 QTM_USE_NAMESPACE
    102 #endif
    103 
    104100using namespace WebCore;
    105101
     
    651647    The ownership of \a object is specified using \a own.
    652648*/
    653 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    654649void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, ValueOwnership ownership)
    655 #else
    656 void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership)
    657 #endif
    658650{
    659651    if (!page()->settings()->testAttribute(QWebSettings::JavascriptEnabled))
  • trunk/Source/WebKit/qt/Api/qwebframe.h

    r120196 r124879  
    2828#include <QtNetwork/qnetworkaccessmanager.h>
    2929#include "qwebkitglobal.h"
    30 
    31 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    32 #include <QtScript/qscriptengine.h>
    33 #endif
    3430
    3531QT_BEGIN_NAMESPACE
     
    125121
    126122public:
    127 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    128123    enum ValueOwnership {
    129124        QtOwnership,
     
    131126        AutoOwnership
    132127    };
    133 #endif
    134128
    135129    QWebPage *page() const;
     
    140134    void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
    141135
    142 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    143136    void addToJavaScriptWindowObject(const QString &name, QObject *object, ValueOwnership ownership = QtOwnership);
    144 #else
    145     void addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership = QScriptEngine::QtOwnership);
    146 #endif
    147137    QString toHtml() const;
    148138    QString toPlainText() const;
  • trunk/Source/WebKit/qt/Api/qwebframe_p.h

    r121710 r124879  
    3131#if ENABLE(ORIENTATION_EVENTS)
    3232#include "qorientationsensor.h"
    33 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    34 using QTM_NAMESPACE::QOrientationSensor;
    35 #endif
    3633#endif // ENABLE(ORIENTATION_EVENTS).
    3734#include "qwebelement.h"
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r123458 r124879  
    114114#endif // Q_OS_WIN32
    115115#include "TextIterator.h"
    116 #include "UtilsQt.h"
    117116#include "WebEventConversion.h"
    118117#include "WindowFeatures.h"
     
    31633162    case QEvent::TouchUpdate:
    31643163    case QEvent::TouchEnd:
    3165 #if HAVE(QT5)
    31663164    case QEvent::TouchCancel:
    3167 #endif
    31683165        // Return whether the default action was cancelled in the JS event handler
    31693166        return d->touchEvent(static_cast<QTouchEvent*>(ev));
  • trunk/Source/WebKit/qt/Api/qwebpage.h

    r119381 r124879  
    2727#include <QtCore/qobject.h>
    2828#include <QtCore/qurl.h>
    29 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    3029#include <QtWidgets/qwidget.h>
    31 #else
    32 #include <QtGui/qwidget.h>
    33 #endif
    3430
    3531QT_BEGIN_NAMESPACE
  • trunk/Source/WebKit/qt/Api/qwebsettings.cpp

    r123150 r124879  
    4747
    4848#include <QApplication>
    49 #if HAVE(QT5)
    5049#include <QStandardPaths>
    51 #else
    52 #include <QDesktopServices>
    53 #endif
    5450#include <QDir>
    5551#include <QHash>
     
    11461142    if (path.isEmpty()) {
    11471143
    1148 #if HAVE(QT5)
    11491144        storagePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
    1150 #else
    1151         storagePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
    1152 #endif
    11531145        if (storagePath.isEmpty())
    11541146            storagePath = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName());
     
    11691161    // All applications can share the common QtWebkit cache file(s).
    11701162    // Path is not configurable and uses QDesktopServices::CacheLocation by default.
    1171 #if HAVE(QT5)
    11721163    QString cachePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
    1173 #else
    1174     QString cachePath = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
    1175 #endif
    11761164    WebCore::makeAllDirectories(cachePath);
    11771165
  • trunk/Source/WebKit/qt/Api/qwebview.cpp

    r122702 r124879  
    3535#include "qfile.h"
    3636#ifndef QT_NO_ACCESSIBILITY
    37 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    3837#include "qwebviewaccessible_p.h"
    39 #endif
    4038#endif
    4139
     
    155153
    156154#ifndef QT_NO_ACCESSIBILITY
    157 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    158155static QAccessibleInterface* accessibleInterfaceFactory(const QString& key, QObject* object)
    159156{
     
    169166}
    170167#endif
    171 #endif
    172168
    173169/*!
     
    192188
    193189#ifndef QT_NO_ACCESSIBILITY
    194 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    195190    QAccessible::installFactory(accessibleInterfaceFactory);
    196 #endif
    197191#endif
    198192}
     
    733727                   || e->type() == QEvent::TouchEnd
    734728                   || e->type() == QEvent::TouchUpdate
    735 #if HAVE(QT5)
    736729                   || e->type() == QEvent::TouchCancel
    737 #endif
    738730                  ) {
    739731            d->page->event(e);
  • trunk/Source/WebKit/qt/Api/qwebview.h

    r119381 r124879  
    2424#include "qwebkitglobal.h"
    2525#include "qwebpage.h"
    26 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    2726#include <QtWidgets/qwidget.h>
    28 #else
    29 #include <QtGui/qwidget.h>
    30 #endif
    3127#include <QtGui/qicon.h>
    3228#include <QtGui/qpainter.h>
  • trunk/Source/WebKit/qt/ChangeLog

    r124336 r124879  
     12012-08-02  Simon Hausmann  <simon.hausmann@nokia.com>
     2
     3        [Qt] Remove Qt 4 specific code paths
     4        https://bugs.webkit.org/show_bug.cgi?id=88161
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * Api/qgraphicswebview.cpp:
     9        (QGraphicsWebView::sceneEvent):
     10        * Api/qgraphicswebview.h:
     11        * Api/qwebframe.cpp:
     12        * Api/qwebframe.h:
     13        * Api/qwebframe_p.h:
     14        * Api/qwebpage.cpp:
     15        (QWebPage::event):
     16        * Api/qwebpage.h:
     17        * Api/qwebsettings.cpp:
     18        (QWebSettings::enablePersistentStorage):
     19        * Api/qwebview.cpp:
     20        (QWebView::QWebView):
     21        (QWebView::event):
     22        * Api/qwebview.h:
     23        * WebCoreSupport/ChromeClientQt.cpp:
     24        (WebCore::ChromeClientQt::setToolTip):
     25        * WebCoreSupport/FrameLoaderClientQt.cpp:
     26        (WebCore::FrameLoaderClientQt::createPlugin):
     27        * WebCoreSupport/GeolocationClientQt.cpp:
     28        * WebCoreSupport/GeolocationClientQt.h:
     29        * WebCoreSupport/PageClientQt.cpp:
     30        (createPlatformGraphicsContext3DFromWidget):
     31        (QWebPageClient::ownerWindow):
     32        * WebCoreSupport/WebEventConversion.cpp:
     33        (WebCore::WebKitPlatformTouchEvent::WebKitPlatformTouchEvent):
     34        * declarative/declarative.pro:
     35        * declarative/plugin.cpp:
     36        * declarative/public.pri:
     37        * examples/platformplugin/WebPlugin.cpp:
     38        (WebPlugin::createExtension):
     39        * examples/platformplugin/WebPlugin.h:
     40        (WebPlugin):
     41        * examples/platformplugin/platformplugin.pro:
     42        * tests/qobjectbridge/tst_qobjectbridge.cpp:
     43        (tst_QObjectBridge::arrayObjectEnumerable):
     44        (tst_QObjectBridge::ownership):
     45        (tst_QObjectBridge::qObjectWrapperWithSameIdentity):
     46        * tests/tests.pri:
     47        * tests/util.h:
     48
    1492012-08-01  Zeno Albisser  <zeno@webkit.org>
    250
  • trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r124336 r124879  
    7676#include <qtooltip.h>
    7777#include <wtf/OwnPtr.h>
    78 #include <wtf/qt/UtilsQt.h>
    7978
    8079#if ENABLE(VIDEO) && ((USE(GSTREAMER) && !defined(GST_API_VERSION_1)) || USE(QT_MULTIMEDIA) || USE(QTKIT))
     
    550549        QToolTip::hideText();
    551550    } else {
    552         QString dtip = QLatin1String("<p>") + escapeHtml(tip) + QLatin1String("</p>");
     551        QString dtip = QLatin1String("<p>") + QString(tip).toHtmlEscaped() + QLatin1String("</p>");
    553552        view->setToolTip(dtip);
    554553    }
  • trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r122845 r124879  
    16051605        Vector<String> values = paramValues;
    16061606        if (mimeType == "application/x-shockwave-flash") {
    1607 #if HAVE(QT5)
    1608             const bool shouldInjectWmode = true;
    1609 #else
    16101607            // Inject wmode=opaque when there is no client or the client is not a QWebView.
    1611             QWebPageClient* client = m_webFrame->page()->d->client.get();
    1612             const bool shouldInjectWmode = !(client && qobject_cast<QWidget*>(client->pluginParent()));
    1613 #endif
    1614             if (shouldInjectWmode) {
    1615                 // Inject wmode=opaque when there is no client or the client is not a QWebView.
    1616                 size_t wmodeIndex = params.find("wmode");
    1617                 if (wmodeIndex == WTF::notFound) {
    1618                     params.append("wmode");
    1619                     values.append("opaque");
    1620                 } else if (equalIgnoringCase(values[wmodeIndex], "window"))
    1621                     values[wmodeIndex] = "opaque";
    1622             }
     1608            size_t wmodeIndex = params.find("wmode");
     1609            if (wmodeIndex == WTF::notFound) {
     1610                params.append("wmode");
     1611                values.append("opaque");
     1612            } else if (equalIgnoringCase(values[wmodeIndex], "window"))
     1613                values[wmodeIndex] = "opaque";
    16231614        }
    16241615
  • trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp

    r119970 r124879  
    3939#include "qwebpage_p.h"
    4040
    41 #if !HAVE(QT5)
    42 #include <QGeoPositionInfoSource>
    43 #elif HAVE(QT5)
    4441#include <QtLocation/QGeoPositionInfoSource>
    45 #endif
    4642
    4743namespace WebCore {
  • trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h

    r123456 r124879  
    3232#include <wtf/RefPtr.h>
    3333
    34 #if !HAVE(QT5)
    35 #include <QGeoPositionInfo>
    36 namespace QtMobility {
    37 class QGeoPositionInfoSource;
    38 };
    39 using namespace QtMobility;
    40 #elif HAVE(QT5)
    4134#include <QtLocation/QGeoPositionInfo>
    4235QT_BEGIN_NAMESPACE
    4336class QGeoPositionInfoSource;
    4437QT_END_NAMESPACE
    45 #endif
    4638
    4739
  • trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp

    r122175 r124879  
    3434
    3535#if USE(3D_GRAPHICS)
    36 #if HAVE(QT5)
    3736#include <QWindow>
    38 #endif
    3937
    4038static void createPlatformGraphicsContext3DFromWidget(QWidget* widget, PlatformGraphicsContext3D* context,
     
    5553        // Geometry can be set to zero because m_glWidget is used only for its QGLContext.
    5654        glWidget->setGeometry(0, 0, 0, 0);
    57 #if HAVE(QT5)
    5855        *surface = glWidget->windowHandle();
    5956        *context = glWidget->context()->contextHandle();
    60 #else
    61         *surface = glWidget;
    62         *context = const_cast<QGLContext*>(glWidget->context());
    63 #endif
    6457    } else {
    6558        delete glWidget;
     
    7568#endif
    7669
    77 #if HAVE(QT5)
    7870QWindow* QWebPageClient::ownerWindow() const
    7971{
     
    8779    return 0;
    8880}
    89 #endif
    9081
    9182namespace WebCore {
  • trunk/Source/WebKit/qt/WebCoreSupport/WebEventConversion.cpp

    r119098 r124879  
    244244        m_type = PlatformEvent::TouchEnd;
    245245        break;
    246 #if HAVE(QT5)
    247246    case QEvent::TouchCancel:
    248247        m_type = PlatformEvent::TouchCancel;
    249248        break;
    250 #endif
    251249    }
    252250
  • trunk/Source/WebKit/qt/declarative/declarative.pro

    r121777 r124879  
    1212SUBDIRS += public_api
    1313
    14 haveQt(5):!no_webkit2 {
     14!no_webkit2 {
    1515    experimental_api.file = experimental/experimental.pri
    1616    experimental_api.makefile = Makefile.declarative.experimental
  • trunk/Source/WebKit/qt/declarative/plugin.cpp

    r120594 r124879  
    2626#endif
    2727
    28 #if (HAVE(QT5))
    2928#include <QtQml/qqml.h>
    3029#include <QtQml/qqmlextensionplugin.h>
    31 #else
    32 #include <QtDeclarative/qdeclarative.h>
    33 #include <QtDeclarative/qdeclarativeextensionplugin.h>
    34 #endif
    3530
    3631#if defined(HAVE_WEBKIT2)
     
    4742QT_BEGIN_NAMESPACE
    4843
    49 #if QT_VERSION >= 0x050000
    5044class WebKitQmlPlugin : public QQmlExtensionPlugin {
    5145    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface" FILE "plugin.json")
    52 #else
    53 class WebKitQmlPlugin : public QDeclarativeExtensionPlugin {
    54 #endif
    5546    Q_OBJECT
    5647public:
     
    8980
    9081#include "plugin.moc"
    91 
    92 #if QT_VERSION < 0x050000
    93 Q_EXPORT_PLUGIN2(qmlwebkitplugin, QT_PREPEND_NAMESPACE(WebKitQmlPlugin));
    94 #endif
  • trunk/Source/WebKit/qt/declarative/public.pri

    r121851 r124879  
    2525wince*:LIBS += $$QMAKE_LIBS_GUI
    2626
    27 QT += webkit webkit-private
    28 haveQt(4): QT += declarative
    29 haveQt(5): QT += widgets quick quick-private
     27QT += webkit webkit-private widgets quick quick-private
    3028
    3129contains(DEFINES, HAVE_QQUICK1=1) {
  • trunk/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp

    r121324 r124879  
    315315    }
    316316}
    317 
    318 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    319 Q_EXPORT_PLUGIN2(platformplugin, WebPlugin)
    320 #endif
  • trunk/Source/WebKit/qt/examples/platformplugin/WebPlugin.h

    r123456 r124879  
    140140    Q_OBJECT
    141141    Q_INTERFACES(QWebKitPlatformPlugin)
    142 #if QT_VERSION >= 0x050000
    143142    Q_PLUGIN_METADATA(IID "org.qt-project.QtWebKit.PlatformPluginInterface")
    144 #endif
    145143public:
    146144    virtual bool supportsExtension(Extension extension) const;
  • trunk/Source/WebKit/qt/examples/platformplugin/platformplugin.pro

    r121230 r124879  
    22TARGET = platformplugin
    33
    4 QT += core gui
    5 haveQt(5): QT += widgets
     4QT += core gui widgets
    65CONFIG += plugin
    76
  • trunk/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp

    r120196 r124879  
    3737Q_DECLARE_METATYPE(QVariantList)
    3838Q_DECLARE_METATYPE(QVariantMap)
    39 
    40 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    41 #define OwnershipClass QWebFrame
    42 #else
    43 #define OwnershipClass QScriptEngine
    44 #endif
    4539
    4640class MyQObject : public QObject {
     
    20011995    QWebFrame* frame = page.mainFrame();
    20021996    QObject* qobject = new StringListTestObject();
    2003     frame->addToJavaScriptWindowObject("test", qobject, OwnershipClass::ScriptOwnership);
     1997    frame->addToJavaScriptWindowObject("test", qobject, QWebFrame::ScriptOwnership);
    20041998
    20051999    const QString script("var stringArray = test.stringList();"
     
    20422036            QWebPage page;
    20432037            QWebFrame* frame = page.mainFrame();
    2044             frame->addToJavaScriptWindowObject("test", ptr.data(), OwnershipClass::ScriptOwnership);
     2038            frame->addToJavaScriptWindowObject("test", ptr.data(), QWebFrame::ScriptOwnership);
    20452039        }
    20462040        QVERIFY(!ptr);
     
    20532047            QWebPage page;
    20542048            QWebFrame* frame = page.mainFrame();
    2055             frame->addToJavaScriptWindowObject("test", ptr.data(), OwnershipClass::QtOwnership);
     2049            frame->addToJavaScriptWindowObject("test", ptr.data(), QWebFrame::QtOwnership);
    20562050        }
    20572051        QVERIFY(ptr.data() == before);
     
    20632057        QWebPage page;
    20642058        QWebFrame* frame = page.mainFrame();
    2065         frame->addToJavaScriptWindowObject("test", child, OwnershipClass::QtOwnership);
     2059        frame->addToJavaScriptWindowObject("test", child, QWebFrame::QtOwnership);
    20662060        QVariant v = frame->evaluateJavaScript("test");
    20672061        QCOMPARE(qvariant_cast<QObject*>(v), child);
     
    20762070            QWebPage page;
    20772071            QWebFrame* frame = page.mainFrame();
    2078             frame->addToJavaScriptWindowObject("test", ptr.data(), OwnershipClass::AutoOwnership);
     2072            frame->addToJavaScriptWindowObject("test", ptr.data(), QWebFrame::AutoOwnership);
    20792073        }
    20802074        // no parent, so it should be like ScriptOwnership
     
    20882082            QWebPage page;
    20892083            QWebFrame* frame = page.mainFrame();
    2090             frame->addToJavaScriptWindowObject("test", child.data(), OwnershipClass::AutoOwnership);
     2084            frame->addToJavaScriptWindowObject("test", child.data(), QWebFrame::AutoOwnership);
    20912085        }
    20922086        // has parent, so it should be like QtOwnership
     
    21302124    QCOMPARE(mainFrame->toPlainText(), QString("test"));
    21312125
    2132     mainFrame->addToJavaScriptWindowObject("test", new TestFactory, OwnershipClass::ScriptOwnership);
     2126    mainFrame->addToJavaScriptWindowObject("test", new TestFactory, QWebFrame::ScriptOwnership);
    21332127
    21342128    mainFrame->evaluateJavaScript("triggerBug();");
  • trunk/Source/WebKit/qt/tests/tests.pri

    r110272 r124879  
    1717    $$PWD/../Api
    1818
    19 QT += testlib network webkit
    20 haveQt(5): QT += widgets
    21 
    22 haveQt(4): haveQtModule(declarative): QT += declarative
     19QT += testlib network webkit widgets
    2320
    2421# This define is used by some tests to look up resources in the source tree
  • trunk/Source/WebKit/qt/tests/util.h

    r121959 r124879  
    5454}
    5555
    56 #if !(defined(HAVE_QT5) && HAVE_QT5)
    57 // Will try to wait for the condition while allowing event processing
    58 #define QTRY_VERIFY(__expr) \
    59     do { \
    60         const int __step = 50; \
    61         const int __timeout = 5000; \
    62         if (!(__expr)) { \
    63             QTest::qWait(0); \
    64         } \
    65         for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \
    66             QTest::qWait(__step); \
    67         } \
    68         QVERIFY(__expr); \
    69     } while(0)
    70 
    71 // Will try to wait for the condition while allowing event processing
    72 #define QTRY_COMPARE(__expr, __expected) \
    73     do { \
    74         const int __step = 50; \
    75         const int __timeout = 5000; \
    76         if ((__expr) != (__expected)) { \
    77             QTest::qWait(0); \
    78         } \
    79         for (int __i = 0; __i < __timeout && ((__expr) != (__expected)); __i+=__step) { \
    80             QTest::qWait(__step); \
    81         } \
    82         QCOMPARE(__expr, __expected); \
    83     } while(0)
    84 
    85 // Compatibility for Qt5
    86 #define W_QSKIP(a, b) QSKIP(a, b)
    87 #else
    8856#define W_QSKIP(a, b) QSKIP(a)
    89 #endif
  • trunk/Source/WebKit2/ChangeLog

    r124875 r124879  
     12012-07-19  Simon Hausmann  <simon.hausmann@nokia.com>
     2
     3        [Qt] Remove Qt 4 specific code paths
     4        https://bugs.webkit.org/show_bug.cgi?id=88161
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * UIProcess/API/qt/qquickwebview.cpp:
     9        * UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:
     10        (gatherAPI):
     11        * WebKit2.pri:
     12
    1132012-08-07  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    214
  • trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp

    r124758 r124879  
    3333#include "QtWebPageLoadClient.h"
    3434#include "QtWebPagePolicyClient.h"
    35 #include "UtilsQt.h"
    3635#include "WebBackForwardList.h"
    3736#include "WebInspectorProxy.h"
  • trunk/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp

    r119098 r124879  
    145145    if (method.access() != QMetaMethod::Private) {
    146146        const char* methodTypeName = !!strlen(method.typeName()) ? method.typeName() : "void";
    147 #if HAVE(QT5)
    148147        *output << QString::fromLatin1("%1%2 --> %3").arg(prefix).arg(QString::fromLatin1(method.methodSignature())).arg(QString::fromLatin1(methodTypeName));
    149 #else
    150         *output << QString::fromLatin1("%1%2 --> %3").arg(prefix).arg(method.signature()).arg(methodTypeName);
    151 #endif
    152148
    153149        checkKnownType(methodTypeName);
  • trunk/Source/WebKit2/WebKit2.pri

    r124701 r124879  
    7878QT += qml quick
    7979
    80 contains(DEFINES, ENABLE_GEOLOCATION=1):haveQt(5): QT += location
     80contains(DEFINES, ENABLE_GEOLOCATION=1): QT += location
  • trunk/Source/api.pri

    r122845 r124879  
    1010WEBKIT_DESTDIR = $${ROOT_BUILD_DIR}/lib
    1111
    12 haveQt(5) {
    13     # Use Qt5's module system
    14     load(qt_build_config)
    15     MODULE = webkit
    16     MODULE_PRI = ../Tools/qmake/qt_webkit.pri
     12# Use Qt5's module system
     13load(qt_build_config)
     14MODULE = webkit
     15MODULE_PRI = ../Tools/qmake/qt_webkit.pri
    1716
    18     # ---------------- Custom developer-build handling -------------------
    19     #
    20     # The assumption for Qt developer builds is that the module file
    21     # will be put into qtbase/mkspecs/modules, and the libraries into
    22     # qtbase/lib, with rpath/install_name set to the Qt lib dir.
    23     #
    24     # For WebKit we don't want that behavior for the libraries, as we want
    25     # them to be self-contained in the WebKit build dir.
    26     #
    27     CONFIG += force_independent
     17# ---------------- Custom developer-build handling -------------------
     18#
     19# The assumption for Qt developer builds is that the module file
     20# will be put into qtbase/mkspecs/modules, and the libraries into
     21# qtbase/lib, with rpath/install_name set to the Qt lib dir.
     22#
     23# For WebKit we don't want that behavior for the libraries, as we want
     24# them to be self-contained in the WebKit build dir.
     25#
     26CONFIG += force_independent
    2827
    29     BASE_TARGET = $$TARGET
     28BASE_TARGET = $$TARGET
    3029
    31     load(qt_module_config)
     30load(qt_module_config)
    3231
    33     # Make sure the module config doesn't override our preferred build config.
    34     debug_and_release:if(!debug|!release) {
    35         # Removing debug_and_release causes issues with lib suffixes when building debug on Windows.
    36         # Work around it by only removing build_all, and still create the Makefiles for both configurations.
    37         win32*: CONFIG -= build_all
    38         else: CONFIG -= debug_and_release
    39     }
    40 
    41     # Allow doing a debug-only build of WebKit (not supported by Qt)
    42     macx:!debug_and_release:debug: TARGET = $$BASE_TARGET
    43 
    44     # Make sure the install_name of the QtWebKit library point to webkit
    45     macx {
    46         # We do our own absolute path so that we can trick qmake into
    47         # using the webkit build path instead of the Qt install path.
    48         CONFIG -= absolute_library_soname
    49         QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/
    50 
    51         !debug_and_release|build_pass {
    52             # We also have to make sure the install_name is correct when
    53             # the library is installed.
    54             change_install_name.depends = install_target
    55 
    56             # The install rules generated by qmake for frameworks are busted in
    57             # that both the debug and the release makefile copy QtWebKit.framework
    58             # into the install dir, so whatever changes we did to the release library
    59             # will get overwritten when the debug library is installed. We work around
    60             # that by running install_name on both, for both configs.
    61             change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \
    62                 for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \
    63                     install_name_tool -id \$\$file \$\$file; \
    64                 done
    65             default_install_target.target = install
    66             default_install_target.depends += change_install_name
    67 
    68             QMAKE_EXTRA_TARGETS += change_install_name default_install_target
    69         }
    70     }
    71 } else {
    72     VERSION = $$QT_VERSION
    73     DESTDIR = $$WEBKIT_DESTDIR
     32# Make sure the module config doesn't override our preferred build config.
     33debug_and_release:if(!debug|!release) {
     34    # Removing debug_and_release causes issues with lib suffixes when building debug on Windows.
     35    # Work around it by only removing build_all, and still create the Makefiles for both configurations.
     36    win32*: CONFIG -= build_all
     37    else: CONFIG -= debug_and_release
    7438}
    7539
    76 runSyncQt() # Generate forwarding headers for the QtWebKit API
     40# Allow doing a debug-only build of WebKit (not supported by Qt)
     41macx:!debug_and_release:debug: TARGET = $$BASE_TARGET
     42
     43# Make sure the install_name of the QtWebKit library point to webkit
     44macx {
     45    # We do our own absolute path so that we can trick qmake into
     46    # using the webkit build path instead of the Qt install path.
     47    CONFIG -= absolute_library_soname
     48    QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/
     49
     50    !debug_and_release|build_pass {
     51        # We also have to make sure the install_name is correct when
     52        # the library is installed.
     53        change_install_name.depends = install_target
     54
     55        # The install rules generated by qmake for frameworks are busted in
     56        # that both the debug and the release makefile copy QtWebKit.framework
     57        # into the install dir, so whatever changes we did to the release library
     58        # will get overwritten when the debug library is installed. We work around
     59        # that by running install_name on both, for both configs.
     60        change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \
     61            for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \
     62                install_name_tool -id \$\$file \$\$file; \
     63            done
     64        default_install_target.target = install
     65        default_install_target.depends += change_install_name
     66
     67        QMAKE_EXTRA_TARGETS += change_install_name default_install_target
     68    }
     69}
    7770
    7871WEBKIT += wtf
     
    9285
    9386!no_webkit1: WEBKIT += webkit1
    94 
    95 # ------------- Install rules -------------
    96 
    97 haveQt(5) {
    98     # Install rules handled by Qt's module system
    99 } else {
    100     # For Qt4 we have to set up install rules manually
    101 
    102     # Syncqt has already run at this point, so we can use headers.pri
    103     # as a basis for our install-rules
    104     HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$${QT.webkit.name}/headers.pri
    105     !include($$HEADERS_PRI): error(Failed to resolve install headers)
    106 
    107     headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
    108     !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/$${TARGET}
    109     else: headers.path = $$[QT_INSTALL_HEADERS]/$${TARGET}
    110     INSTALLS += headers
    111 
    112     !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
    113     else: target.path = $$[QT_INSTALL_LIBS]
    114     INSTALLS += target
    115 
    116     unix {
    117         CONFIG += create_pc create_prl
    118         QMAKE_PKGCONFIG_LIBDIR = $$target.path
    119         QMAKE_PKGCONFIG_INCDIR = $$headers.path
    120         QMAKE_PKGCONFIG_DESTDIR = pkgconfig
    121         lib_replace.match = $$re_escape($$DESTDIR)
    122         lib_replace.replace = $$[QT_INSTALL_LIBS]
    123         QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
    124     }
    125 
    126     mac {
    127         !static:contains(QT_CONFIG, qt_framework) {
    128             # Build QtWebKit as a framework, to match how Qt was built
    129             CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
    130 
    131             # For debug_and_release configs, only copy headers in release
    132             !debug_and_release|if(build_pass:CONFIG(release, debug|release)) {
    133                 FRAMEWORK_HEADERS.version = Versions
    134                 FRAMEWORK_HEADERS.files = $${headers.files}
    135                 FRAMEWORK_HEADERS.path = Headers
    136                 QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
    137             }
    138         }
    139 
    140         QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
    141     }
    142 }
  • trunk/Tools/ChangeLog

    r124877 r124879  
     12012-08-02  Simon Hausmann  <simon.hausmann@nokia.com>
     2
     3        [Qt] Remove Qt 4 specific code paths
     4        https://bugs.webkit.org/show_bug.cgi?id=88161
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * DumpRenderTree/qt/DumpRenderTree.pro:
     9        * DumpRenderTree/qt/EventSenderQt.cpp:
     10        (EventSender::touchCancel):
     11        (EventSender::sendTouchEvent):
     12        * DumpRenderTree/qt/EventSenderQt.h:
     13        (EventSender):
     14        * DumpRenderTree/qt/ImageDiff.pro:
     15        * DumpRenderTree/qt/main.cpp:
     16        (main):
     17        * QtTestBrowser/QtTestBrowser.pro:
     18        * QtTestBrowser/cookiejar.cpp:
     19        (TestBrowserCookieJar::TestBrowserCookieJar):
     20        * QtTestBrowser/launcherwindow.cpp:
     21        (LauncherWindow::setDiskCache):
     22        * qmake/configure.pri:
     23        * qmake/mkspecs/features/default_post.prf:
     24        * qmake/mkspecs/features/default_pre.prf:
     25        * qmake/mkspecs/features/features.prf:
     26        * qmake/mkspecs/features/functions.prf:
     27        * qmake/mkspecs/features/qtwebkit.prf: Removed.
     28        * qmake/mkspecs/features/unix/default_pre.prf:
     29
    1302012-08-07  Andras Becsi  <andras.becsi@nokia.com>
    231
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTree.pro

    r124581 r124879  
    1919    $${ROOT_WEBKIT_DIR}/Source/WTF
    2020
    21 QT = core gui network testlib webkit
     21QT = core gui network testlib webkit widgets printsupport
    2222macx: QT += xml
    23 haveQt(5): QT += widgets printsupport
    2423
    2524contains(DEFINES, HAVE_FONTCONFIG=1): PKGCONFIG += fontconfig
  • trunk/Tools/DumpRenderTree/qt/EventSenderQt.cpp

    r119098 r124879  
    478478}
    479479
    480 #if QT_VERSION >= 0x050000
    481480void EventSender::touchCancel()
    482481{
     
    484483    m_touchActive = false;
    485484}
    486 #endif
    487485
    488486void EventSender::clearTouchPoints()
     
    512510void EventSender::sendTouchEvent(QEvent::Type type)
    513511{
    514 #if HAVE(QT5)
    515512    static QTouchDevice* device = 0;
    516513    if (!device) {
     
    521518
    522519    QTouchEvent event(type, device, m_touchModifiers);
    523 #else
    524     QTouchEvent event(type, QTouchEvent::TouchScreen, m_touchModifiers);
    525 #endif
    526520    event.setTouchPoints(m_touchPoints);
    527521    sendEvent(m_page, &event);
  • trunk/Tools/DumpRenderTree/qt/EventSenderQt.h

    r114917 r124879  
    7575    void touchMove();
    7676    void touchEnd();
    77 #if QT_VERSION >= 0x050000
    7877    void touchCancel();
    79 #endif
    8078    void zoomPageIn();
    8179    void zoomPageOut();
  • trunk/Tools/DumpRenderTree/qt/ImageDiff.pro

    r99274 r124879  
    1010DESTDIR = $$ROOT_BUILD_DIR/bin
    1111
    12 QT = core gui
    13 haveQt(5): QT += widgets
     12QT = core gui widgets
    1413
    1514SOURCES = ImageDiff.cpp
  • trunk/Tools/DumpRenderTree/qt/main.cpp

    r124581 r124879  
    124124    app.setQuitOnLastWindowClosed(false);
    125125
    126 #if HAVE(QT5)
    127126    QCoreApplication::setAttribute(Qt::AA_Use96Dpi, true);
    128 #else
    129 #ifdef Q_WS_X11
    130     QX11Info::setAppDpiY(0, 96);
    131     QX11Info::setAppDpiX(0, 96);
    132 #endif
    133 
    134    /*
    135     * QApplication will initialize the default application font based
    136     * on the application DPI at construction time, which might be
    137     * different from the DPI we explicitly set using QX11Info above.
    138     * See: https://bugreports.qt.nokia.com/browse/QTBUG-21603
    139     *
    140     * To ensure that the application font DPI matches the application
    141     * DPI, we override the application font using the font we get from
    142     * a QWidget, which has already been resolved against the existing
    143     * default font, but with the correct paint-device DPI.
    144    */
    145     QApplication::setFont(QWidget().font());
    146 #endif
    147127
    148128    WTFInstallReportBacktraceOnCrashHook();
  • trunk/Tools/QtTestBrowser/QtTestBrowser.pro

    r121777 r124879  
    4343DESTDIR = $$ROOT_BUILD_DIR/bin
    4444
    45 QT += network webkit
     45QT += network webkit printsupport widgets
    4646
    4747macx:QT += xml
    48 haveQt(5): QT += printsupport widgets
    4948
    5049contains(DEFINES, HAVE_FONTCONFIG=1): PKGCONFIG += fontconfig
  • trunk/Tools/QtTestBrowser/cookiejar.cpp

    r119098 r124879  
    3030#include "cookiejar.h"
    3131
    32 #if HAVE(QT5)
    3332#include <QStandardPaths>
    34 #else
    35 #include <QDesktopServices>
    36 #endif
    3733#include <QDir>
    3834#include <QTextStream>
     
    4945
    5046#ifndef QT_NO_DESKTOPSERVICES
    51 #if HAVE(QT5)
    5247    QString path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
    53 #else
    54     QString path = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
    55 #endif
    5648#else
    5749    QString path = QDir::homePath() + "/.QtTestBrowser";
  • trunk/Tools/QtTestBrowser/launcherwindow.cpp

    r119098 r124879  
    6767
    6868#if !defined(QT_NO_NETWORKDISKCACHE) && !defined(QT_NO_DESKTOPSERVICES)
    69 #if HAVE(QT5)
    7069#include <QStandardPaths>
    71 #else
    72 #include <QDesktopServices>
    73 #endif
    7470#include <QtNetwork/QNetworkDiskCache>
    7571#endif
     
    809805    if (enable) {
    810806        cache = new QNetworkDiskCache();
    811 #if HAVE(QT5)
    812807        QString cacheLocation = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
    813 #else
    814         QString cacheLocation = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
    815 #endif
    816808        cache->setCacheDirectory(cacheLocation);
    817809    }
  • trunk/Tools/qmake/configure.pri

    r123208 r124879  
    66# -------------------------------------------------------------------
    77
    8 haveQt(5):!quick_check {
     8!quick_check {
    99    load(configure)
    1010    QMAKE_CONFIG_TESTS_DIR = $$PWD/config.tests
  • trunk/Tools/qmake/mkspecs/features/default_post.prf

    r122947 r124879  
    1919DEFINES += \
    2020    BUILDING_QT__=1
    21 
    22 haveQt(5): DEFINES += HAVE_QT5=1
    2321
    2422CONFIG(release, debug|release): DEFINES *= NDEBUG
     
    149147
    150148contains(QT, webkit) {
    151     haveQt(4) {
    152         # Qt 4 still uses custom rules to depend on QtWebKit
    153         load(qtwebkit)
    154     }
    155 
    156149    # In addition to the main shared QtWebKit library we also
    157150    # need to link to any intermediate shared libraries.
     
    239232}
    240233
    241 # Doing '$(MAKE) qmake' should recurse through all subdirs. In Qt5, this is
    242 # automatic (for 'qmake_all', while 'qmake' does not enter subdirs at all).
    243 haveQt(4):contains(TEMPLATE, subdirs):!no_recursive_qmake {
    244     recursive_qmake.target = qmake_all
    245 
    246     # We could do this using CONFIG += recurse but that adds
    247     # a dependency for each recursive target on its makefile,
    248     # while we want it to depend on *-qmake_all, so that we
    249     # don't end up running qmake twice.
    250 
    251     for(subdir, SUBDIRS) {
    252         contains(NO_RECURSIVE_QMAKE_SUBDIRS, $${subdir}) {
    253             debug(1, Skipping recursive qmake for $${subdir})
    254             next()
    255         }
    256 
    257         subdir_config = $$eval($${subdir}.CONFIG)
    258         contains(subdir_config, no_default_target):next()
    259 
    260         debug(1, "Making qmake recursive for $$subdir")
    261 
    262         variables = $$computeSubdirVariables($${subdir})
    263 
    264         target_name = $$eval($${variables}.target)-recursive_qmake
    265 
    266         eval($${target_name}.target = $$target_name)
    267         eval($${target_name}.depends = $$eval($${variables}.target)-qmake_all)
    268         commands = $$eval($${variables}.subdir_command) $(MAKE) -f $$eval($${variables}.makefile) qmake
    269         eval($${target_name}.commands = $$commands)
    270 
    271         QMAKE_EXTRA_TARGETS += $${target_name}
    272         recursive_qmake.depends += $${target_name}
    273     }
    274 
    275     !isEmpty(recursive_qmake.depends): QMAKE_EXTRA_TARGETS += recursive_qmake
    276 }
    277 
    278234incremental.target = incremental
    279235incremental.commands = $(MAKE) -f $(MAKEFILE) qmake_all && $(MAKE) -f $(MAKEFILE)
     
    313269DESTDIR = $$replace(DESTDIR, ^$${ROOT_BUILD_DIR}, $${BUILD_ROOT_RELATIVE_TO_OUT_PWD})
    314270
    315 # Since we loaded our own rules for depending on QtWebKit, and we
    316 # have no more logic that checks contains(QT, webkit), we unset it
    317 # here so that Qt will not add its own include and library paths.
    318 haveQt(4): QT -= webkit webkit-private
    319 
    320271load(default_post) # Load Qt's defaults
  • trunk/Tools/qmake/mkspecs/features/default_pre.prf

    r124607 r124879  
    5757}
    5858
    59 haveQt(4) {
    60     # Make sure QMAKEPATH is set for recursive targets
    61     win_cmd_shell: QMAKE_QMAKE = \(set QMAKEPATH=$$(QMAKEPATH)\) && $$QMAKE_QMAKE
    62     else: QMAKE_QMAKE = QMAKEPATH=$$(QMAKEPATH) $$QMAKE_QMAKE
    63 }
    64 
    6559# Default location of generated sources
    6660GENERATED_SOURCES_DESTDIR = generated
     
    8377else: PYTHON = python
    8478
    85 !haveQt(4, 8):!haveQt(5):!recursive_include: error("Building WebKit with Qt versions older than 4.8 is not supported.")
     79!haveQt(5):!recursive_include: error("Building WebKit with Qt versions older than 5.0 is not supported.")
    8680
    87 !haveQt(5):!no_webkit2 {
    88     root_project_file {
    89         message("Building WebKit2 with Qt versions older than 5.0 is not supported. Disabling WebKit2.")
    90         message("Read http://www.mail-archive.com/webkit-qt@lists.webkit.org/msg01674.html for more information.")
    91     }
    92     CONFIG += no_webkit2
    93 }
    94 
    95 haveQt(5): {
    96     !haveQtModule(widgets)|!haveQtModule(printsupport) {
    97         root_project_file: message("WebKit1 requires the QtWidgets and QtPrintSupport modules. Disabling WebKit1.")
    98         CONFIG += no_webkit1
    99     }
     81!haveQtModule(widgets)|!haveQtModule(printsupport) {
     82    root_project_file: message("WebKit1 requires the QtWidgets and QtPrintSupport modules. Disabling WebKit1.")
     83    CONFIG += no_webkit1
    10084}
    10185
     
    10387# always be our webkit build dir. This might change as configure changes.
    10488contains(QT_CONFIG, private_tests): CONFIG += qt_developer_build
    105 
    106 haveQt(4) {
    107     # Qt5 will automatically load the module files for us, but for Qt4
    108     # we have to do it manually so that the various QT.webkit.foo names
    109     # are available.
    110     include($${ROOT_WEBKIT_DIR}/Tools/qmake/qt_webkit.pri)
    111 }
    11289
    11390# Set some defaults for specific platforms
     
    11794SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
    11895isEmpty(SQLITE3SRCDIR) {
    119     haveQt(5): SQLITE3SRCDIR = $$QT.core.sources/../3rdparty/sqlite/
    120     else: SQLITE3SRCDIR = $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/
     96    SQLITE3SRCDIR = $$QT.core.sources/../3rdparty/sqlite/
    12197}
    12298
  • trunk/Tools/qmake/mkspecs/features/features.prf

    r123453 r124879  
    3232# unset the opposite value, that's handled automatically for you.
    3333
    34 # For Mac we do not rely on QT_CONFIG, because icu is not officially supported for all of qt.
    35 haveQt(5):if(contains(QT_CONFIG,icu)|mac) {
    36     DEFINES += WTF_USE_ICU_UNICODE=1
    37     DEFINES -= WTF_USE_QT4_UNICODE=1
    38 } else {
    39     DEFINES += WTF_USE_QT4_UNICODE=1
    40     DEFINES -= WTF_USE_ICU_UNICODE=1
    41 }
     34DEFINES += WTF_USE_ICU_UNICODE=1
     35DEFINES -= WTF_USE_QT4_UNICODE=1
    4236
    4337!contains(DEFINES, HAVE_QRAWFONT=.) {
    4438    # Use of QRawFont in Qt 5:
    45     haveQt(5): DEFINES += HAVE_QRAWFONT=1
     39    DEFINES += HAVE_QRAWFONT=1
    4640}
    4741
    4842# We need fontconfig to set up the test fonts for DumpRenderTree and WebKitTestRunner.
    49 haveQt(5) {
    50     config_fontconfig:!mac {
    51         DEFINES += HAVE_FONTCONFIG=1
    52     }
    53 } else {
    54     # Qt 4
    55     unix:!mac:!embedded {
    56         DEFINES += HAVE_FONTCONFIG=1
    57     }
     43config_fontconfig:!mac {
     44    DEFINES += HAVE_FONTCONFIG=1
    5845}
    5946
     
    8168# Nescape plugins support (NPAPI)
    8269!contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
    83     haveQt(5):xlibAvailable() {
     70    xlibAvailable() {
    8471        DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
    8572        CONFIG += plugin_backend_xlib
     
    10693
    10794# QStyle detection
    108 haveQt(4)|haveQtModule(widgets): DEFINES += HAVE_QSTYLE=1
     95haveQtModule(widgets): DEFINES += HAVE_QSTYLE=1
    10996
    11097# WebGL support
     
    135122
    136123# orientation support
    137 haveQt(5) {
    138     haveQtModule(sensors) {
    139         !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
    140         !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
    141     }
    142 } else {
    143     # Qt 4 with Qt Mobility
    144     contains(MOBILITY_CONFIG, sensors) {
    145         !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
    146         !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
    147     }
     124haveQtModule(sensors) {
     125    !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
     126    !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
    148127}
    149128
     
    170149}
    171150
    172 haveQt(4) {
    173     haveQtModule(declarative): DEFINES += HAVE_QQUICK1=1
    174 } else {
    175     # FIXME: Add Qt 5 QQuick1 support once QDeclarativeEngine in QQuick2
    176     # is called QmlEngine and it is safe for us to use QQuick1 again.
    177 }
    178 
    179151# Xcomposite Support
    180 haveQt(5):linux-*:config_libXcomposite: DEFINES += HAVE_XCOMPOSITE=1
     152linux-*:config_libXcomposite: DEFINES += HAVE_XCOMPOSITE=1
    181153
    182154# Xrender Support
     
    188160# Support for Graphics Surface
    189161!contains(DEFINES, WTF_USE_GRAPHICS_SURFACE=.) {
    190     haveQt(5) {
    191         mac: DEFINES += WTF_USE_GRAPHICS_SURFACE=1
    192         # On linux we require GLX, libXcomposite and libXrender to enable graphics surface.
    193         linux-*:contains(DEFINES, HAVE_GLX=1):contains(DEFINES, HAVE_XCOMPOSITE=1):contains(DEFINES, HAVE_XRENDER=1): DEFINES += WTF_USE_GRAPHICS_SURFACE=1
    194     }
     162    mac: DEFINES += WTF_USE_GRAPHICS_SURFACE=1
     163    # On linux we require GLX, libXcomposite and libXrender to enable graphics surface.
     164    linux-*:contains(DEFINES, HAVE_GLX=1):contains(DEFINES, HAVE_XCOMPOSITE=1):contains(DEFINES, HAVE_XRENDER=1): DEFINES += WTF_USE_GRAPHICS_SURFACE=1
    195165}
    196166
     
    238208    # Disable USE(3D_GRAPHICS) on Windows temporarily, see https://bugs.webkit.org/show_bug.cgi?id=90850 for details.
    239209    !win32-* {
    240         haveQt(5)|contains(QT_CONFIG, opengl): DEFINES += WTF_USE_3D_GRAPHICS=1
    241     }
    242 }
    243 
    244 haveQt(4):contains(DEFINES, ENABLE_WEBGL=1):contains(DEFINES, WTF_USE_3D_GRAPHICS=0) {
    245     error("WebGL requires Qt to be configured with OpenGL. Please reconfigure Qt with OpenGL, or build WebKit without WebGL.")
    246 }
     210        DEFINES += WTF_USE_3D_GRAPHICS=1
     211    }
     212}
     213
    247214
    248215# Slider Touch is sensible to use when compiling WebKit2
  • trunk/Tools/qmake/mkspecs/features/functions.prf

    r121966 r124879  
    138138    second_base_target = sub-$$replace(secondSubdirFile, [^a-zA-Z0-9_], -)
    139139
    140     haveQt(4) {
    141         # Use a custom target for making the derived sources instead of the default ones,
    142         # as the default ones depend on $(MAKEFILE), while we want to depend on *qmake_all.
    143         # Without this rule we end up running qmake twice for the derived sources, as well as
    144         # introducing a race condition where we run "qmake -o Makefile.DerivedSources" at the
    145         # same time as we run "make -f Makefile.DerivedSources", resulting in make reading a
    146         # half-written makefile.
    147         derived_make_for_qmake.target = $${first_base_target}-make_for_qmake
    148         derived_make_for_qmake.depends = $${first_base_target}-qmake_all
    149         derived_make_for_qmake.commands = $(MAKE) -f $$eval($${firstSubdir}.makefile)
    150         QMAKE_EXTRA_TARGETS += derived_make_for_qmake
    151 
    152         # This target ensures that running "make qmake" will force both qmake and make
    153         # to be run on the derived sources before running qmake on the target, so that
    154         # qmake can pick up the right dependencies for the target based on the derived
    155         # sources that were generated.
    156         target_make_qmake.target = $${second_base_target}-qmake_all
    157         target_make_qmake.depends = $${derived_make_for_qmake.target}
    158         QMAKE_EXTRA_TARGETS += target_make_qmake
    159 
    160         GNUmake {
    161             # This target ensures that running make before any makefiles have been created
    162             # will still force qmake and make to be run on the derived sources first.
    163             target_make.target = $$eval($${secondSubdir}.makefile)
    164 
    165             # We use order-only-prerequisites so that we can run make on the derived sources
    166             # without triggering a qmake run on the target due to updated dependencies.
    167             target_make.depends = "| $${first_base_target}-make_default-ordered"
    168 
    169             QMAKE_EXTRA_TARGETS += target_make
    170         }
    171     } else {
    172         # Qt5's qmake does most of the above for us already.
    173 
    174         # This target ensures that running "make qmake_all" will force both qmake and make
    175         # to be run on the derived sources before running qmake on the target, so that
    176         # qmake can pick up the right dependencies for the target based on the derived
    177         # sources that were generated. Just "make qmake" is non-recursive anyway.
    178         target_make_qmake.target = $${second_base_target}-qmake_all
    179         target_make_qmake.depends = $${first_base_target}
    180         QMAKE_EXTRA_TARGETS += target_make_qmake
    181 
    182         # Make things work even if qmake -r is used.
    183         CONFIG += dont_recurse
    184     }
     140    # This target ensures that running "make qmake_all" will force both qmake and make
     141    # to be run on the derived sources before running qmake on the target, so that
     142    # qmake can pick up the right dependencies for the target based on the derived
     143    # sources that were generated. Just "make qmake" is non-recursive anyway.
     144    target_make_qmake.target = $${second_base_target}-qmake_all
     145    target_make_qmake.depends = $${first_base_target}
     146    QMAKE_EXTRA_TARGETS += target_make_qmake
     147
     148    # Make things work even if qmake -r is used.
     149    CONFIG += dont_recurse
    185150
    186151    export(SUBDIRS)
     
    224189    module = $$1
    225190
    226     haveQt(4):contains(QT_CONFIG, $${module}): return(true)
    227191    haveQt(5):!isEmpty(QT.$${module}.name): return(true)
    228192    return(false)
     
    311275}
    312276
    313 defineTest(runSyncQt) {
    314 
    315     build_pass:return(true)
    316 
    317     haveQt(5) {
    318         # Qt 5 will run synqt as part of defaults_pre, so no need to do anything
    319     } else {
    320         # Use our own copy of syncqt from Qt 4.8 to generate forwarding headers
    321         syncqt = $$toSystemPath($${ROOT_WEBKIT_DIR}/Tools/qmake/syncqt-4.8)
    322         command = $$syncqt
    323         win32-msvc*: command = $$command -windows
    324 
    325         outdir = $$toSystemPath($${ROOT_BUILD_DIR})
    326 
    327         # The module root has to be the same as directory of the pro-file that generates
    328         # the install rules (api.pri), otherwise the relative paths in the generated
    329         # headers.pri will be incorrect.
    330         module_rootdir = $$toSystemPath($${_PRO_FILE_PWD_})
    331 
    332         module = $${TARGET}$${DIRLIST_SEPARATOR}$${module_rootdir}$${DIRLIST_SEPARATOR}$$toSystemPath(WebKit/qt/Api)
    333         command = perl $${command} -outdir $${outdir} -separate-module $${module}
    334         message(Running $$command)
    335         !system($$command) {
    336             error(Failed to run $${command})
    337         }
    338     }
    339 
    340     return(true)
    341 }
    342 
    343277defineTest(xlibAvailable) {
    344     haveQt(5) {
    345         contains(QT_CONFIG, xcb-xlib) {
    346             return(true)
    347         } else {
    348             return(false)
    349         }
    350     } else {
    351         unix:!mac:!embedded {
    352             return(true)
    353         } else {
    354             return(false)
    355         }
    356     }
    357 }
     278    contains(QT_CONFIG, xcb-xlib) {
     279        return(true)
     280    } else {
     281        return(false)
     282    }
     283}
  • trunk/Tools/qmake/mkspecs/features/unix/default_pre.prf

    r121147 r124879  
    77load(functions)
    88
    9 haveQt(5): CONFIG += object_parallel_to_source
     9CONFIG += object_parallel_to_source
    1010
    1111# Expose if we are building inside Scratchbox
  • trunk/WebKit.pro

    r124608 r124879  
    66# -------------------------------------------------------------------
    77
    8 haveQt(4) {
    9     QMAKEPATH = $$(QMAKEPATH)
    10     isEmpty(QMAKEPATH)|!exists($${QMAKEPATH}/mkspecs) {
    11         error("The environment variable QMAKEPATH needs to point to $WEBKITSRC/Tools/qmake")
    12         # Otherwise we won't pick up the feature prf files needed for the build
    13     }
    14 } else:!webkit_configured {
    15     CONFIG += webkit_configured
     8!webkit_configured {
    169    CONFIG += production_build
    1710    include(Tools/qmake/configure.pri)
Note: See TracChangeset for help on using the changeset viewer.