using const methods
This commit is contained in:
parent
e0792beb5f
commit
3442542048
@ -59,7 +59,7 @@ GridQuick::GridQuick( QWidget* parent )
|
|||||||
createQml( "import QtQuick 2.0\nimport QtQuick.Layouts 1.1\nItem { GridLayout {} }" );
|
createQml( "import QtQuick 2.0\nimport QtQuick.Layouts 1.1\nItem { GridLayout {} }" );
|
||||||
setContent( QUrl(), nullptr, contentItem );
|
setContent( QUrl(), nullptr, contentItem );
|
||||||
|
|
||||||
m_grid = contentItem->childItems().first();
|
m_grid = contentItem->childItems().constFirst();
|
||||||
m_grid->setProperty( "rowSpacing", 5 );
|
m_grid->setProperty( "rowSpacing", 5 );
|
||||||
m_grid->setProperty( "columnSpacing", 5 );
|
m_grid->setProperty( "columnSpacing", 5 );
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ void GridQuick::insert( const QByteArray& colorName,
|
|||||||
*/
|
*/
|
||||||
auto layout = createQml( "import QtQuick 2.0\nimport QtQuick.Layouts 1.15\nGridLayout { Rectangle {} }" );
|
auto layout = createQml( "import QtQuick 2.0\nimport QtQuick.Layouts 1.15\nGridLayout { Rectangle {} }" );
|
||||||
|
|
||||||
auto rectangle = layout->childItems().first();
|
auto rectangle = layout->childItems().constFirst();
|
||||||
rectangle->setParent( nullptr );
|
rectangle->setParent( nullptr );
|
||||||
|
|
||||||
delete layout;
|
delete layout;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user