summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2018-06-05 07:40:44 +1000
committerLorn Potter <lorn.potter@gmail.com>2018-06-20 05:19:43 +0000
commit17c450bb9a18c2db70da86436554236cc95429f1 (patch)
tree7e4e09c4ca1099e5dce421fa3986214af010a3cf /src
parent8dcc67854dd3a668d62cbc3146ddf7ae3398d3e1 (diff)
wasm: clean up platform plugin
Change-Id: Id1394c186f287d14fddf572e83eb3982d7cc8cf5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/html5/main.cpp4
-rw-r--r--src/plugins/platforms/html5/qhtml5backingstore.cpp6
-rw-r--r--src/plugins/platforms/html5/qhtml5backingstore.h2
-rw-r--r--src/plugins/platforms/html5/qhtml5compositor.cpp195
-rw-r--r--src/plugins/platforms/html5/qhtml5compositor.h9
-rw-r--r--src/plugins/platforms/html5/qhtml5cursor.cpp2
-rw-r--r--src/plugins/platforms/html5/qhtml5cursor.h2
-rw-r--r--src/plugins/platforms/html5/qhtml5eventdispatcher.cpp2
-rw-r--r--src/plugins/platforms/html5/qhtml5eventdispatcher.h2
-rw-r--r--src/plugins/platforms/html5/qhtml5eventtranslator.cpp5
-rw-r--r--src/plugins/platforms/html5/qhtml5eventtranslator.h2
-rw-r--r--src/plugins/platforms/html5/qhtml5fontdatabase.cpp2
-rw-r--r--src/plugins/platforms/html5/qhtml5fontdatabase.h2
-rw-r--r--src/plugins/platforms/html5/qhtml5integration.cpp19
-rw-r--r--src/plugins/platforms/html5/qhtml5integration.h2
-rw-r--r--src/plugins/platforms/html5/qhtml5openglcontext.cpp2
-rw-r--r--src/plugins/platforms/html5/qhtml5screen.cpp2
-rw-r--r--src/plugins/platforms/html5/qhtml5screen.h2
-rw-r--r--src/plugins/platforms/html5/qhtml5stylepixmaps_p.h2
-rw-r--r--src/plugins/platforms/html5/qhtml5window.cpp11
-rw-r--r--src/plugins/platforms/html5/qhtml5window.h4
21 files changed, 63 insertions, 216 deletions
diff --git a/src/plugins/platforms/html5/main.cpp b/src/plugins/platforms/html5/main.cpp
index 768c951e17..27aa30b371 100644
--- a/src/plugins/platforms/html5/main.cpp
+++ b/src/plugins/platforms/html5/main.cpp
@@ -43,10 +43,10 @@ public:
QPlatformIntegration* QHtml5IntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
- if (!system.compare(QLatin1String("html5"), Qt::CaseInsensitive))
+ if (!system.compare(QStringLiteral("html5"), Qt::CaseInsensitive))
return new QHtml5Integration;
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/html5/qhtml5backingstore.cpp b/src/plugins/platforms/html5/qhtml5backingstore.cpp
index 73546f33f0..7bddc1b66b 100644
--- a/src/plugins/platforms/html5/qhtml5backingstore.cpp
+++ b/src/plugins/platforms/html5/qhtml5backingstore.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -143,10 +143,6 @@ void QHtml5BackingStore::resize(const QSize &size, const QRegion &staticContents
if (mTexture->isCreated())
mTexture->destroy();
-
- /*
- updateTexture();
- */
}
QImage QHtml5BackingStore::toImage() const
diff --git a/src/plugins/platforms/html5/qhtml5backingstore.h b/src/plugins/platforms/html5/qhtml5backingstore.h
index 2a0a06894b..d808d10254 100644
--- a/src/plugins/platforms/html5/qhtml5backingstore.h
+++ b/src/plugins/platforms/html5/qhtml5backingstore.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5compositor.cpp b/src/plugins/platforms/html5/qhtml5compositor.cpp
index 4c5649fe5a..2c30985832 100644
--- a/src/plugins/platforms/html5/qhtml5compositor.cpp
+++ b/src/plugins/platforms/html5/qhtml5compositor.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -52,14 +52,14 @@ Q_GUI_EXPORT int qt_defaultDpiX();
QHtml5CompositedWindow::QHtml5CompositedWindow()
: window(0)
- , parentWindow(0)
+ , parentWindow(nullptr)
, flushPending(false)
, visible(false)
{
}
QHtml5Compositor::QHtml5Compositor()
- : m_frameBuffer(0)
+ : m_frameBuffer(nullptr)
, mBlitter(new QOpenGLTextureBlitter)
, m_needComposit(false)
, m_inFlush(false)
@@ -316,7 +316,6 @@ QRect QHtml5Compositor::titlebarRect(QHtml5TitleBarOptions tb, QHtml5Compositor:
else if (isMaximized && (tb.flags & Qt::WindowMaximizeButtonHint))
ret.adjust(0, 0, -delta*2, 0);
offset += (delta +delta);
-// offset += delta;
break;
case SC_TitleBarSysMenu:
if (tb.flags & Qt::WindowSystemMenuHint) {
@@ -359,50 +358,37 @@ QHtml5Compositor::QHtml5TitleBarOptions QHtml5Compositor::makeTitleBarOptions(co
titleBarOptions.flags = window->window()->flags();
titleBarOptions.state = window->window()->windowState();
- // bool isMinimized = titleBarOptions.flags & Qt::WindowMinimized;
bool isMaximized = titleBarOptions.state & Qt::WindowMaximized; // this gets reset when maximized
if (titleBarOptions.flags & (Qt::WindowTitleHint))
titleBarOptions.subControls |= SC_TitleBarLabel;
if (titleBarOptions.flags & Qt::WindowMaximizeButtonHint) {
- if (isMaximized) {
+ if (isMaximized)
titleBarOptions.subControls |= SC_TitleBarNormalButton;
- } else {
+ else
titleBarOptions.subControls |= SC_TitleBarMaxButton;
- }
}
if (titleBarOptions.flags & Qt::WindowSystemMenuHint) {
titleBarOptions.subControls |= SC_TitleBarCloseButton;
titleBarOptions.subControls |= SC_TitleBarSysMenu;
}
- // Disable minimize button
- // titleBarOptions.flags.setFlag(Qt::WindowMinimizeButtonHint, false);
titleBarOptions.palette = QHtml5Compositor::makeWindowPalette();
if (window->window()->isActive()) {
- // titleBarOptions.state |= QHtml5Compositor::State_Active;
- // titleBarOptions.state |= QHtml5Compositor::State_Active;
titleBarOptions.palette.setCurrentColorGroup(QPalette::Active);
} else {
- // titleBarOptions.state &= ~QHtml5Compositor::State_Active;
titleBarOptions.palette.setCurrentColorGroup(QPalette::Inactive);
}
if (window->activeSubControl() != QHtml5Compositor::SC_None) {
titleBarOptions.subControls = window->activeSubControl();
- // titleBarOptions.state |= QHtml5Compositor::State_Sunken;
}
if (!window->window()->title().isEmpty()) {
titleBarOptions.titleBarOptionsString = window->window()->title();
-
-#warning FIXME QFontMetrics
-// QFont font = QApplication::font("QMdiSubWindowTitleBar");
-// QFontMetrics fontMetrics = QFontMetrics(font);
-// fontMetrics.elidedText(window->window()->title(), Qt::ElideRight, titleWidth);
}
return titleBarOptions;
@@ -568,128 +554,25 @@ void QHtml5Compositor::drawTitlebarWindow(QHtml5TitleBarOptions tb, QPainter *pa
drawItemPixmap(painter, ir, Qt::AlignCenter, pixmap);
} //SC_TitleBarMaxButton
-// QHtml5TitleBarOptions tool = tb;
-// tool.rect = ir;
-// tool.state = down ? State_Sunken : State_Raised;
-
- // FIXME
-
- // painter->save();
- // if (down)
- // painter->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget),
- // proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget));
-
- // painter->restore();
- // }
-
- // if (tb->subControls & SC_TitleBarMinButton
- // && tb->titleBarFlags & Qt::WindowMinimizeButtonHint
- // && !(tb->titleBarState & Qt::WindowMinimized)) {
- // ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarMinButton, widget);
- // down = tb->activeSubControls & SC_TitleBarMinButton && (opt->state & State_Sunken);
- // pm = proxy()->standardIcon(SP_TitleBarMinButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
- // tool.rect = ir;
- // tool.state = down ? State_Sunken : State_Raised;
- // proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
-
- // painter->save();
- // if (down)
- // painter->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget),
- // proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget));
- // proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm);
- // painter->restore();
- // }
-
- bool drawNormalButton = (tb.subControls & SC_TitleBarNormalButton)
- && (((tb.flags & Qt::WindowMinimizeButtonHint)
- && (tb.flags & Qt::WindowMinimized))
- || ((tb.flags & Qt::WindowMaximizeButtonHint)
- && (tb.flags & Qt::WindowMaximized)));
-
- if (drawNormalButton) {
- ir = titlebarRect(tb, SC_TitleBarNormalButton);
- down = tb.subControls & SC_TitleBarNormalButton && (tb.state & State_Sunken);
- pixmap = cachedPixmapFromXPM(qt_normalizeup_xpm).scaled( QSize(10, 10));
-
-// tool.rect = ir;
-// tool.state = down ? State_Sunken : State_Raised;
- drawItemPixmap(painter, ir, Qt::AlignCenter, pixmap);
-
- // painter->save();
- // if (down)
- // painter->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget),
- // proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget));
-
- // painter->restore();
- } // SC_TitleBarNormalButton
-
- // if (tb->subControls & SC_TitleBarShadeButton
- // && tb->titleBarFlags & Qt::WindowShadeButtonHint
- // && !(tb->titleBarState & Qt::WindowMinimized)) {
- // ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarShadeButton, widget);
- // down = (tb->activeSubControls & SC_TitleBarShadeButton && (opt->state & State_Sunken));
- // pm = proxy()->standardIcon(SP_TitleBarShadeButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
- // tool.rect = ir;
- // tool.state = down ? State_Sunken : State_Raised;
- // proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
- // painter->save();
- // if (down)
- // painter->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget),
- // proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget));
- // proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm);
- // painter->restore();
- // }
-
- // if (tb->subControls & SC_TitleBarUnshadeButton
- // && tb->titleBarFlags & Qt::WindowShadeButtonHint
- // && tb->titleBarState & Qt::WindowMinimized) {
- // ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarUnshadeButton, widget);
-
- // down = tb->activeSubControls & SC_TitleBarUnshadeButton && (opt->state & State_Sunken);
- // pm = proxy()->standardIcon(SP_TitleBarUnshadeButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
- // tool.rect = ir;
- // tool.state = down ? State_Sunken : State_Raised;
- // proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
- // painter->save();
- // if (down)
- // painter->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget),
- // proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget));
- // proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm);
- // painter->restore();
- // }
-
-
- // if (tb->subControls & SC_TitleBarContextHelpButton
- // && tb->titleBarFlags & Qt::WindowContextHelpButtonHint) {
- // ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarContextHelpButton, widget);
-
- // down = tb->activeSubControls & SC_TitleBarContextHelpButton && (opt->state & State_Sunken);
- // pm = proxy()->standardIcon(SP_TitleBarContextHelpButton, &tool, widget).pixmap(qt_getWindow(widget), QSize(10, 10));
- // tool.rect = ir;
- // tool.state = down ? State_Sunken : State_Raised;
- // proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget);
- // painter->save();
- // if (down)
- // painter->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget),
- // proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget));
- // proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm);
- // painter->restore();
- // }
-
- if (tb.subControls & SC_TitleBarSysMenu && tb.flags & Qt::WindowSystemMenuHint) {
- ir = titlebarRect(tb, SC_TitleBarSysMenu);
-// if (!tb.icon.isNull()) {
-// tb.icon.paint(p, ir);
-// } else {
- // int iconSize = proxy()->pixelMetric(PM_SmallIconSize, tb, widget);
- pixmap = cachedPixmapFromXPM(qt_menu_xpm).scaled(QSize(10, 10));
- // tool.rect = ir;
- // painter->save();
- drawItemPixmap(painter, ir, Qt::AlignCenter, pixmap);
- // painter->restore();
-// }
- }
- //}
+ bool drawNormalButton = (tb.subControls & SC_TitleBarNormalButton)
+ && (((tb.flags & Qt::WindowMinimizeButtonHint)
+ && (tb.flags & Qt::WindowMinimized))
+ || ((tb.flags & Qt::WindowMaximizeButtonHint)
+ && (tb.flags & Qt::WindowMaximized)));
+
+ if (drawNormalButton) {
+ ir = titlebarRect(tb, SC_TitleBarNormalButton);
+ down = tb.subControls & SC_TitleBarNormalButton && (tb.state & State_Sunken);
+ pixmap = cachedPixmapFromXPM(qt_normalizeup_xpm).scaled( QSize(10, 10));
+
+ drawItemPixmap(painter, ir, Qt::AlignCenter, pixmap);
+ } // SC_TitleBarNormalButton
+
+ if (tb.subControls & SC_TitleBarSysMenu && tb.flags & Qt::WindowSystemMenuHint) {
+ ir = titlebarRect(tb, SC_TitleBarSysMenu);
+ pixmap = cachedPixmapFromXPM(qt_menu_xpm).scaled(QSize(10, 10));
+ drawItemPixmap(painter, ir, Qt::AlignCenter, pixmap);
+ }
}
void QHtml5Compositor::drawShadePanel(QHtml5TitleBarOptions options, QPainter *painter)
@@ -705,7 +588,6 @@ void QHtml5Compositor::drawShadePanel(QHtml5TitleBarOptions options, QPainter *p
const qreal devicePixelRatio = painter->device()->devicePixelRatioF();
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
- // painter->save();
const qreal inverseScale = qreal(1) / devicePixelRatio;
painter->scale(inverseScale, inverseScale);
@@ -725,32 +607,26 @@ void QHtml5Compositor::drawShadePanel(QHtml5TitleBarOptions options, QPainter *p
if (fill->color() == light)
light = palette.midlight().color();
}
- QPen oldPen = painter->pen(); // save pen
+ QPen oldPen = painter->pen();
QVector<QLineF> lines;
lines.reserve(2*lineWidth);
- // if (sunken)
- // painter->setPen(shade);
- // else
painter->setPen(light);
int x1, y1, x2, y2;
int i;
x1 = x;
y1 = y2 = y;
- x2 = x+w-2;
- for (i=0; i<lineWidth; i++) { // top shadow
+ x2 = x + w - 2;
+ for (i = 0; i < lineWidth; i++) // top shadow
lines << QLineF(x1, y1++, x2--, y2++);
- }
+
x2 = x1;
- y1 = y+h-2;
- for (i=0; i<lineWidth; i++) { // left shado
+ y1 = y + h - 2;
+ for (i = 0; i < lineWidth; i++) // left shado
lines << QLineF(x1++, y1, x2++, y2--);
- }
+
painter->drawLines(lines);
lines.clear();
- // if (sunken)
- // painter->setPen(light);
- // else
painter->setPen(shade);
x1 = x;
y1 = y2 = y+h-1;
@@ -760,10 +636,10 @@ void QHtml5Compositor::drawShadePanel(QHtml5TitleBarOptions options, QPainter *p
}
x1 = x2;
y1 = y;
- y2 = y+h-lineWidth-1;
- for (i=0; i<lineWidth; i++) { // right shadow
+ y2 = y + h - lineWidth - 1;
+ for (i = 0; i < lineWidth; i++) // right shadow
lines << QLineF(x1--, y1++, x2--, y2);
- }
+
painter->drawLines(lines);
if (fill) // fill with fill color
painter->fillRect(x+lineWidth, y+lineWidth, w-lineWidth*2, h-lineWidth*2, *fill);
@@ -847,9 +723,6 @@ void QHtml5Compositor::notifyTopWindowChanged(QHtml5Window* window)
return;
}
- //if (keyWindow()->handle() == window)
- //return;
-
requestRedraw();
QWindowSystemInterface::handleWindowActivated(window->window());
}
diff --git a/src/plugins/platforms/html5/qhtml5compositor.h b/src/plugins/platforms/html5/qhtml5compositor.h
index e379a8ec6c..8ce3f1948a 100644
--- a/src/plugins/platforms/html5/qhtml5compositor.h
+++ b/src/plugins/platforms/html5/qhtml5compositor.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -46,7 +46,6 @@ class QHtml5Screen;
class QOpenGLContext;
class QOpenGLTextureBlitter;
-//
class QHtml5CompositedWindow
{
public:
@@ -93,8 +92,6 @@ public:
QPalette palette;
QString titleBarOptionsString;
QHtml5Compositor::SubControls subControls;
- // QFontMetrics fontMetrics;
- // Qt::LayoutDirection direction; ??
};
struct QHtml5FrameOptions {
@@ -105,7 +102,7 @@ public:
void setEnabled(bool enabled);
- void addWindow(QHtml5Window *window, QHtml5Window *parentWindow = 0);
+ void addWindow(QHtml5Window *window, QHtml5Window *parentWindow = nullptr);
void removeWindow(QHtml5Window *window);
void setScreen(QHtml5Screen *screen);
@@ -159,8 +156,6 @@ private:
QSize m_targetSize;
qreal m_targetDevicePixelRatio;
-////////////////////////
-
static QPalette makeWindowPalette();
void drawFrameWindow(QHtml5FrameOptions options, QPainter *painter);
diff --git a/src/plugins/platforms/html5/qhtml5cursor.cpp b/src/plugins/platforms/html5/qhtml5cursor.cpp
index 5514e2cc3f..20c6633acd 100644
--- a/src/plugins/platforms/html5/qhtml5cursor.cpp
+++ b/src/plugins/platforms/html5/qhtml5cursor.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5cursor.h b/src/plugins/platforms/html5/qhtml5cursor.h
index f423338953..fdf8abae0d 100644
--- a/src/plugins/platforms/html5/qhtml5cursor.h
+++ b/src/plugins/platforms/html5/qhtml5cursor.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5eventdispatcher.cpp b/src/plugins/platforms/html5/qhtml5eventdispatcher.cpp
index 1d1e647e5d..af698032f2 100644
--- a/src/plugins/platforms/html5/qhtml5eventdispatcher.cpp
+++ b/src/plugins/platforms/html5/qhtml5eventdispatcher.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5eventdispatcher.h b/src/plugins/platforms/html5/qhtml5eventdispatcher.h
index dc2b65857a..95aacb7d2e 100644
--- a/src/plugins/platforms/html5/qhtml5eventdispatcher.h
+++ b/src/plugins/platforms/html5/qhtml5eventdispatcher.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5eventtranslator.cpp b/src/plugins/platforms/html5/qhtml5eventtranslator.cpp
index 1f670ed278..b6113f3fdb 100644
--- a/src/plugins/platforms/html5/qhtml5eventtranslator.cpp
+++ b/src/plugins/platforms/html5/qhtml5eventtranslator.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -150,7 +150,6 @@ Qt::Key QHtml5EventTranslator::translateEmscriptKey(const EmscriptenKeyboardEven
if (outAlphanumeric)
*outAlphanumeric = false;
- //TODO handle extended alphanumeric keys e.g. EU accents, etc
switch (emscriptKey->keyCode) {
case KeyMultiply: qtKey = Qt::Key_Asterisk; *outAlphanumeric = true; break;
case KeyAdd: qtKey = Qt::Key_Plus; *outAlphanumeric = true; break;
@@ -384,7 +383,7 @@ void QHtml5EventTranslator::processMouse(int eventType, const EmscriptenMouseEve
oldWindow->injectMouseReleased(localPoint, point, button, modifiers);
}
break;
- case 8://move //drag event?
+ case 8://move //drag event
{
if (resizeMode == QHtml5Window::ResizeNone && draggedWindow) {
draggedWindow->setX(draggedWindow->x() + mouseEvent->movementX);
diff --git a/src/plugins/platforms/html5/qhtml5eventtranslator.h b/src/plugins/platforms/html5/qhtml5eventtranslator.h
index e39855e2c2..d9a3b9039a 100644
--- a/src/plugins/platforms/html5/qhtml5eventtranslator.h
+++ b/src/plugins/platforms/html5/qhtml5eventtranslator.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5fontdatabase.cpp b/src/plugins/platforms/html5/qhtml5fontdatabase.cpp
index 303c91667e..43d2c9eb53 100644
--- a/src/plugins/platforms/html5/qhtml5fontdatabase.cpp
+++ b/src/plugins/platforms/html5/qhtml5fontdatabase.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5fontdatabase.h b/src/plugins/platforms/html5/qhtml5fontdatabase.h
index 4bd23ada15..53ce952663 100644
--- a/src/plugins/platforms/html5/qhtml5fontdatabase.h
+++ b/src/plugins/platforms/html5/qhtml5fontdatabase.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5integration.cpp b/src/plugins/platforms/html5/qhtml5integration.cpp
index 67f3b9467c..f5945744f8 100644
--- a/src/plugins/platforms/html5/qhtml5integration.cpp
+++ b/src/plugins/platforms/html5/qhtml5integration.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -94,13 +94,13 @@ void emscriptenOutput(QtMsgType type, const QMessageLogContext &context, const Q
}
QHtml5Integration::QHtml5Integration()
- : mFontDb(0),
+ : mFontDb(nullptr),
mCompositor(new QHtml5Compositor),
mScreen(new QHtml5Screen(mCompositor)),
- m_eventDispatcher(0)
+ m_eventDispatcher(nullptr)
{
qSetMessagePattern(QString("(%{function}:%{line}) - %{message}"));
- // qInstallMessageHandler(emscriptenOutput);
+ qInstallMessageHandler(emscriptenOutput);
globalHtml5Integration = this;
@@ -109,9 +109,7 @@ QHtml5Integration::QHtml5Integration()
emscripten_set_resize_callback(0, (void *)this, 1, uiEvent_cb);
m_eventTranslator = new QHtml5EventTranslator();
-#ifdef QEGL_EXTRA_DEBUG
- qWarning("QHtml5Integration\n");
-#endif
+
EM_ASM(// exit app if browser closes
window.onbeforeunload = function () {
Module.browserBeforeUnload();
@@ -148,10 +146,6 @@ bool QHtml5Integration::hasCapability(QPlatformIntegration::Capability cap) cons
QPlatformWindow *QHtml5Integration::createPlatformWindow(QWindow *window) const
{
-#ifdef QEGL_EXTRA_DEBUG
- qWarning("QHtml5Integration::createPlatformWindow %p\n",window);
-#endif
-
QHtml5Window *w = new QHtml5Window(window, mCompositor, m_backingStores.value(window));
w->create();
@@ -160,9 +154,6 @@ QPlatformWindow *QHtml5Integration::createPlatformWindow(QWindow *window) const
QPlatformBackingStore *QHtml5Integration::createPlatformBackingStore(QWindow *window) const
{
-//#ifdef QEGL_EXTRA_DEBUG
- qWarning("QHtml5Integration::createWindowSurface %p\n", window);
-//#endif
#ifndef QT_NO_OPENGL
QHtml5BackingStore *backingStore = new QHtml5BackingStore(mCompositor, window);
m_backingStores.insert(window, backingStore);
diff --git a/src/plugins/platforms/html5/qhtml5integration.h b/src/plugins/platforms/html5/qhtml5integration.h
index 7c6373c9f7..727f9ee72b 100644
--- a/src/plugins/platforms/html5/qhtml5integration.h
+++ b/src/plugins/platforms/html5/qhtml5integration.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5openglcontext.cpp b/src/plugins/platforms/html5/qhtml5openglcontext.cpp
index 46185e22a7..16fe73f935 100644
--- a/src/plugins/platforms/html5/qhtml5openglcontext.cpp
+++ b/src/plugins/platforms/html5/qhtml5openglcontext.cpp
@@ -34,7 +34,7 @@
QT_BEGIN_NAMESPACE
QHtml5OpenGLContext::QHtml5OpenGLContext(const QSurfaceFormat &format)
- :m_requestedFormat(format)
+ : m_requestedFormat(format)
{
m_requestedFormat.setRenderableType(QSurfaceFormat::OpenGLES);
}
diff --git a/src/plugins/platforms/html5/qhtml5screen.cpp b/src/plugins/platforms/html5/qhtml5screen.cpp
index f15b70ba29..b0f64044a4 100644
--- a/src/plugins/platforms/html5/qhtml5screen.cpp
+++ b/src/plugins/platforms/html5/qhtml5screen.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5screen.h b/src/plugins/platforms/html5/qhtml5screen.h
index f50e2572b8..d3b81f234e 100644
--- a/src/plugins/platforms/html5/qhtml5screen.h
+++ b/src/plugins/platforms/html5/qhtml5screen.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5stylepixmaps_p.h b/src/plugins/platforms/html5/qhtml5stylepixmaps_p.h
index c7ee424281..809fb8e5af 100644
--- a/src/plugins/platforms/html5/qhtml5stylepixmaps_p.h
+++ b/src/plugins/platforms/html5/qhtml5stylepixmaps_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/html5/qhtml5window.cpp b/src/plugins/platforms/html5/qhtml5window.cpp
index 3a82258a9b..7c4546a0e6 100644
--- a/src/plugins/platforms/html5/qhtml5window.cpp
+++ b/src/plugins/platforms/html5/qhtml5window.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -80,11 +80,6 @@ void QHtml5Window::create()
rect.setHeight(qBound(1, rect.height(), 2000));
} else if (minimumSize.width() > 0 || minimumSize.height() > 0) {
rect.setSize(minimumSize);
- } else {
- /*
- rect.setWidth(QHighDpi::toNativePixels(int(defaultWindowWidth), platformScreen->QPlatformScreen::screen()));
- rect.setHeight(QHighDpi::toNativePixels(int(defaultWindowHeight), platformScreen->QPlatformScreen::screen()));
- */
}
setWindowState(window()->windowStates());
@@ -377,12 +372,10 @@ void QHtml5Window::setWindowState(Qt::WindowStates states)
mWindowState = Qt::WindowNoState;
if (states & Qt::WindowMinimized)
mWindowState = Qt::WindowMinimized;
-#warning FIXME ShowFullScreen
- else if (states & Qt::WindowFullScreen) // someone sets this initially as default
+ else if (states & Qt::WindowFullScreen)
mWindowState = Qt::WindowFullScreen;
else if (states & Qt::WindowMaximized)
mWindowState = Qt::WindowMaximized;
-// update?
}
QRect QHtml5Window::normalGeometry() const
diff --git a/src/plugins/platforms/html5/qhtml5window.h b/src/plugins/platforms/html5/qhtml5window.h
index 1c44efd526..709cb6c910 100644
--- a/src/plugins/platforms/html5/qhtml5window.h
+++ b/src/plugins/platforms/html5/qhtml5window.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -56,7 +56,7 @@ public:
ResizeLeft
};
- QHtml5Window(QWindow *w, QHtml5Compositor* compositor, QHtml5BackingStore *backingStore);
+ QHtml5Window(QWindow *w, QHtml5Compositor *compositor, QHtml5BackingStore *backingStore);
~QHtml5Window();
void create();