Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • Drag and Drop support for TreeView

    Unsolved
    1
    0 Votes
    1 Posts
    245 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
    330 Views
    S
    resource?
  • QML Loader, passing arguments to source

    Solved
    13
    0 Votes
    13 Posts
    2k 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
  • Missing types in QtQml even if I have imported QtQuick in Qt5.15.11 for Android

    Unsolved
    1
    0 Votes
    1 Posts
    148 Views
    No one has replied
  • Upgrading from Qt6.3.2 to Qt6.7.3 using Maintenance Tool not working for QML projects

    Unsolved
    7
    0 Votes
    7 Posts
    1k 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
  • QML project crashes in debug build, but not in release build.

    Unsolved
    1
    0 Votes
    1 Posts
    122 Views
    No one has replied
  • MapItemView and resizing

    Unsolved
    1
    0 Votes
    1 Posts
    143 Views
    No one has replied
  • Dynamically add point to LineSeries of QML Qt Graphs

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    W
    It's okay, it fixed itself ! The move to Qt6.8 has taken QtGraphs out of Technology Preview status, and functions like append(x,y) that weren't accessible in QML now are.
  • scintilla

    Unsolved
    6
    0 Votes
    6 Posts
    631 Views
    SGaistS
    I found a simpler way to do it, see the following: import pathlib import sys from PyQt5.QtGui import QFont, QFontMetrics, QColor from PyQt5.QtWidgets import QApplication from PyQt5.Qsci import QsciScintilla, QsciLexerPython class SimplePythonEditor(QsciScintilla): def __init__(self, parent=None): super().__init__(parent) # Set the default font font = QFont() font.setFamily("Courier") font.setFixedPitch(True) font.setPointSize(10) self.setFont(font) # Margin 0 is used for line numbers fontmetrics = QFontMetrics(font) self.setMarginsFont(font) self.setMarginWidth(0, fontmetrics.width("00000") + 6) self.setMarginLineNumbers(0, True) self.setMarginsBackgroundColor(QColor("#cccccc")) lexer = QsciLexerPython() lexer.setDefaultFont(font) self.setLexer(lexer) if __name__ == "__main__": app = QApplication(sys.argv) editor = SimplePythonEditor() editor.show() editor.setText(pathlib.Path(sys.argv[0]).read_text()) sys.exit(app.exec())
  • Two USB camera sessions not loading simultaneously - QT 6, Camera (QTMultimedia)

    Unsolved
    1
    0 Votes
    1 Posts
    136 Views
    No one has replied
  • Adding jpg files on GUI

    Unsolved
    2
    0 Votes
    2 Posts
    252 Views
    JonBJ
    @JLouis56 Not 100% sure what you are saying, but the The Qt Resource System allows you to embed resources like JPG files inside your executable. Then there is nothing to store externally, when you run the program outside Creator or release it to someone else the images are accessed by your application inside itself.
  • 0 Votes
    2 Posts
    244 Views
    Axel SpoerlA
    Which Qt Version are you using?
  • 0 Votes
    3 Posts
    395 Views
    M
    I understand. From now on, we will not add photos and will display it as text. Thanks for your reply.
  • how to use QML ListModel in C++?

    Unsolved
    7
    0 Votes
    7 Posts
    957 Views
    mzimmersM
    @flaudio I could do that, but I greatly want to keep that second parameter a QVariant. This function is eventually going to be used for a variety of purposes, and I'll need to convert that argument to several different things.
  • How to add animation to Canvas for multiple dynamic corrdinates

    Unsolved
    2
    0 Votes
    2 Posts
    238 Views
    F
    Hi @KeshavJ, I don't think that there are other ways to use animation in canvas. Using canvas you can handle pixel by pixel movement using a Timer (very ugly alternative). Instead of using canvas, have you tried a Shape component? It could be a valid alternative. Advantages: use declarative programming (real qml power) and higher performance (test with a qml profiler). Disadvantages: less flexible (i.e. fixed number of points to draw).
  • When I pass the code to Windows the icons are black and white

    Moved Solved
    12
    0 Votes
    12 Posts
    1k Views
    GrecKoG
    In some Qt Quick Controls styles the icon are rendered in monochrome. Linux has a different default style than window.
  • Needle trailing color/glow effect using Shader Effect on Qt6 QML

    Solved
    3
    0 Votes
    3 Posts
    378 Views
    D
    Yea exactly @Lord_Naikon thank you for your support I just made two uniform buf with same set of data as mentioned now its working. Thank you soo much