diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-09-02 09:43:41 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-09-02 12:16:45 +0200 |
| commit | 065766883f5e34d20ca88084cd747813a84ed2d3 (patch) | |
| tree | 2bca2c34d113f0198564155ac21789466d4b8b96 /tools/qtpy2cpp_lib/tests/baseline/basic_test.cpp | |
| parent | 4cfa700d5965922b5156517a64790369deac354f (diff) | |
Move qtpy2cpp to sources/pyside-tools
Preparing the entry point.
Task-number: PYSIDE-1945
Change-Id: I4a2fbe6d35b4f97bf0ab7cfc2085b86a40bc2558
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'tools/qtpy2cpp_lib/tests/baseline/basic_test.cpp')
| -rw-r--r-- | tools/qtpy2cpp_lib/tests/baseline/basic_test.cpp | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/tools/qtpy2cpp_lib/tests/baseline/basic_test.cpp b/tools/qtpy2cpp_lib/tests/baseline/basic_test.cpp deleted file mode 100644 index 8ee7be31e..000000000 --- a/tools/qtpy2cpp_lib/tests/baseline/basic_test.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -// Converted from basic_test.py -#include <QtCore/Qt> -#include <QtGui/QColor> -#include <QtGui/QPainter> -#include <QtGui/QPaintEvent> -#include <QtGui/QShortcut> -#include <QtWidgets/QApplication> -#include <QtWidgets/QWidget> - -class Window : public QWidget -{ -public: - - Window(QWidget * parent = nullptr) - { - super()->__init__(parent); - } - - void paintEvent(QPaintEvent * e) - { - paint("bla"); - } - - void paint(const QString & what, color = Qt::blue) - { - { // Converted from context manager - p = QPainter(); - p->setPen(QColor(color)); - rect = rect(); - w = rect->width(); - h = rect->height(); - p->drawLine(0, 0, w, h); - p->drawLine(0, h, w, 0); - p->drawText(rect->center(), what); - } - } - - void sum() - { - values = {1, 2, 3}; - result = 0; - for (v: values) { - result += v - } - return result; - } -}; - -int main(int argc, char *argv[]) -{ - QApplication app(sys->argv); - window = Window(); - auto *sc = new QShortcut((Qt::CTRL | Qt::Key_Q), window); - sc->activated->connect(window->close); - window->setWindowTitle("Test"); - window->show(); - sys->exit(app.exec()); - return 0; -} |
