qt5base-lts/tests/manual/examples/widgets/wiggly/dialog.cpp
Paul Olav Tvete 52150469a8 Resurrect wiggly example as a manual test
In addition to being an iconic part of Qt's history, wiggly is also
widely used for verifying on embedded hardware.

Change-Id: Ica86626d98ade2570eebe787860293380c21f96a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-02-08 09:35:56 +01:00

28 lines
689 B
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "dialog.h"
#include "wigglywidget.h"
#include <QLineEdit>
#include <QVBoxLayout>
//! [0]
Dialog::Dialog(QWidget *parent)
: QDialog(parent)
{
WigglyWidget *wigglyWidget = new WigglyWidget;
QLineEdit *lineEdit = new QLineEdit;
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(wigglyWidget);
layout->addWidget(lineEdit);
connect(lineEdit, &QLineEdit::textChanged, wigglyWidget, &WigglyWidget::setText);
lineEdit->setText(u8"🖖 " + tr("Hello world!"));
setWindowTitle(tr("Wiggly"));
resize(360, 145);
}
//! [0]