Lucie Gérard ff1039c217 Change license for tests files
According to QUIP-18 [1], all tests file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-02-04 09:56:42 +01:00

64 lines
1.6 KiB
C++

// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "tabswidget.h"
GeneralTab::GeneralTab(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout();
layout->setSizeConstraint(QLayout::SetMaximumSize);
layout->addWidget(new QLabel("This is a text label"));
QPushButton *btn = new QPushButton("This is a push button");
layout->addWidget(btn);
connect(btn, &QPushButton::released, this, [=] () {
btn->setText("You clicked me");
});
layout->addWidget(new QCheckBox("This is a check box"));
layout->addWidget(new QRadioButton("Radio 1"));
layout->addWidget(new QRadioButton("Radio 2"));
QSlider *slider = new QSlider(Qt::Horizontal);
slider->setTickInterval(10);
slider->setTickPosition(QSlider::TicksAbove);
layout->addWidget(slider);
QSpinBox *spin = new QSpinBox();
spin->setValue(10);
spin->setSingleStep(1);
layout->addWidget(spin);
layout->addStretch();
QScrollBar *scrollBar = new QScrollBar(Qt::Horizontal);
scrollBar->setFocusPolicy(Qt::StrongFocus);
layout->addWidget(scrollBar);
setLayout(layout);
}
EditViewTab::EditViewTab(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout *layout = new QVBoxLayout();
layout->setSizeConstraint(QLayout::SetMaximumSize);
textEdit = new QPlainTextEdit();
textEdit->setPlaceholderText("Enter Text here");
layout->addWidget(textEdit);
setLayout(layout);
}
void EditViewTab::showEvent( QShowEvent* event ) {
if (!b_connected)
{
emit connectToToolBar();
b_connected=true;
}
QWidget::showEvent( event );
}