Changeset 96108 in webkit


Ignore:
Timestamp:
Sep 27, 2011 8:11:11 AM (13 years ago)
Author:
vestbo@webkit.org
Message:

[Qt] Fix build against Qt5 after refactor of widgets out of QtGUi

QWidget and friends now live in the QtWidgets library. We update
includes in implementation files and private headers to us the
non-module-prefixed path, and leave the lookup for the include
path. For public headers we have to ifdef the includes as the
user might now have the modules we need in his QT config.

Finally, QSGCanvas is no longer a QWidget but a QWindow, so we
have to update our code and use windowHandle() for setting the
parent relationships.

https://bugs.webkit.org/show_bug.cgi?id=68687

Reviewed by Andreas Kling.

Location:
trunk
Files:
49 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r96087 r96108  
     12011-09-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Fix build against Qt5 after refactor of widgets out of QtGUi
     4
     5        QWidget and friends now live in the QtWidgets library. We update
     6        includes in implementation files and private headers to us the
     7        non-module-prefixed path, and leave the lookup for the include
     8        path. For public headers we have to ifdef the includes as the
     9        user might now have the modules we need in his QT config.
     10
     11        Finally, QSGCanvas is no longer a QWidget but a QWindow, so we
     12        have to update our code and use windowHandle() for setting the
     13        parent relationships.
     14
     15        https://bugs.webkit.org/show_bug.cgi?id=68687
     16
     17        Reviewed by Andreas Kling.
     18
     19        * Source/WebKit.pro:
     20
    1212011-09-27  Carlos Garcia Campos  <cgarcia@igalia.com>
    222
  • trunk/Source/WebCore/ChangeLog

    r96106 r96108  
     12011-09-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Fix build against Qt5 after refactor of widgets out of QtGUi
     4
     5        QWidget and friends now live in the QtWidgets library. We update
     6        includes in implementation files and private headers to us the
     7        non-module-prefixed path, and leave the lookup for the include
     8        path. For public headers we have to ifdef the includes as the
     9        user might now have the modules we need in his QT config.
     10
     11        Finally, QSGCanvas is no longer a QWidget but a QWindow, so we
     12        have to update our code and use windowHandle() for setting the
     13        parent relationships.
     14
     15        https://bugs.webkit.org/show_bug.cgi?id=68687
     16
     17        Reviewed by Andreas Kling.
     18
     19        * WebCore.pri:
     20        * platform/graphics/qt/GraphicsLayerQt.cpp:
     21
    1222011-09-27  Pavel Feldman  <pfeldman@google.com>
    223
  • trunk/Source/WebCore/WebCore.pri

    r95831 r96108  
    333333linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
    334334
    335 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork
     335unix|win32-g++* {
     336    QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork
     337    greaterThan(QT_MAJOR_VERSION, 4): QMAKE_PKGCONFIG_REQUIRES += QtWidgets
     338}
    336339unix:!mac:!symbian:CONFIG += link_pkgconfig
    337340
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp

    r95901 r96108  
    3030#include "TranslateTransformOperation.h"
    3131#include "UnitBezier.h"
     32#include <qgraphicseffect.h>
     33#include <qgraphicsitem.h>
     34#include <qgraphicsscene.h>
     35#include <qgraphicsview.h>
     36#include <qgraphicswidget.h>
     37#include <qstyleoption.h>
    3238#include <QtCore/qabstractanimation.h>
    3339#include <QtCore/qdatetime.h>
     
    3743#include <QtCore/qtimer.h>
    3844#include <QtGui/qcolor.h>
    39 #include <QtGui/qgraphicseffect.h>
    40 #include <QtGui/qgraphicsitem.h>
    41 #include <QtGui/qgraphicsscene.h>
    42 #include <QtGui/qgraphicsview.h>
    43 #include <QtGui/qgraphicswidget.h>
    4445#include <QtGui/qpainter.h>
    4546#include <QtGui/qpixmap.h>
    4647#include <QtGui/qpixmapcache.h>
    47 #include <QtGui/qstyleoption.h>
    4848
    4949#if ENABLE(TILED_BACKING_STORE)
  • trunk/Source/WebKit.pro

    r92277 r96108  
    1616    }
    1717    exists($$PWD/WebKit2/WebKit2.pro): SUBDIRS += WebKit2/WebKit2.pro
     18}
     19
     20greaterThan(QT_MAJOR_VERSION, 4) {
     21    isEmpty(QT.widgets.name)|isEmpty(QT.printsupport.name) {
     22        message("Building WebKit against Qt 5.0 requires the QtWidgets and QtPrintSupport modules.")
     23        error("Aborting build.")
     24    }
    1825}
    1926
  • trunk/Source/WebKit/qt/Api/qgraphicswebview.cpp

    r95901 r96108  
    3535#include "IntRect.h"
    3636#include "TiledBackingStore.h"
     37#include <qapplication.h>
     38#include <qgraphicsscene.h>
     39#include <qgraphicssceneevent.h>
     40#include <qgraphicsview.h>
     41#include <qscrollbar.h>
     42#include <qstyleoption.h>
     43#include <qinputcontext.h>
    3744#include <QtCore/qmetaobject.h>
    3845#include <QtCore/qsharedpointer.h>
    3946#include <QtCore/qtimer.h>
    40 #include <QtGui/qapplication.h>
    41 #include <QtGui/qgraphicsscene.h>
    42 #include <QtGui/qgraphicssceneevent.h>
    43 #include <QtGui/qgraphicsview.h>
    4447#include <QtGui/qpixmapcache.h>
    45 #include <QtGui/qscrollbar.h>
    46 #include <QtGui/qstyleoption.h>
    47 #include <QtGui/qinputcontext.h>
     48
    4849#if defined(Q_WS_X11)
    4950#include <QX11Info>
  • trunk/Source/WebKit/qt/Api/qgraphicswebview.h

    r95901 r96108  
    2424#include "qwebpage.h"
    2525#include <QtCore/qurl.h>
    26 #include <QtGui/qevent.h>
     26#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     27#include <QtWidgets/qgraphicswidget.h>
     28#include <QtWidgets/qicon.h>
     29#else
    2730#include <QtGui/qgraphicswidget.h>
    2831#include <QtGui/qicon.h>
     32#endif
     33#include <QtGui/qevent.h>
    2934#include <QtGui/qpainter.h>
    3035#include <QtNetwork/qnetworkaccessmanager.h>
  • trunk/Source/WebKit/qt/Api/qwebframe.h

    r94968 r96108  
    2525#include <QtCore/qurl.h>
    2626#include <QtCore/qvariant.h>
     27#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     28#include <QtWidgets/qicon.h>
     29#else
    2730#include <QtGui/qicon.h>
     31#endif
    2832#include <QtScript/qscriptengine.h>
    2933#include <QtNetwork/qnetworkaccessmanager.h>
  • trunk/Source/WebKit/qt/Api/qwebhistory.h

    r61056 r96108  
    2323#include <QtCore/qurl.h>
    2424#include <QtCore/qstring.h>
    25 #include <QtGui/qicon.h>
    2625#include <QtCore/qdatetime.h>
    2726#include <QtCore/qshareddata.h>
     27#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     28#include <QtWidgets/qicon.h>
     29#else
     30#include <QtGui/qicon.h>
     31#endif
    2832
    2933#include "qwebkitglobal.h"
  • trunk/Source/WebKit/qt/Api/qwebpage.h

    r90856 r96108  
    2727#include <QtCore/qobject.h>
    2828#include <QtCore/qurl.h>
     29#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     30#include <QtWidgets/qwidget.h>
     31#else
    2932#include <QtGui/qwidget.h>
     33#endif
    3034
    3135QT_BEGIN_NAMESPACE
  • trunk/Source/WebKit/qt/Api/qwebsettings.h

    r90341 r96108  
    2525#include <QtCore/qstring.h>
    2626#include <QtGui/qpixmap.h>
     27#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     28#include <QtWidgets/qicon.h>
     29#else
    2730#include <QtGui/qicon.h>
     31#endif
    2832#include <QtCore/qshareddata.h>
    2933
  • trunk/Source/WebKit/qt/Api/qwebview.h

    r94968 r96108  
    2424#include "qwebkitglobal.h"
    2525#include "qwebpage.h"
     26#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     27#include <QtWidgets/qwidget.h>
     28#include <QtWidgets/qicon.h>
     29#else
    2630#include <QtGui/qwidget.h>
    2731#include <QtGui/qicon.h>
     32#endif
    2833#include <QtGui/qpainter.h>
    2934#include <QtCore/qurl.h>
  • trunk/Source/WebKit/qt/ChangeLog

    r95919 r96108  
     12011-09-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Fix build against Qt5 after refactor of widgets out of QtGUi
     4
     5        QWidget and friends now live in the QtWidgets library. We update
     6        includes in implementation files and private headers to us the
     7        non-module-prefixed path, and leave the lookup for the include
     8        path. For public headers we have to ifdef the includes as the
     9        user might now have the modules we need in his QT config.
     10
     11        Finally, QSGCanvas is no longer a QWidget but a QWindow, so we
     12        have to update our code and use windowHandle() for setting the
     13        parent relationships.
     14
     15        https://bugs.webkit.org/show_bug.cgi?id=68687
     16
     17        Reviewed by Andreas Kling.
     18
     19        * Api/qgraphicswebview.cpp:
     20        * Api/qgraphicswebview.h:
     21        * Api/qwebframe.h:
     22        * Api/qwebhistory.h:
     23        * Api/qwebpage.h:
     24        * Api/qwebsettings.h:
     25        * Api/qwebview.h:
     26        * QtWebKit.pro:
     27        * WebCoreSupport/PageClientQt.h:
     28        * WebCoreSupport/QtWebComboBox.cpp:
     29        * WebCoreSupport/QtWebComboBox.h:
     30        * declarative/qdeclarativewebview.cpp:
     31        * declarative/qdeclarativewebview_p.h:
     32        * docs/webkitsnippets/webpage/main.cpp:
     33        * examples/platformplugin/WebNotificationPresenter.h:
     34
    1352011-09-24  Adam Barth  <abarth@webkit.org>
    236
  • trunk/Source/WebKit/qt/QtWebKit.pro

    r94321 r96108  
    4242# It used to be in WebCore.pro but now that this is the main pro file it has to be here.
    4343QT += network
     44greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
    4445
    4546isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..
  • trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.h

    r95901 r96108  
    3232#include "qwebpage.h"
    3333#include "qwebpage_p.h"
     34#include <qgraphicsscene.h>
     35#include <qgraphicsview.h>
     36#include <qgraphicswidget.h>
     37#include <qscrollbar.h>
     38#include <qstyleoption.h>
     39#include <qwidget.h>
    3440#include <QtCore/qmetaobject.h>
    35 #include <QtGui/qgraphicsscene.h>
    36 #include <QtGui/qgraphicsview.h>
    37 #include <QtGui/qgraphicswidget.h>
    38 #include <QtGui/qscrollbar.h>
    39 #include <QtGui/qstyleoption.h>
    40 #include <QtGui/qwidget.h>
    4141
    4242#include <Settings.h>
  • trunk/Source/WebKit/qt/WebCoreSupport/QtWebComboBox.cpp

    r95901 r96108  
    2525#ifndef QT_NO_COMBOBOX
    2626
    27 #include <QtGui/QAbstractItemView>
    28 #include <QtGui/QApplication>
     27#include <QAbstractItemView>
     28#include <QApplication>
    2929#include <QtGui/QMouseEvent>
    3030
  • trunk/Source/WebKit/qt/WebCoreSupport/QtWebComboBox.h

    r95901 r96108  
    2424#include "Platform.h"
    2525
    26 #include <QtGui/QComboBox>
     26#include <QComboBox>
    2727
    2828#ifndef QT_NO_COMBOBOX
  • trunk/Source/WebKit/qt/declarative/qdeclarativewebview.cpp

    r95901 r96108  
    2121#include "qdeclarativewebview_p.h"
    2222
     23#include <QApplication>
     24#include <QGraphicsSceneMouseEvent>
    2325#include <QtCore/QDebug>
    2426#include <QtCore/QEvent>
     
    2729#include <QtDeclarative/QDeclarativeEngine>
    2830#include <QtDeclarative/qdeclarative.h>
    29 #include <QtGui/QApplication>
    30 #include <QtGui/QGraphicsSceneMouseEvent>
    3131#include <QtGui/QKeyEvent>
    3232#include <QtGui/QMouseEvent>
  • trunk/Source/WebKit/qt/declarative/qdeclarativewebview_p.h

    r95901 r96108  
    2727#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    2828#include <QtQuick1/QDeclarativeItem>
     29#include <QtWidgets/QAction>
    2930#else
    3031#include <QtDeclarative/QDeclarativeItem>
    31 #endif
    32 
    3332#include <QtGui/QAction>
     33#endif
     34
    3435#include <QtNetwork/QNetworkAccessManager>
    3536#include "qgraphicswebview.h"
  • trunk/Source/WebKit/qt/docs/webkitsnippets/webpage/main.cpp

    r95901 r96108  
    1818*/
    1919
    20 #include <QtGui>
     20#include <QApplication>
     21#include <QPainter>
     22#include <QWebFrame>
    2123#include <QWebPage>
    22 #include <QWebFrame>
    2324
    2425//! [0]
  • trunk/Source/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h

    r95901 r96108  
    2323
    2424#include "qwebkitplatformplugin.h"
    25 #include <QtGui>
     25
     26#include <QBitmap>
     27#include <QEvent>
     28#include <QGridLayout>
     29#include <QLabel>
     30#include <QPainter>
     31#include <QWidget>
    2632
    2733class WebNotificationWidget : public QWidget
  • trunk/Source/WebKit2/ChangeLog

    r96105 r96108  
     12011-09-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Fix build against Qt5 after refactor of widgets out of QtGUi
     4
     5        QWidget and friends now live in the QtWidgets library. We update
     6        includes in implementation files and private headers to us the
     7        non-module-prefixed path, and leave the lookup for the include
     8        path. For public headers we have to ifdef the includes as the
     9        user might now have the modules we need in his QT config.
     10
     11        Finally, QSGCanvas is no longer a QWidget but a QWindow, so we
     12        have to update our code and use windowHandle() for setting the
     13        parent relationships.
     14
     15        https://bugs.webkit.org/show_bug.cgi?id=68687
     16
     17        Reviewed by Andreas Kling.
     18
     19        * UIProcess/API/qt/qdesktopwebview.cpp:
     20        * UIProcess/API/qt/qdesktopwebview.h:
     21        * UIProcess/API/qt/tests/tests.pro:
     22        * UIProcess/qt/ViewInterface.h:
     23        * UIProcess/qt/WebPopupMenuProxyQtDesktop.cpp:
     24
    1252011-09-26  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
    226
  • trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp

    r96105 r96108  
    2424#include "qweberror.h"
    2525
     26#include <QFileDialog>
     27#include <QGraphicsSceneEvent>
    2628#include <QGraphicsSceneResizeEvent>
    2729#include <QStyleOptionGraphicsItem>
     
    3234#include <QtDeclarative/qsgview.h>
    3335#include <QtGui/QCursor>
    34 #include <QtGui/QFileDialog>
     36#include <QtGui/QDrag>
    3537#include <QtGui/QFocusEvent>
    36 #include <QtGui/QGraphicsSceneEvent>
    3738#include <QtGui/QHoverEvent>
    3839#include <QtGui/QInputMethodEvent>
     
    8283void QDesktopWebViewPrivate::startDrag(Qt::DropActions supportedDropActions, const QImage& dragImage, QMimeData* data, QPoint* clientPosition, QPoint* globalPosition, Qt::DropAction* dropAction)
    8384{
    84     QWidget* widget = q->canvas();
    85     if (!widget)
    86         return;
    87 
    88     QDrag* drag = new QDrag(widget);
     85    QWindow* window = q->canvas();
     86    if (!window)
     87        return;
     88
     89    QDrag* drag = new QDrag(window);
    8990    drag->setPixmap(QPixmap::fromImage(dragImage));
    9091    drag->setMimeData(data);
    9192    *dropAction = drag->exec(supportedDropActions);
    9293    *globalPosition = QCursor::pos();
    93     *clientPosition = widget->mapFromGlobal(*globalPosition);
     94    *clientPosition = window->mapFromGlobal(*globalPosition);
    9495}
    9596
     
    117118{
    118119    // FIXME: Add a proper implementation when Qt 5 supports tooltip.
    119     q->canvas()->setToolTip(newToolTip);
    120120}
    121121
     
    128128{
    129129    // FIXME: add proper cursor handling when Qt 5 supports it.
    130     q->canvas()->setCursor(newCursor);
    131130}
    132131
     
    165164        return;
    166165
    167     QWidget* widget = q->canvas();
    168     if (!widget)
     166    QWindow* window = q->canvas();
     167    if (!window)
    169168        return;
    170169
    171170    activeMenu = menu;
    172171
    173     menu->setParent(widget, menu->windowFlags());
     172    activeMenu->window()->winId(); // Ensure that the menu has a window
     173    Q_ASSERT(activeMenu->window()->windowHandle());
     174    activeMenu->window()->windowHandle()->setTransientParent(window);
     175
    174176    QPoint menuPositionInScene = q->mapToScene(menu->pos()).toPoint();
    175     menu->exec(widget->mapToGlobal(menuPositionInScene));
     177    menu->exec(window->mapToGlobal(menuPositionInScene));
    176178    // The last function to get out of exec() clear the local copy.
    177179    if (activeMenu == menu)
     
    404406        selectedFileName = selectedFileNames.at(0);
    405407
    406     QWidget* widget = q->canvas();
    407     fileDialog = new QFileDialog(widget, QString(), selectedFileName);
     408    Q_ASSERT(!fileDialog);
     409
     410    QWindow* window = q->canvas();
     411    if (!window)
     412        return;
     413
     414    fileDialog = new QFileDialog(0, QString(), selectedFileName);
     415    fileDialog->window()->winId(); // Ensure that the dialog has a window
     416    Q_ASSERT(fileDialog->window()->windowHandle());
     417    fileDialog->window()->windowHandle()->setTransientParent(window);
     418
    408419    fileDialog->open(this, SLOT(onOpenPanelFilesSelected()));
    409420
  • trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h

    r96105 r96108  
    4545
    4646namespace WTR {
    47     class WebView;
     47    class PlatformWebView;
    4848}
    4949
     
    121121    void init();
    122122
    123     friend class WTR::WebView;
     123    friend class WTR::PlatformWebView;
    124124    friend class QDesktopWebViewPrivate;
    125125    QDesktopWebViewPrivate *d;
  • trunk/Source/WebKit2/UIProcess/API/qt/tests/tests.pro

    r92277 r96108  
    11TEMPLATE = subdirs
    2 SUBDIRS = qtouchwebview qdesktopwebview commonviewtests qmltests
     2SUBDIRS = qtouchwebview qdesktopwebview commonviewtests
     3lessThan(QT_MAJOR_VERSION, 5): SUBDIRS += qmltests
  • trunk/Source/WebKit2/UIProcess/qt/ViewInterface.h

    r96105 r96108  
    2424#include <QtCore/QSharedPointer>
    2525#include <QtCore/QSize>
    26 #include <QtGui/QMenu>
     26#include <QMenu>
    2727#include <WebKit2/WKBase.h>
    2828
  • trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQtDesktop.cpp

    r95901 r96108  
    3131#include <QtDeclarative/QSGCanvas>
    3232#include <QtDeclarative/QSGItem>
    33 #include <QtGui/QStandardItemModel>
     33#include <QStandardItemModel>
    3434
    3535using namespace WebCore;
     
    4545{
    4646    QtWebComboBox* comboBox = m_comboBox.data();
    47     comboBox->setParent(m_webViewItem->canvas());
     47
     48    comboBox->window()->winId(); // Ensure that the combobox has a window
     49    Q_ASSERT(comboBox->window()->windowHandle());
     50    comboBox->window()->windowHandle()->setTransientParent(m_webViewItem->canvas());
     51
    4852    connect(comboBox, SIGNAL(activated(int)), SLOT(setSelectedIndex(int)));
    4953    connect(comboBox, SIGNAL(didHide()), SLOT(onPopupMenuHidden()), Qt::QueuedConnection);
  • trunk/Tools/ChangeLog

    r96105 r96108  
     12011-09-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Fix build against Qt5 after refactor of widgets out of QtGUi
     4
     5        QWidget and friends now live in the QtWidgets library. We update
     6        includes in implementation files and private headers to us the
     7        non-module-prefixed path, and leave the lookup for the include
     8        path. For public headers we have to ifdef the includes as the
     9        user might now have the modules we need in his QT config.
     10
     11        Finally, QSGCanvas is no longer a QWidget but a QWindow, so we
     12        have to update our code and use windowHandle() for setting the
     13        parent relationships.
     14
     15        https://bugs.webkit.org/show_bug.cgi?id=68687
     16
     17        Reviewed by Andreas Kling.
     18
     19        * DumpRenderTree/qt/DumpRenderTree.pro:
     20        * DumpRenderTree/qt/ImageDiff.pro:
     21        * MiniBrowser/qt/BrowserView.cpp:
     22        * MiniBrowser/qt/BrowserView.h:
     23        * MiniBrowser/qt/BrowserWindow.cpp:
     24        * MiniBrowser/qt/BrowserWindow.h:
     25        * MiniBrowser/qt/MiniBrowser.pro:
     26        * MiniBrowser/qt/MiniBrowserApplication.h:
     27        * MiniBrowser/qt/main.cpp:
     28        * QtTestBrowser/QtTestBrowser.pro:
     29        * QtTestBrowser/launcherwindow.cpp:
     30        * QtTestBrowser/launcherwindow.h:
     31        * QtTestBrowser/locationedit.h:
     32        * QtTestBrowser/main.cpp:
     33        * QtTestBrowser/mainwindow.cpp:
     34        * QtTestBrowser/mainwindow.h:
     35        * QtTestBrowser/webinspector.h:
     36        * QtTestBrowser/webpage.cpp:
     37        * QtTestBrowser/webview.cpp:
     38        * WebKitTestRunner/PlatformWebView.h:
     39        * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
     40
    1412011-09-26  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
    242
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTree.pro

    r95548 r96108  
    11TARGET = DumpRenderTree
    22CONFIG  -= app_bundle
    3 !isEqual(QT_ARCH,sh4): CONFIG += uitools
     3!isEqual(QT_ARCH,sh4) {
     4    greaterThan(QT_MAJOR_VERSION, 4):isEmpty(QT.uitools.name) {
     5        message("QtUiTools library not found. QWidget plugin loading will be disabled")
     6        DEFINES += QT_NO_UITOOLS
     7    } else {
     8        CONFIG += uitools
     9    }
     10}
    411
    512BASEDIR = $$PWD/../
     
    2128QT = core gui network testlib
    2229macx: QT += xml
     30greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
    2331
    2432HEADERS = $$BASEDIR/WorkQueue.h \
  • trunk/Tools/DumpRenderTree/qt/ImageDiff.pro

    r82125 r96108  
    88
    99QT = core gui
     10greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    1011
    1112SOURCES = ImageDiff.cpp
  • trunk/Tools/MiniBrowser/qt/BrowserView.cpp

    r93831 r96108  
    3737#include <qwebnavigationcontroller.h>
    3838
    39 BrowserView::BrowserView(bool useTouchWebView, QWidget* parent)
     39BrowserView::BrowserView(bool useTouchWebView, QWindow* parent)
    4040    : QSGCanvas(parent)
    4141    , m_item(0)
  • trunk/Tools/MiniBrowser/qt/BrowserView.h

    r91863 r96108  
    3030#define BrowserView_h
    3131
     32#include <QAction>
    3233#include <QtDeclarative/qsgcanvas.h>
    3334#include <qwebkittypes.h>
     
    4142
    4243public:
    43     BrowserView(bool useTouchWebView, QWidget* parent = 0);
     44    BrowserView(bool useTouchWebView, QWindow* parent = 0);
    4445    virtual ~BrowserView();
    4546
  • trunk/Tools/MiniBrowser/qt/BrowserWindow.cpp

    r96105 r96108  
    4343#endif
    4444
     45WindowWrapper::WindowWrapper(QWindow* window, QWidget* widget)
     46    : QWidget(widget)
     47    , m_window(window)
     48{
     49    // Throttle resize events a bit
     50    m_resizeTimer.setInterval(16);
     51    m_resizeTimer.setSingleShot(true);
     52    connect(&m_resizeTimer, SIGNAL(timeout()), this, SLOT(doResize()));
     53    m_window->setWindowFlags(Qt::FramelessWindowHint);
     54}
     55
     56void WindowWrapper::showEvent(QShowEvent* event)
     57{
     58    QWidget::showEvent(event);
     59    m_window->setParent(window()->windowHandle());
     60    m_window->show();
     61}
     62
     63void WindowWrapper::resizeEvent(QResizeEvent* event)
     64{
     65    QWidget::resizeEvent(event);
     66    if (!m_resizeTimer.isActive())
     67        m_resizeTimer.start();
     68}
     69
     70void WindowWrapper::doResize()
     71{
     72    m_window->setGeometry(QRect(mapTo(window(), QPoint(0, 0)), size()));
     73}
     74
    4575BrowserWindow::BrowserWindow(WindowOptions* options)
    4676    : m_urlLoader(0)
     
    70100    }
    71101
    72     this->setCentralWidget(m_browser);
    73     m_browser->setFocus(Qt::OtherFocusReason);
     102    setCentralWidget(new WindowWrapper(m_browser, this));
     103    centralWidget()->setFocus(Qt::OtherFocusReason);
    74104
    75105    QMenu* fileMenu = menuBar()->addMenu("&File");
     
    188218{
    189219    m_addressBar->setText(url.toString());
    190     m_browser->setFocus();
     220    m_browser->requestActivateWindow();
    191221    m_browser->view()->setFocus(true);
    192222}
     
    321351    delete m_urlLoader;
    322352    delete m_addressBar;
    323     delete m_browser;
    324 }
     353}
  • trunk/Tools/MiniBrowser/qt/BrowserWindow.h

    r96105 r96108  
    3434#include "MiniBrowserApplication.h"
    3535#include <QStringList>
    36 #include <QtGui>
     36#include <QTimer>
    3737
    3838class UrlLoader;
     39
     40class WindowWrapper : public QWidget
     41{
     42    Q_OBJECT
     43
     44public:
     45    WindowWrapper(QWindow* window, QWidget* widget = 0);
     46
     47protected:
     48    void showEvent(QShowEvent* event);
     49    void resizeEvent(QResizeEvent* event);
     50
     51private slots:
     52    void doResize();
     53
     54private:
     55    QWindow* m_window;
     56    QTimer m_resizeTimer;
     57};
    3958
    4059class BrowserWindow : public QMainWindow {
  • trunk/Tools/MiniBrowser/qt/MiniBrowser.pro

    r91863 r96108  
    3333QT += network declarative
    3434macx:QT+=xml
     35greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    3536
    3637linux-* {
  • trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.h

    r91667 r96108  
    3030#define MiniBrowserApplication_h
    3131
     32#include <QApplication>
     33#include <QFileDialog>
    3234#include <QHash>
     35#include <QLabel>
     36#include <QLineEdit>
     37#include <QMainWindow>
     38#include <QMenu>
     39#include <QMenuBar>
     40#include <QShortcut>
     41#include <QStatusBar>
    3342#include <QStringList>
     43#include <QToolBar>
    3444#include <QTouchEvent>
    35 #include <QtGui>
     45#include <QUrl>
    3646
    3747struct WindowOptions {
  • trunk/Tools/MiniBrowser/qt/main.cpp

    r91863 r96108  
    3333#include <QLatin1String>
    3434#include <QRegExp>
    35 #include <QtGui>
    3635
    3736int main(int argc, char** argv)
  • trunk/Tools/QtTestBrowser/QtTestBrowser.pro

    r92478 r96108  
    2525    cookiejar.h
    2626
    27 !isEqual(QT_ARCH,sh4): CONFIG += uitools
     27!isEqual(QT_ARCH,sh4) {
     28    greaterThan(QT_MAJOR_VERSION, 4):isEmpty(QT.uitools.name) {
     29        message("QtUiTools library not found. QWidget plugin loading will be disabled")
     30        DEFINES += QT_NO_UITOOLS
     31    } else {
     32        CONFIG += uitools
     33    }
     34}
    2835
    2936isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..
     
    3643QT += network
    3744macx:QT+=xml
     45greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
    3846
    3947unix:!mac:!symbian:!embedded {
  • trunk/Tools/QtTestBrowser/launcherwindow.cpp

    r92686 r96108  
    3737#include "urlloader.h"
    3838
     39#include <QApplication>
     40#include <QCheckBox>
     41#include <QComboBox>
    3942#include <QCoreApplication>
     43#include <QDialogButtonBox>
     44#include <QInputDialog>
     45#include <QLabel>
     46#ifndef QT_NO_LINEEDIT
     47#include <QLineEdit>
     48#endif
     49#ifndef QT_NO_SHORTCUT
     50#include <QMenuBar>
     51#endif
     52#include <QSlider>
     53#include <QSplitter>
     54#include <QStatusBar>
     55#include <QToolButton>
     56#include <QToolTip>
     57#include <QVBoxLayout>
    4058
    4159#if !defined(QT_NO_FILEDIALOG) && !defined(QT_NO_MESSAGEBOX)
  • trunk/Tools/QtTestBrowser/launcherwindow.h

    r92478 r96108  
    3434#define launcherwindow_h
    3535
    36 #include <QtGui>
    3736#include <QtNetwork/QNetworkRequest>
    3837
  • trunk/Tools/QtTestBrowser/locationedit.h

    r82046 r96108  
    3232
    3333#ifndef QT_NO_INPUTDIALOG
    34 #include <QtGui>
     34#include <QApplication>
     35#include <QIcon>
     36#include <QLabel>
     37#include <QLineEdit>
     38#include <QStyleOptionFrameV3>
     39#include <QTimer>
    3540
    3641class LocationEdit : public QLineEdit {
  • trunk/Tools/QtTestBrowser/main.cpp

    r92686 r96108  
    3636WindowOptions windowOptions;
    3737
    38 
     38#include <QApplication>
    3939#include <QDir>
    4040#include <QFile>
    4141#include <QFileInfo>
    4242#include <QFontDatabase>
    43 
    4443
    4544#if defined(Q_WS_X11)
  • trunk/Tools/QtTestBrowser/mainwindow.cpp

    r82109 r96108  
    3636#include "utils.h"
    3737
     38#include <QAction>
     39#ifndef QT_NO_INPUTDIALOG
     40#include <QCompleter>
     41#endif
     42#ifndef QT_NO_FILEDIALOG
     43#include <QFileDialog>
     44#endif
     45
    3846MainWindow::MainWindow()
    3947    : m_page(new WebPage(this))
  • trunk/Tools/QtTestBrowser/mainwindow.h

    r82109 r96108  
    3434#define mainwindow_h
    3535
    36 #include <QtGui>
    3736#include "webpage.h"
     37
     38#include <QMainWindow>
     39#include <QStringListModel>
     40#include <QToolBar>
    3841
    3942class LocationEdit;
  • trunk/Tools/QtTestBrowser/webinspector.h

    r70980 r96108  
    2929#define webinspector_h
    3030
    31 #include <QtGui>
    3231#include "qwebinspector.h"
    3332
  • trunk/Tools/QtTestBrowser/webpage.cpp

    r92686 r96108  
    3535#include "launcherwindow.h"
    3636
     37#include <QAction>
     38#include <QApplication>
    3739#include <QAuthenticator>
     40#ifndef QT_NO_DESKTOPSERVICES
    3841#include <QDesktopServices>
    39 #include <QtGui>
     42#endif
     43#include <QDialogButtonBox>
     44#include <QLabel>
     45#include <QLayout>
     46#ifndef QT_NO_LINEEDIT
     47#include <QLineEdit>
     48#endif
    4049#include <QtNetwork/QNetworkReply>
    4150#include <QtNetwork/QNetworkRequest>
  • trunk/Tools/QtTestBrowser/webview.cpp

    r75467 r96108  
    3333#include "webview.h"
    3434
    35 #include <QtGui>
     35#include <QAction>
    3636#include <QGraphicsScene>
     37#include <QGraphicsSceneContextMenuEvent>
     38#include <QGraphicsSceneMouseEvent>
     39#include <QMenu>
     40#include <QScrollBar>
     41#include <QTimer>
     42
     43#ifndef QT_NO_ANIMATION
     44#include <QAbstractAnimation>
     45#include <QAbstractTransition>
     46#include <QFinalState>
     47#include <QPropertyAnimation>
     48#include <QState>
     49#include <QStateMachine>
     50#endif
    3751
    3852WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent)
  • trunk/Tools/WebKitTestRunner/PlatformWebView.h

    r95878 r96108  
    2828
    2929#if defined(BUILDING_QT__)
    30 namespace WTR {
    31 class WebView;
    32 }
    33 typedef WTR::WebView* PlatformWKView;
    34 class QMainWindow;
    35 typedef QMainWindow* PlatformWindow;
     30class QDesktopWebView;
     31typedef QDesktopWebView* PlatformWKView;
     32class QSGCanvas;
     33typedef QSGCanvas* PlatformWindow;
    3634#elif defined(__APPLE__) && __APPLE__
    3735#if __OBJC__
  • trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp

    r95878 r96108  
    2929#include "PlatformWebView.h"
    3030#include "qdesktopwebview.h"
     31
     32#include <QApplication>
    3133#include <QtDeclarative/qsgcanvas.h>
    32 #include <QtGui>
    3334
    3435namespace WTR {
    3536
    36 class WebView : public QSGCanvas {
    37 public:
    38     WebView(WKContextRef, WKPageGroupRef);
    39 
    40     QDesktopWebView* wkView() const { return m_item; }
    41     WKPageRef pageRef() const { return m_item->pageRef(); }
    42 
    43     virtual ~WebView() { delete m_item; }
    44 
    45 private:
    46     QDesktopWebView* m_item;
    47 };
    48 
    49 WebView::WebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
    50     : m_item(new QDesktopWebView(contextRef, pageGroupRef, rootItem()))
     37PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
     38    : m_view(new QDesktopWebView(contextRef, pageGroupRef))
     39    , m_window(new QSGCanvas)
    5140{
    52     m_item->setWidth(800);
    53     m_item->setHeight(600);
    54 }
    55 
    56 PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
    57     : m_view(new WebView(contextRef, pageGroupRef))
    58     , m_window(new QMainWindow())
    59 {
    60     m_view->setParent(m_window);
    61     m_window->setCentralWidget(m_view);
     41    m_view->setParent(m_window->rootItem());
    6242    m_window->setGeometry(0, 0, 800, 600);
    6343
    6444    QFocusEvent ev(QEvent::WindowActivate);
    6545    QApplication::sendEvent(m_view, &ev);
    66     m_view->wkView()->setFocus(Qt::OtherFocusReason);
     46    m_view->setFocus(Qt::OtherFocusReason);
    6747}
    6848
     
    10585bool PlatformWebView::sendEvent(QEvent* event)
    10686{
    107     return QCoreApplication::sendEvent(m_view->wkView(), event);
     87    return QCoreApplication::sendEvent(m_view, event);
    10888}
    10989
    11090void PlatformWebView::postEvent(QEvent* event)
    11191{
    112     QCoreApplication::postEvent(m_view->wkView(), event);
     92    QCoreApplication::postEvent(m_view, event);
    11393}
    11494
Note: See TracChangeset for help on using the changeset viewer.