diff options
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/diaglib/textdump.cpp | 3 | ||||
-rw-r--r-- | tests/manual/highdpi/highdpi.pro | 1 | ||||
-rw-r--r-- | tests/manual/highdpi/main.cpp | 89 | ||||
-rw-r--r-- | tests/manual/lance/main.cpp | 13 | ||||
-rw-r--r-- | tests/manual/manual.pro | 1 | ||||
-rw-r--r-- | tests/manual/qtexttableborders/main.cpp | 39 | ||||
-rw-r--r-- | tests/manual/qtexttableborders/qtexttableborders.pro | 10 | ||||
-rw-r--r-- | tests/manual/qtexttableborders/resources.qrc | 6 | ||||
-rw-r--r-- | tests/manual/qtexttableborders/table-border-test-header.html | 129 | ||||
-rw-r--r-- | tests/manual/qtexttableborders/table-border-test.html | 171 | ||||
-rw-r--r-- | tests/manual/qtexttableborders/widget.cpp | 125 | ||||
-rw-r--r-- | tests/manual/qtexttableborders/widget.h | 56 | ||||
-rw-r--r-- | tests/manual/qtexttableborders/widget.ui | 79 | ||||
-rw-r--r-- | tests/manual/rhi/shared/examplefw.h | 3 | ||||
-rw-r--r-- | tests/manual/rhi/triquadcube/triquadcube.cpp | 5 | ||||
-rw-r--r-- | tests/manual/textrendering/glyphshaping/main.cpp | 2 |
16 files changed, 716 insertions, 16 deletions
diff --git a/tests/manual/diaglib/textdump.cpp b/tests/manual/diaglib/textdump.cpp index 8bb899783b..383ec4edb0 100644 --- a/tests/manual/diaglib/textdump.cpp +++ b/tests/manual/diaglib/textdump.cpp @@ -44,6 +44,9 @@ static const EnumLookup specialCharactersEnumLookup[] = #if QT_VERSION >= 0x050000 {QChar::Tabulation, "Tabulation"}, {QChar::LineFeed, "LineFeed"}, +# if QT_VERSION >= 0x050e00 + {QChar::FormFeed, "FormFeed"}, +# endif {QChar::CarriageReturn, "CarriageReturn"}, {QChar::Space, "Space"}, #endif diff --git a/tests/manual/highdpi/highdpi.pro b/tests/manual/highdpi/highdpi.pro index 9db083cd82..2de8ed3bb5 100644 --- a/tests/manual/highdpi/highdpi.pro +++ b/tests/manual/highdpi/highdpi.pro @@ -15,3 +15,4 @@ HEADERS += \ RESOURCES += \ highdpi.qrc +DEFINES += HAVE_SCREEN_BASE_DPI diff --git a/tests/manual/highdpi/main.cpp b/tests/manual/highdpi/main.cpp index 7225587ac0..8884c5feed 100644 --- a/tests/manual/highdpi/main.cpp +++ b/tests/manual/highdpi/main.cpp @@ -37,10 +37,12 @@ #include <QPushButton> #include <QButtonGroup> #include <QLineEdit> +#include <QPlainTextEdit> #include <QScrollBar> #include <QSlider> #include <QSpinBox> #include <QTabBar> +#include <QTextBrowser> #include <QIcon> #include <QPainter> #include <QWindow> @@ -55,9 +57,16 @@ #include <QCommandLineOption> #include <QDebug> #include <private/qhighdpiscaling_p.h> +#include <qpa/qplatformscreen.h> #include "dragwidget.h" +static QTextStream &operator<<(QTextStream &str, const QRect &r) +{ + str << r.width() << 'x' << r.height() << forcesign << r.x() << r.y() << noforcesign; + return str; +} + class DemoContainerBase { public: @@ -1176,6 +1185,85 @@ public: } }; +class MetricsTest : public QWidget +{ + QPlainTextEdit *m_textEdit; + +public: + MetricsTest() + { + qDebug() << R"( +MetricsTest +Relevant environment variables are: +QT_FONT_DPI=N +QT_SCALE_FACTOR=n +QT_ENABLE_HIGHDPI_SCALING=0|1 +QT_USE_PHYSICAL_DPI=0|1 +QT_SCREEN_SCALE_FACTORS=N;N;N or QT_SCREEN_SCALE_FACTORS=name:N +QT_SCALE_FACTOR_ROUNDING_POLICY=Round|Ceil|Floor|RoundPreferFloor|PassThrough +QT_DPI_ADJUSTMENT_POLICY=AdjustDpi|DontAdjustDpi|AdjustUpOnly)"; + + resize(480, 360); + + QVBoxLayout *layout = new QVBoxLayout(); + setLayout(layout); + + m_textEdit = new QPlainTextEdit; + m_textEdit->setReadOnly(true); + layout->addWidget(m_textEdit); + } + + void updateMetrics() + { + QString text; + QTextStream str(&text); + + auto currentScreen = windowHandle()->screen(); + const auto screens = QGuiApplication::screens(); + for (int i = 0, size = screens.size(); i < size; ++i) { + auto screen = screens.at(i); + auto platformScreen = screen->handle(); + str << "Screen #" << i << " \"" << screen->name() << '"'; + if (screen == currentScreen) + str << " [current]"; + if (screen == QGuiApplication::primaryScreen()) + str << " [primary]"; + str << "\n screen geometry: " << screen->geometry() + << "\n platform screen geometry: " << platformScreen->geometry() + << "\n platform screen logicalDpi: " << platformScreen->logicalDpi().first; + +#ifdef HAVE_SCREEN_BASE_DPI + str << "\n platform screen logicalBaseDpi: " << platformScreen->logicalBaseDpi().first; +#endif + str << "\n platform screen devicePixelRatio: " <<platformScreen->devicePixelRatio() + << "\n platform screen physicalDpi: " << screen->physicalDotsPerInch() + << "\n\n"; + } + + str << "widget devicePixelRatio: " << this->devicePixelRatioF() + << "\nwidget logicalDpi: " << this->logicalDpiX() + << "\n\nQT_FONT_DPI: " << qgetenv("QT_FONT_DPI") + << "\nQT_SCALE_FACTOR: " << qgetenv("QT_SCALE_FACTOR") + << "\nQT_ENABLE_HIGHDPI_SCALING: " << qgetenv("QT_ENABLE_HIGHDPI_SCALING") + << "\nQT_SCREEN_SCALE_FACTORS: " << qgetenv("QT_SCREEN_SCALE_FACTORS") + << "\nQT_USE_PHYSICAL_DPI: " << qgetenv("QT_USE_PHYSICAL_DPI") + << "\nQT_SCALE_FACTOR_ROUNDING_POLICY: " << qgetenv("QT_SCALE_FACTOR_ROUNDING_POLICY") + << "\nQT_DPI_ADJUSTMENT_POLICY: " << qgetenv("QT_DPI_ADJUSTMENT_POLICY") + << '\n'; + + m_textEdit->setPlainText(text); + } + + void paintEvent(QPaintEvent *ev) + { + // We get a paint event on screen change, so this is a convenient place + // to update the metrics, at the possible risk of doing something else + // than painting in a paint event. + updateMetrics(); + QWidget::paintEvent(ev); + } +}; + int main(int argc, char **argv) { QApplication app(argc, argv); @@ -1212,6 +1300,7 @@ int main(int argc, char **argv) demoList << new DemoContainer<ScreenDisplayer>("screens", "Test screen and window positioning"); demoList << new DemoContainer<PhysicalSizeTest>("physicalsize", "Test manual highdpi support using physicalDotsPerInch"); demoList << new DemoContainer<GraphicsViewCaching>("graphicsview", "Test QGraphicsView caching"); + demoList << new DemoContainer<MetricsTest>("metrics", "Show display metrics"); foreach (DemoContainerBase *demo, demoList) parser.addOption(demo->option()); diff --git a/tests/manual/lance/main.cpp b/tests/manual/lance/main.cpp index 7f5af2d908..6dc5e2076a 100644 --- a/tests/manual/lance/main.cpp +++ b/tests/manual/lance/main.cpp @@ -334,20 +334,7 @@ int main(int argc, char **argv) checkers_background = false; } } else { -#if 0 // Used to be included in Qt4 for Q_WS_WIN - QString input = QString::fromLocal8Bit(argv[i]); - if (input.indexOf('*') >= 0) { - QFileInfo info(input); - QDir dir = info.dir(); - QFileInfoList infos = dir.entryInfoList(QStringList(info.fileName())); - for (int ii=0; ii<infos.size(); ++ii) - files.append(infos.at(ii).absoluteFilePath()); - } else { - files.append(input); - } -#else files.append(QString(argv[i])); -#endif } } scaledWidth = int(width * scalefactor); diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro index e688546374..42f9878e44 100644 --- a/tests/manual/manual.pro +++ b/tests/manual/manual.pro @@ -35,6 +35,7 @@ qsslsocket \ qsysinfo \ qtabletevent \ qtexteditlist \ +qtexttableborders \ qtbug-8933 \ qtbug-52641 \ qtouchevent \ diff --git a/tests/manual/qtexttableborders/main.cpp b/tests/manual/qtexttableborders/main.cpp new file mode 100644 index 0000000000..a8fdf7becc --- /dev/null +++ b/tests/manual/qtexttableborders/main.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "widget.h" +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + Widget w; + w.show(); + + return a.exec(); +} diff --git a/tests/manual/qtexttableborders/qtexttableborders.pro b/tests/manual/qtexttableborders/qtexttableborders.pro new file mode 100644 index 0000000000..7e454f978d --- /dev/null +++ b/tests/manual/qtexttableborders/qtexttableborders.pro @@ -0,0 +1,10 @@ +#This project can be used to verify QTBUG-36152 case. +QT += core gui printsupport +CONFIG += c++11 +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +TARGET = qtexttableborders +TEMPLATE = app +SOURCES += main.cpp widget.cpp +HEADERS += widget.h +FORMS += widget.ui +RESOURCES += resources.qrc diff --git a/tests/manual/qtexttableborders/resources.qrc b/tests/manual/qtexttableborders/resources.qrc new file mode 100644 index 0000000000..a7000a73e3 --- /dev/null +++ b/tests/manual/qtexttableborders/resources.qrc @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/"> + <file>table-border-test-header.html</file> + <file>table-border-test.html</file> + </qresource> +</RCC> diff --git a/tests/manual/qtexttableborders/table-border-test-header.html b/tests/manual/qtexttableborders/table-border-test-header.html new file mode 100644 index 0000000000..cb29d0a41d --- /dev/null +++ b/tests/manual/qtexttableborders/table-border-test-header.html @@ -0,0 +1,129 @@ +<html> + <body> + + <h2>Printable table with repeated header</h2> + + <p> + Please print (to PDF, save the trees) this table and compare this to the + print results of Chrome/Firefox. + <ul> + <li>Firefox fails to render the first repeated header correctly + <li>Chrome fails to render the Cell B top edge (should be red, except the first row after header + <li>Qt: Could do slightly better with the last row on each page (although both Firefox and Chrome don't work perfect here as well) + </ul> + </p> + + <table border=1 bordercolor="#aaaaaa" style="border-collapse:collapse"> + <thead> + <tr> + <th style="border-bottom: 1px solid blue">Header A</th> + <th style="border-bottom: 4px solid blue">Header B</th> + </tr> + </thead> + <tbody> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr> + </tbody> + </table> + + </body> +</html> diff --git a/tests/manual/qtexttableborders/table-border-test.html b/tests/manual/qtexttableborders/table-border-test.html new file mode 100644 index 0000000000..0339f80d0f --- /dev/null +++ b/tests/manual/qtexttableborders/table-border-test.html @@ -0,0 +1,171 @@ +<html> + <body> + + <h1>Working Test Cases</h1> + + <h2>border-collapse: separate</h2> + + <h3>TC-A1: table no border</h3> + <table> + <tbody> + <tr> + <td>Cell 1A</td> + <td>Cell 1B</td> + </tr> + </tbody> + </table> + + <h3>TC-A2: table attribute controlled border (1px, red)</h3> + <table border=1 bordercolor="red"> + <tbody> + <tr> + <td>Cell 1A</td> + <td>Cell 1B</td> + </tr> + </tbody> + </table> + + <h3>TC-A3: table attribute controlled border (4px, blue)</h3> + <table border=4 bordercolor="blue"> + <tbody> + <tr> + <td>Cell 1A</td> + <td>Cell 1B</td> + </tr> + </tbody> + </table> + Note: Real browsers render the inner cells border with 1px, but QTextDocument's rendering has always been like this. + + <h2>border-collapse: collapse</h2> + + <h3>TC-B1: table no border</h3> + <table style="border-collapse: collapse"> + <tbody> + <tr> + <td>Cell 1A</td> + <td>Cell 1B</td> + </tr> + </tbody> + </table> + + <h3>TC-B2: table attribute + css controlled grid (outer border 1px)</h3> + <table border=1 bordercolor="red" style="border-collapse: collapse"> + <tbody> + <tr> + <td>Cell 1A</td> + <td>Cell 1B</td> + </tr> + </tbody> + </table> + + <h3>TC-B3: table attribute + css controlled grid (outer border 4px)</h3> + <table border=4 bordercolor="red" style="border-collapse: collapse"> + <tbody> + <tr> + <td>Cell 1A</td> + <td>Cell 1B</td> + </tr> + </tbody> + </table> + + <h3>TC-B4: table attribute + css controlled grid (one cell with custom edge)</h3> + <table border=4 bordercolor="red" style="border-collapse: collapse"> + <tbody> + <tr> + <td>Cell 1A</td> + <td style="border-right: 8px solid green">Cell 1B (border-right: 8px solid green)</td> + </tr> + </tbody> + </table> + + <h3>TC-B5: table with single decorated cell</h3> + <table style="border-collapse: collapse"> + <tbody> + <tr> + <td>Cell 1A</td> + <td style="border: 2px solid red">Cell 1B (border: 2px solid red)</td> + </tr> + </tbody> + </table> + + <h3>cells with competing rules</h3> + + <h4>TC-C1: vertical edge (pink, 6px) wins over horizontal edge (red|blue, 6px)</h4> + <table border=1 bordercolor="#999999" style="border-collapse: collapse"> + <tbody> + <tr> + <td style="border-right: 4px solid green; border-bottom: 6px solid red">Cell 1A</td> + <td style="border-left: 6px solid pink; border-bottom: 6px solid blue">Cell 2B</td> + </tr> + </tbody> + </table> + + <h4>TC-C2: vertical edge (pink, 6px) loses over horizontal edge (red|blue, 8px)</h4> + <table border=1 bordercolor="#999999" style="border-collapse: collapse"> + <tbody> + <tr> + <td style="border-right: 4px solid green; border-bottom: 8px solid red">Cell 1A</td> + <td style="border-left: 6px solid pink; border-bottom: 8px solid blue">Cell 2B</td> + </tr> + </tbody> + </table> + + <h4>TC-C3: cells with span and competing rules</h4> + <table border=1 bordercolor="#999999" style="border-collapse: collapse"> + <tbody> + <tr> + <td colspan=2 style="border-bottom: 4px solid red">Cell 1A/B spans over two columns (border-bottom: red)</td> + </tr> + <tr> + <td style="border-top: 1px solid green">Cell 2A (border-top loses -> red)</td> + <td style="border-top: 10px solid green">Cell 2B (border-top wins -> green)</td> + </tr> + </tbody> + </table> + + <h1>Non-Working Test Cases</h1> + + <h2>border-collapse: separate</h2> + + <h3>TC-X1: table css border (red via style)</h3> + <table style="border: 1px solid red"> + <tbody> + <tr> + <td>Cell 1A</td> + <td>Cell 1B</td> + </tr> + </tbody> + </table> + + <h2>border-collapse: collapse</h2> + + <h3>TC-X2: tr css border</h3> + <table border=1 style="border-collapse: collapse"> + <tbody> + <tr style="border-bottom: 2px solid red"> + <td>Cell 1A (border-bottom should be red)</td> + <td>Cell 1B (border-bottom should be red)</td> + </tr> + <tr style="border-left: 2px solid red"> + <td>Cell 2A (border-left should be red)</td> + <td>Cell 2B</td> + </tr> + </tbody> + </table> + + <h3>TC-X3: cells with competing rules and colspan</h3> + <table border=1 bordercolor="#999999" style="border-collapse: collapse"> + <tbody> + <tr> + <td colspan=2 style="border-bottom: 4px solid red; border-right: 15px solid pink">Cell 1A/B spans over two columns (border-bottom: red, border-right pink)</td> + </tr> + <tr> + <td style="border-top: 1px solid green">Cell 2A (border-top loses -> red)</td> + <td style="border-top: 10px solid green">Cell 2B (border-top wins -> green)</td> + </tr> + </tbody> + </table> + This is currently not 100% correct but admittedly a constructed corner case (and Chrome failes here, too). + + </body> +</html> diff --git a/tests/manual/qtexttableborders/widget.cpp b/tests/manual/qtexttableborders/widget.cpp new file mode 100644 index 0000000000..21d958ce81 --- /dev/null +++ b/tests/manual/qtexttableborders/widget.cpp @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "widget.h" +#include "ui_widget.h" + +#include <QScrollBar> +#include <QFile> +#include <QDir> +#include <QTemporaryFile> + +#ifndef QT_NO_DESKTOPSERVICES +#include <QDesktopServices> +#endif + +#ifndef QT_NO_PRINTER +#include <QPrinter> +#include <QPrintDialog> +#include <QPrintPreviewDialog> +#endif + +// This manual test allows checking the QTextTable border logic (QTBUG-36152) + +Widget::Widget(QWidget *parent) : + QWidget(parent), + ui(new Ui::Widget) +{ + ui->setupUi(this); + resize(1400, 800); + + connect(ui->docComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &Widget::onDocumentSelected); + connect(ui->printButton, &QPushButton::clicked, this, &Widget::onPrint); + connect(ui->previewButton, &QPushButton::clicked, this, &Widget::onPreview); + connect(ui->openBrowserButton, &QPushButton::clicked, this, &Widget::onOpenBrowser); + + connect(ui->sourceEdit, &QTextEdit::textChanged, this, + [this]() { + // make this a world class HTML IDE + auto pos = ui->htmlEdit->verticalScrollBar()->value(); + ui->htmlEdit->setHtml(ui->sourceEdit->toPlainText()); + ui->htmlEdit->verticalScrollBar()->setValue(pos); + }); + + ui->docComboBox->addItem(tr("Table Border Test"), ":/table-border-test.html"); + ui->docComboBox->addItem(tr("Table Border Header Test"), ":/table-border-test-header.html"); + + ui->docComboBox->setCurrentIndex(0); +} + +Widget::~Widget() +{ + delete ui; +} + +void Widget::onDocumentSelected() +{ + QString url = ui->docComboBox->itemData(ui->docComboBox->currentIndex()).toString(); + QFile f(url); + if (f.open(QFile::ReadOnly)) { + ui->sourceEdit->setPlainText(QString::fromUtf8(f.readAll())); + // preview HTML is set via textChanged signal + } +} + +void Widget::onPrint() +{ +#ifndef QT_NO_PRINTER + QPrinter printer(QPrinter::HighResolution); + QPrintDialog dlg(&printer, this); + if (ui->htmlEdit->textCursor().hasSelection()) + dlg.addEnabledOption(QAbstractPrintDialog::PrintSelection); + dlg.setWindowTitle(tr("Print Document")); + if (dlg.exec() == QDialog::Accepted) { + ui->htmlEdit->print(&printer); + } +#endif +} + +void Widget::onPreview() +{ +#ifndef QT_NO_PRINTER + QPrinter printer(QPrinter::HighResolution); + QPrintPreviewDialog preview(&printer, this); + connect(&preview, &QPrintPreviewDialog::paintRequested, ui->htmlEdit, &QTextEdit::print); + preview.exec(); +#endif +} + +void Widget::onOpenBrowser() +{ + // write the current html to a temp file and open the system browser +#ifndef QT_NO_DESKTOPSERVICES + auto tf = new QTemporaryFile(QDir::tempPath() + "/XXXXXX.html", this); + if (tf->open()) { + tf->write(ui->sourceEdit->toPlainText().toUtf8()); + tf->close(); + QDesktopServices::openUrl(QUrl::fromLocalFile(tf->fileName())); + } +#endif +} diff --git a/tests/manual/qtexttableborders/widget.h b/tests/manual/qtexttableborders/widget.h new file mode 100644 index 0000000000..9cf459e1cd --- /dev/null +++ b/tests/manual/qtexttableborders/widget.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef WIDGET_H +#define WIDGET_H + +#include <QWidget> + +namespace Ui { +class Widget; +} + +class Widget : public QWidget +{ + Q_OBJECT + +public: + explicit Widget(QWidget *parent = nullptr); + ~Widget(); + +private slots: + void onDocumentSelected(); + void onPrint(); + void onPreview(); + void onOpenBrowser(); + +private: + Ui::Widget *ui; +}; + +#endif // WIDGET_H diff --git a/tests/manual/qtexttableborders/widget.ui b/tests/manual/qtexttableborders/widget.ui new file mode 100644 index 0000000000..95c23be69e --- /dev/null +++ b/tests/manual/qtexttableborders/widget.ui @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Widget</class> + <widget class="QWidget" name="Widget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>606</width> + <height>522</height> + </rect> + </property> + <property name="windowTitle"> + <string>QTextTable Border Manual Test</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QComboBox" name="docComboBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="printButton"> + <property name="text"> + <string>Print</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="previewButton"> + <property name="text"> + <string>Preview</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="openBrowserButton"> + <property name="text"> + <string>Open Browser</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QSplitter" name="splitter"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <widget class="QTextEdit" name="htmlEdit"/> + <widget class="QTextEdit" name="sourceEdit"/> + </widget> + </item> + </layout> + </widget> + <layoutdefault spacing="6" margin="11"/> + <tabstops> + <tabstop>docComboBox</tabstop> + <tabstop>printButton</tabstop> + <tabstop>previewButton</tabstop> + <tabstop>openBrowserButton</tabstop> + <tabstop>htmlEdit</tabstop> + </tabstops> + <resources/> + <connections/> +</ui> diff --git a/tests/manual/rhi/shared/examplefw.h b/tests/manual/rhi/shared/examplefw.h index 450aa172c2..1a29ef5f7e 100644 --- a/tests/manual/rhi/shared/examplefw.h +++ b/tests/manual/rhi/shared/examplefw.h @@ -124,6 +124,7 @@ QString graphicsApiName() QRhi::Flags rhiFlags = QRhi::EnableDebugMarkers; int sampleCount = 1; QRhiSwapChain::Flags scFlags = 0; +QRhi::BeginFrameFlags beginFrameFlags = 0; QRhi::EndFrameFlags endFrameFlags = 0; class Window : public QWindow @@ -375,7 +376,7 @@ void Window::render() // GPU/present, and that's what throttles the thread to the refresh rate. // (except for OpenGL where it happens either in endFrame or somewhere else // depending on the GL implementation) - QRhi::FrameOpResult r = m_r->beginFrame(m_sc); + QRhi::FrameOpResult r = m_r->beginFrame(m_sc, beginFrameFlags); if (r == QRhi::FrameOpSwapChainOutOfDate) { resizeSwapChain(); if (!m_hasSwapChain) diff --git a/tests/manual/rhi/triquadcube/triquadcube.cpp b/tests/manual/rhi/triquadcube/triquadcube.cpp index 4165e96127..76dbe558ab 100644 --- a/tests/manual/rhi/triquadcube/triquadcube.cpp +++ b/tests/manual/rhi/triquadcube/triquadcube.cpp @@ -71,6 +71,7 @@ //#define READBACK_SWAPCHAIN //#define NO_VSYNC //#define USE_MIN_SWAPCHAIN_BUFFERS +//#define DECLARE_EXT_CONTENTS struct { TriangleRenderer triRenderer; @@ -118,6 +119,10 @@ void preInit() scFlags |= QRhiSwapChain::MinimalBufferCount; #endif +#ifdef DECLARE_EXT_CONTENTS + beginFrameFlags |= QRhi::ExternalContentsInPass; +#endif + // For OpenGL some of these are incorporated into the QSurfaceFormat by // examplefw.h after returning from here as that is out of the RHI's control. } diff --git a/tests/manual/textrendering/glyphshaping/main.cpp b/tests/manual/textrendering/glyphshaping/main.cpp index c3acda953d..c1e49b3b7e 100644 --- a/tests/manual/textrendering/glyphshaping/main.cpp +++ b/tests/manual/textrendering/glyphshaping/main.cpp @@ -160,8 +160,6 @@ bool dumpHtml(const QString &pathName) QString platformName = QString::fromLatin1( #if defined(Q_OS_WIN) "Win32" -#elif 0 // Used to be included in Qt4 for Q_WS_X11 - "X11" #else "" #endif |