Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
19.8k Topics 76.7k Posts
  • VTK integration issue in QML at runtime on Windows

    Solved
    2
    0 Votes
    2 Posts
    202 Views
    W

    This error appears because I was running a Debug target with a Release version of VTK. No problem if you link a Debug app with a Debug VTK or Release app with a Release VTK.

  • 0 Votes
    1 Posts
    96 Views
    No one has replied
  • Rotate QtQuick.Controls 2.x Dialog

    Solved
    11
    0 Votes
    11 Posts
    2k Views
    L

    @jpnurmi-0 said in Rotate QtQuick.Controls 2.x Dialog:

    Popups follow Window::contentOrientation that you can set to match the rotation that is applied on the content:

    import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 ApplicationWindow { id: window width: 640 height: 480 visible: true contentOrientation: listModel.get(comboBox.currentIndex).orientation contentItem.rotation: listModel.get(comboBox.currentIndex).rotation ComboBox { id: comboBox textRole: "text" anchors.centerIn: parent model: ListModel { id: listModel ListElement { text: "Portrait"; orientation: Qt.PortraitOrientation; rotation: 0 } ListElement { text: "Landscape"; orientation: Qt.LandscapeOrientation; rotation: 90 } ListElement { text: "Inverted Portrait"; orientation: Qt.InvertedPortraitOrientation; rotation: 180 } ListElement { text: "Inverted Landscape"; orientation: Qt.InvertedLandscapeOrientation; rotation: 270 } } } }

    This gets me really close, but I have two problems with the QML Drawer component. 1. When setting the edge property, the position is incorrect; 2. the "drag" directions are not rotated. Are there any solutions to these issues?

  • How to set paddings/indent for GridLayout

    Unsolved
    2
    0 Votes
    2 Posts
    156 Views
    SGaistS

    Hi and welcome to devnet,

    Are you thinking about setSpacing ?
    Or maybe setContentMargins ?

  • CMake 3.20.6 : missing dependency file

    Unsolved
    1
    0 Votes
    1 Posts
    96 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • BoxPlotSeries QML model in C++

    Solved
    5
    0 Votes
    5 Posts
    320 Views
    D

    Does anyone know how to set labels for BoxPlotSeries using VBoxPlotModelMapper? In the documentation the following is written:

    Each box-and-whiskers item contains data starting from row 1. The name of an item is defined by the column header.

    However, it is unclear to me what "column header" refers to in this context. I attempted to implement the headerData method, but it wasn't called. Any insights would be appreciated!

  • Qml 6 Bug on Window Restore from Task Bar

    Unsolved
    10
    0 Votes
    10 Posts
    662 Views
    J

    For info, and for people arriving from a web search, the Qt bug that was filed is here: https://bugreports.qt.io/browse/QTBUG-125037

  • Cannot assign to property of unknown type "QString".

    Unsolved
    3
    0 Votes
    3 Posts
    466 Views
    dheerendraD

    In addition what @Axel-Spoerl has already said, avoid using title, data as your properties. data is already as property in item. So confusing. Better use some other names.

  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    122 Views
  • 0 Votes
    6 Posts
    2k Views
    S

    For audio playlist management and cross-platform transfers, I highly recommend using MuzConvtool, which makes it easy to move playlists between these services without losing track of your favorite songs.

  • how to click on a 3D object?

    Unsolved
    3
    1 Votes
    3 Posts
    198 Views
    Anton1978A

    doesn't anyone know? it's sad

  • Drag and Drop support for TreeView

    Unsolved
    1
    0 Votes
    1 Posts
    160 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    15 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • What is the meaning of res in qrc path like res:/xxx.png?

    Unsolved
    2
    0 Votes
    2 Posts
    241 Views
    S

    resource?

  • QML Loader, passing arguments to source

    Solved
    13
    0 Votes
    13 Posts
    819 Views
    mzimmersM

    @GrecKo said in QML Loader, passing arguments to source:

    required properties can't work in Loader's components unless you call setSource

    Well, that's that. Looks like I'll be using setSource() after all; a Loader is better for my use case than a StackView.

    Thanks to all who looked at this.

  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • 0 Votes
    1 Posts
    106 Views
    No one has replied
  • 0 Votes
    7 Posts
    554 Views
    J

    Pl45m4,
    So, I created a new version of my project named: qml6_4_20_customcomps in a folder: Qt6.6.3 Quick Projects on my Desktop.

    It now has two errors, the first one is:

    C:\Users\JohnTrites\Desktop\Qt6.6.3 Quick Projects\qml6_4_20_customcomps\build\Desktop_Qt_6_6_3_MinGW_64_bit-Debug_deps\ds-build\src\imports\components\QuickStudioComponentsplugin_init_autogen\mocs_compilation.cpp:3: error: opening dependency file _deps\ds-build\src\imports\components\CMakeFiles\QuickStudioComponentsplugin_init.dir\9d777f3e334334a54a3cc379beec2ab9\mocs_compilation.cpp.obj.d: No such file or directory
    C:/Users/JohnTrites/Desktop/Qt6.6.3 Quick Projects/qml6_4_20_customcomps/build/Desktop_Qt_6_6_3_MinGW_64_bit-Debug/_deps/ds-build/src/imports/components/QuickStudioComponentsplugin_init_autogen/mocs_compilation.cpp:3:47: fatal error: opening dependency file _deps\ds-build\src\imports\components\CMakeFiles\QuickStudioComponentsplugin_init.dir\9d777f3e334334a54a3cc379beec2ab9\mocs_compilation.cpp.obj.d: No such file or directory
    3 | enum some_compilers { need_more_than_nothing };
    | ^
    So, I think it's looking for the QuickStudioComponentsplugin_init_autogen in the mocs compilation and can't find it.
    Is this plugin available in the Qt Maintenance Tool or is it a separate download to install from the Qt website?
    Or is there something else I'm missing?

    Btw, the demo Qt6.6.3 Quick examples run fine. An example of the calclatr example vs qml6_4_20_customcomps CMakeLists.txt files may provide more insight to the problem:

    qml6_4_20_customcomps CMakeLists.txt file:

    cmake_minimum_required(VERSION 3.21.1)

    option(LINK_INSIGHT "Link Qt Insight Tracker library" ON)
    option(BUILD_QDS_COMPONENTS "Build design studio components" ON)

    project(qml6_4_20_customcompsApp LANGUAGES CXX)

    set(CMAKE_AUTOMOC ON)

    find_package(Qt6 6.2 REQUIRED COMPONENTS Core Gui Qml Quick)

    if (Qt6_VERSION VERSION_GREATER_EQUAL 6.3)
    qt_standard_project_setup()
    endif()

    qt_add_executable(qml6_4_20_customcompsApp src/main.cpp)

    qt_add_resources(qml6_4_20_customcompsApp "configuration"
    PREFIX "/"
    FILES
    qtquickcontrols2.conf
    )

    target_link_libraries(qml6_4_20_customcompsApp PRIVATE
    Qt6::Core
    Qt6::Gui
    Qt6::Qml
    Qt6::Quick
    )

    set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml)
    set(QML_IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY}
    CACHE STRING "Import paths for Qt Creator's code model"
    FORCE
    )

    if (BUILD_QDS_COMPONENTS)
    include(${CMAKE_CURRENT_SOURCE_DIR}/qmlcomponents)
    endif()

    include(${CMAKE_CURRENT_SOURCE_DIR}/qmlmodules)

    if (LINK_INSIGHT)
    include(${CMAKE_CURRENT_SOURCE_DIR}/insight)
    endif ()

    include(GNUInstallDirs)
    install(TARGETS qml6_4_20_customcompsApp
    BUNDLE DESTINATION .
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    )

    make IDEs aware of the QML import path

    set(QML_IMPORT_PATH ${PROJECT_BINARY_DIR}/qml CACHE PATH
    "Path to the custom QML components defined by the project")

    calclatr CMakeLists.txt file

    cmake_minimum_required(VERSION 3.16)
    project(calqlatr LANGUAGES CXX)

    set(CMAKE_AUTOMOC ON)

    if(NOT DEFINED INSTALL_EXAMPLESDIR)
    set(INSTALL_EXAMPLESDIR "examples")
    endif()

    set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/calqlatr")

    find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick QuickControls2)

    qt_add_executable(calqlatrexample WIN32 MACOSX_BUNDLE
    main.cpp
    )

    target_link_libraries(calqlatrexample PRIVATE
    Qt6::Core
    Qt6::Gui
    Qt6::Qml
    Qt6::Quick
    Qt6::QuickControls2
    )

    qt_add_qml_module(calqlatrexample
    URI demos.calqlatr
    VERSION 1.0
    QML_FILES
    "calqlatr.qml"
    "content/Display.qml"
    "content/NumberPad.qml"
    "content/CalculatorButton.qml"
    "content/calculator.js"
    RESOURCES
    "content/images/paper-edge-left.png"
    "content/images/paper-edge-right.png"
    "content/images/paper-grip.png"
    RESOURCE_PREFIX /
    )
    if(ANDROID)
    set_target_properties(calqlatrexample
    PROPERTIES
    QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android
    QT_ANDROID_TARGET_SDK_VERSION "33")
    endif()
    if(IOS)
    set(asset_catalog_path "ios/Assets.xcassets")
    target_sources(calqlatrexample PRIVATE "${asset_catalog_path}")
    set_source_files_properties(${asset_catalog_path} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
    set_target_properties(calqlatrexample
    PROPERTIES XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon)
    endif()

    install(TARGETS calqlatrexample
    RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
    BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
    LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
    )

    Any recommendations? Thank you, JT