From a319a14da799d9762d0e51791bd281732554661b Mon Sep 17 00:00:00 2001 From: Santhosh Kumar Date: Fri, 15 Aug 2025 07:15:51 +0200 Subject: Rename flexboxlayout example directory in consistent with others Change-Id: Ie189960af25a33f0dee54fbd49213f9d5eab5891 Reviewed-by: Mitch Curtis (cherry picked from commit 5b21e3c72bbf41420735b921576b008f8a4062e6) Reviewed-by: Qt Cherry-pick Bot --- examples/quick/flexboxLayouts/CMakeLists.txt | 45 ------------------ examples/quick/flexboxLayouts/Main.qml | 69 ---------------------------- examples/quick/flexboxLayouts/main.cpp | 21 --------- examples/quick/flexboxlayout/CMakeLists.txt | 45 ++++++++++++++++++ examples/quick/flexboxlayout/Main.qml | 69 ++++++++++++++++++++++++++++ examples/quick/flexboxlayout/main.cpp | 21 +++++++++ 6 files changed, 135 insertions(+), 135 deletions(-) delete mode 100644 examples/quick/flexboxLayouts/CMakeLists.txt delete mode 100644 examples/quick/flexboxLayouts/Main.qml delete mode 100644 examples/quick/flexboxLayouts/main.cpp create mode 100644 examples/quick/flexboxlayout/CMakeLists.txt create mode 100644 examples/quick/flexboxlayout/Main.qml create mode 100644 examples/quick/flexboxlayout/main.cpp diff --git a/examples/quick/flexboxLayouts/CMakeLists.txt b/examples/quick/flexboxLayouts/CMakeLists.txt deleted file mode 100644 index cf6006dcb4..0000000000 --- a/examples/quick/flexboxLayouts/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2025 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -cmake_minimum_required(VERSION 3.16) - -project(flexboxlayoutexample VERSION 0.1 LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -find_package(Qt6 6.8 REQUIRED COMPONENTS Quick) - -qt_standard_project_setup(REQUIRES 6.8) - -qt_add_executable(appflexboxlayoutexample - main.cpp -) - -qt_add_qml_module(appflexboxlayoutexample - URI flexboxlayoutexample - VERSION 1.0 - QML_FILES - Main.qml -) - -# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. -# If you are developing for iOS or macOS you should consider setting an -# explicit, fixed bundle identifier manually though. -set_target_properties(appflexboxlayoutexample PROPERTIES -# MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appflexboxlayoutexample - MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} - MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} - MACOSX_BUNDLE TRUE - WIN32_EXECUTABLE TRUE -) - -target_link_libraries(appflexboxlayoutexample - PRIVATE Qt6::Quick -) - -include(GNUInstallDirs) -install(TARGETS appflexboxlayoutexample - BUNDLE DESTINATION . - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) diff --git a/examples/quick/flexboxLayouts/Main.qml b/examples/quick/flexboxLayouts/Main.qml deleted file mode 100644 index 83253f6743..0000000000 --- a/examples/quick/flexboxLayouts/Main.qml +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (C) 2025 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts -import QtQuick.Effects - -pragma ComponentBehavior: Bound - -ApplicationWindow { - id: window - visible: true - width: 480 - height: 640 - title: "QML Flexbox Layout" - - ColumnLayout { - id: content - property int count: 10 - anchors.fill: parent - Rectangle { - id: mainContent - Layout.preferredWidth: col.implicitWidth - Layout.preferredHeight: col.implicitHeight - Layout.fillWidth: true - Layout.fillHeight: true - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - clip: true - border.width: 1 - border.color: "gray" - color: "transparent" - ColumnLayout { - id: col - anchors.fill: parent - FlexboxLayout { - id: flex - wrap: FlexboxLayout.Wrap - gap: 10 - justifyContent: FlexboxLayout.JustifyCenter - Layout.margins: 20 - Repeater { - model: content.count - delegate: Rectangle { - id: rect - property int size: Math.floor(Math.random() * (140 - 85 + 1)) + 85 - Layout.preferredWidth: size - Layout.preferredHeight: size - radius: 10 - color: "#328930" - Text { - anchors.centerIn: parent - text: "Qt" - font.pixelSize: 20 - } - } - } - } - } - } - Text { - Layout.margins: 20 - Layout.alignment: Qt.AlignHCenter - text: "Resize the window to observe how the flex layout adapts." - Layout.fillWidth: true - wrapMode: Text.Wrap - } - } -} diff --git a/examples/quick/flexboxLayouts/main.cpp b/examples/quick/flexboxLayouts/main.cpp deleted file mode 100644 index a2cac9c6e2..0000000000 --- a/examples/quick/flexboxLayouts/main.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2025 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include -#include - -int main(int argc, char *argv[]) -{ - QGuiApplication app(argc, argv); - - QQmlApplicationEngine engine; - QObject::connect( - &engine, - &QQmlApplicationEngine::objectCreationFailed, - &app, - []() { QCoreApplication::exit(-1); }, - Qt::QueuedConnection); - engine.loadFromModule("flexboxlayoutexample", "Main"); - - return app.exec(); -} diff --git a/examples/quick/flexboxlayout/CMakeLists.txt b/examples/quick/flexboxlayout/CMakeLists.txt new file mode 100644 index 0000000000..cf6006dcb4 --- /dev/null +++ b/examples/quick/flexboxlayout/CMakeLists.txt @@ -0,0 +1,45 @@ +# Copyright (C) 2025 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) + +project(flexboxlayoutexample VERSION 0.1 LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(Qt6 6.8 REQUIRED COMPONENTS Quick) + +qt_standard_project_setup(REQUIRES 6.8) + +qt_add_executable(appflexboxlayoutexample + main.cpp +) + +qt_add_qml_module(appflexboxlayoutexample + URI flexboxlayoutexample + VERSION 1.0 + QML_FILES + Main.qml +) + +# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. +# If you are developing for iOS or macOS you should consider setting an +# explicit, fixed bundle identifier manually though. +set_target_properties(appflexboxlayoutexample PROPERTIES +# MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appflexboxlayoutexample + MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + MACOSX_BUNDLE TRUE + WIN32_EXECUTABLE TRUE +) + +target_link_libraries(appflexboxlayoutexample + PRIVATE Qt6::Quick +) + +include(GNUInstallDirs) +install(TARGETS appflexboxlayoutexample + BUNDLE DESTINATION . + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/examples/quick/flexboxlayout/Main.qml b/examples/quick/flexboxlayout/Main.qml new file mode 100644 index 0000000000..83253f6743 --- /dev/null +++ b/examples/quick/flexboxlayout/Main.qml @@ -0,0 +1,69 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Effects + +pragma ComponentBehavior: Bound + +ApplicationWindow { + id: window + visible: true + width: 480 + height: 640 + title: "QML Flexbox Layout" + + ColumnLayout { + id: content + property int count: 10 + anchors.fill: parent + Rectangle { + id: mainContent + Layout.preferredWidth: col.implicitWidth + Layout.preferredHeight: col.implicitHeight + Layout.fillWidth: true + Layout.fillHeight: true + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + clip: true + border.width: 1 + border.color: "gray" + color: "transparent" + ColumnLayout { + id: col + anchors.fill: parent + FlexboxLayout { + id: flex + wrap: FlexboxLayout.Wrap + gap: 10 + justifyContent: FlexboxLayout.JustifyCenter + Layout.margins: 20 + Repeater { + model: content.count + delegate: Rectangle { + id: rect + property int size: Math.floor(Math.random() * (140 - 85 + 1)) + 85 + Layout.preferredWidth: size + Layout.preferredHeight: size + radius: 10 + color: "#328930" + Text { + anchors.centerIn: parent + text: "Qt" + font.pixelSize: 20 + } + } + } + } + } + } + Text { + Layout.margins: 20 + Layout.alignment: Qt.AlignHCenter + text: "Resize the window to observe how the flex layout adapts." + Layout.fillWidth: true + wrapMode: Text.Wrap + } + } +} diff --git a/examples/quick/flexboxlayout/main.cpp b/examples/quick/flexboxlayout/main.cpp new file mode 100644 index 0000000000..a2cac9c6e2 --- /dev/null +++ b/examples/quick/flexboxlayout/main.cpp @@ -0,0 +1,21 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include +#include + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + QObject::connect( + &engine, + &QQmlApplicationEngine::objectCreationFailed, + &app, + []() { QCoreApplication::exit(-1); }, + Qt::QueuedConnection); + engine.loadFromModule("flexboxlayoutexample", "Main"); + + return app.exec(); +} -- cgit v1.2.3