Use "auto" as type when initializing using "new"
The type is immediately visible from the right hand side then. Change-Id: Ifc1a15e3eea9b5a91ff8647f759d207a0ee221b8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
121de28e01
commit
91e7009aec
|
@ -63,10 +63,10 @@ MainWindow::MainWindow(bool transparency, bool noRenderAlpha)
|
||||||
m_transparent(transparency),
|
m_transparent(transparency),
|
||||||
m_noRenderAlpha(noRenderAlpha)
|
m_noRenderAlpha(noRenderAlpha)
|
||||||
{
|
{
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
auto *layout = new QVBoxLayout;
|
||||||
|
|
||||||
QGroupBox *groupBox = new QGroupBox(tr("Type"));
|
QGroupBox *groupBox = new QGroupBox(tr("Type"));
|
||||||
QVBoxLayout *vbox = new QVBoxLayout;
|
auto *vbox = new QVBoxLayout;
|
||||||
m_radioView = new QRadioButton(tr("QQuickView in a window container (direct)"));
|
m_radioView = new QRadioButton(tr("QQuickView in a window container (direct)"));
|
||||||
m_radioWidget = new QRadioButton(tr("QQuickWidget (indirect through framebuffer objects)"));
|
m_radioWidget = new QRadioButton(tr("QQuickWidget (indirect through framebuffer objects)"));
|
||||||
vbox->addWidget(m_radioWidget);
|
vbox->addWidget(m_radioWidget);
|
||||||
|
@ -161,7 +161,7 @@ void MainWindow::updateView()
|
||||||
QUrl source("qrc:qquickviewcomparison/test.qml");
|
QUrl source("qrc:qquickviewcomparison/test.qml");
|
||||||
|
|
||||||
if (m_state == UseWindow) {
|
if (m_state == UseWindow) {
|
||||||
QQuickView *quickView = new QQuickView;
|
auto *quickView = new QQuickView;
|
||||||
// m_transparent is not supported here since many systems have problems with semi-transparent child windows
|
// m_transparent is not supported here since many systems have problems with semi-transparent child windows
|
||||||
quickView->setFormat(m_format);
|
quickView->setFormat(m_format);
|
||||||
quickView->setResizeMode(QQuickView::SizeRootObjectToView);
|
quickView->setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
|
@ -171,7 +171,7 @@ void MainWindow::updateView()
|
||||||
m_currentRootObject = quickView->rootObject();
|
m_currentRootObject = quickView->rootObject();
|
||||||
switchTo(QWidget::createWindowContainer(quickView));
|
switchTo(QWidget::createWindowContainer(quickView));
|
||||||
} else if (m_state == UseWidget) {
|
} else if (m_state == UseWidget) {
|
||||||
QQuickWidget *quickWidget = new QQuickWidget;
|
auto *quickWidget = new QQuickWidget;
|
||||||
if (m_transparent)
|
if (m_transparent)
|
||||||
quickWidget->setClearColor(Qt::transparent);
|
quickWidget->setClearColor(Qt::transparent);
|
||||||
quickWidget->setFormat(m_format);
|
quickWidget->setFormat(m_format);
|
||||||
|
|
|
@ -139,7 +139,7 @@ QSGNode *BezierCurve::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
|
||||||
node->setGeometry(geometry);
|
node->setGeometry(geometry);
|
||||||
node->setFlag(QSGNode::OwnsGeometry);
|
node->setFlag(QSGNode::OwnsGeometry);
|
||||||
//! [5] //! [6]
|
//! [5] //! [6]
|
||||||
QSGFlatColorMaterial *material = new QSGFlatColorMaterial;
|
auto *material = new QSGFlatColorMaterial;
|
||||||
material->setColor(QColor(255, 0, 0));
|
material->setColor(QColor(255, 0, 0));
|
||||||
node->setMaterial(material);
|
node->setMaterial(material);
|
||||||
node->setFlag(QSGNode::OwnsMaterial);
|
node->setFlag(QSGNode::OwnsMaterial);
|
||||||
|
|
Loading…
Reference in New Issue