Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • QML SystemInfo - it exists already, but only seems to be part of the Neptune 3 UI

    Unsolved
    3
    0 Votes
    3 Posts
    319 Views
    V
    @raven-worx So what you are saying is what I said in the first few lines of my post, that I have to write what has already been written, is already documented by Qt as existing, is a direct reflection of what already exists in C++ because Qt decided to wrap it up in a "special" Neptune UI package. Not that it does ANYTHING relative to 3D or provides ANY additional information beyond that in the C++ class, so it in no way justifies a "special" package. But sure, why not use C++ to do what QML fails to do. Or why not just use a Qt Python package if you want your UI development to be separate from your core. Sort of removes having to dance around the not complete javascript to add a bit of functionality.
  • Dynamically load QML components together with the C++ context.

    Unsolved
    1
    0 Votes
    1 Posts
    160 Views
    No one has replied
  • How to create single QML file with all the constants or labels so that it can reused

    Unsolved
    2
    0 Votes
    2 Posts
    553 Views
    raven-worxR
    @MaruthiMarsh create a singleton componen: https://wiki.qt.io/Qml_Styling#Approach_2:_Style_Singleton
  • how to redraw certain items of a Calendar or just the selected one?

    Unsolved
    2
    0 Votes
    2 Posts
    294 Views
    mbruelM
    well I suppose it is not possible... I'm redrawing all the items (delegates). As an update() is not doing the job, I'm using a "fake" binding like suggested here.
  • print() and console.log() dont print messages to my commandline

    Unsolved
    1
    0 Votes
    1 Posts
    175 Views
    No one has replied
  • Splash screen in QML

    Unsolved
    2
    0 Votes
    2 Posts
    958 Views
    raven-worxR
    @Praveen-Illa EGLFS can only display a single window. thus your splash screen cannot be also a window. you must make it an Item and place it above the content of the mainwindow. E.g. as a child of the windows's overlay for example
  • Make a gridlayout item fullscreen / full height and width of gridlayout

    Solved
    2
    0 Votes
    2 Posts
    735 Views
    A
    After some hour's a found a way todo this. Worklfow: DoubleClick on cameraPane (Expand) cameraPane.Layout.preferredWidth and cameraPane.Layout.preferredHeight is set to parent w, h other cameraPane opacity is set to 0 DoubleClick on cameraPane (Shrink) cameraPane.Layout.preferredWidth and cameraPane.Layout.preferredHeight is set to 0 other cameraPane opacity is set to 1
  • How to update size of content in ScrollView ?

    Solved
    2
    0 Votes
    2 Posts
    410 Views
    R
    @r3d9u11 so, finally I've replaced ScrollView with Flickable and made function, that is refreshing content size. children elements call it manually: Flickable { id: fieldMap anchors.fill: parent ScrollBar.horizontal: ScrollBar { active: true; onActiveChanged: { if (!active) active = true; } } ScrollBar.vertical: ScrollBar { active: true; onActiveChanged: { if (!active) active = true; } } function refreshContentSize() { fieldMap.contentWidth = fieldMap.width; fieldMap.contentHeight = fieldMap.height; for (var i = 0; i < fieldMap.contentItem.children.length; ++i) { var item = fieldMap.contentItem.children[i]; var itemX = item.x+item.width; if ( itemX > fieldMap.contentWidth ) fieldMap.contentWidth = itemX; var itemY = item.y+item.height; if ( itemY > fieldMap.contentHeight ) fieldMap.contentHeight = itemY; } } } Maybe there is better solution
  • ContentWidth in TableView

    Unsolved
    1
    0 Votes
    1 Posts
    118 Views
    No one has replied
  • How to show QWidget and QtQuick.Window

    Unsolved
    2
    0 Votes
    2 Posts
    358 Views
    SGaistS
    Hi, That's because widgets are not meant to be embedded like that. You can check KDAB's Declarative Widget project to mix widgets and QtQuick.
  • Why I cant Play Audio Files? My Code is on armbian os in orangepipluse2 device

    Solved
    9
    0 Votes
    9 Posts
    751 Views
    jsulmJ
    @EmadDeve20 said in Why I cant Play Audio Files? My Code is on armbian os in orangepipluse2 device: armbian I know, but Armbian is based on Debian und Ubuntu too, so usually package names are same. Good that it works now!
  • The deployment device "" is invalid qt android

    Solved
    3
    0 Votes
    3 Posts
    2k Views
    Q
    @jsulm thanks for your answer actually my android's developer option was enable but not now i enable this and this worked
  • Scenegraph examples, some missing QML module not found, is it a bug?

    Unsolved
    1
    0 Votes
    1 Posts
    135 Views
    No one has replied
  • Custom type registered in QML and QVariant

    Moved Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    raven-worxR
    @Pieter-Cardoen the qml engine only support this types: https://doc.qt.io/qt-5/qtqml-cppintegration-data.html if you want to support a custom type you will have to convert it to one of those. before you can process them in QML. For example a struct can be converted to a QVariantMap, or a custom class must interhit QObject and use the meta object system (properties, invokabkle methods, etc.)
  • Observed UI flickering on ARM target

    Solved
    14
    0 Votes
    14 Posts
    2k Views
    P
    @SGaist Thank you for your response I have resolved this issue by changing the graphics driver. I am attaching the link below for others who are facing this kind of problem. https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1060753/am4378-flickering-issue-on-qt-with-eglfs-instance
  • Component objects cannot declare new properties

    Moved Solved
    2
    0 Votes
    2 Posts
    2k Views
    KroMignonK
    @pingal said in Component objects cannot declare new properties: But if I add Button element as below, it gives me the mentioned error in the application output AFAIK, Component can hold only 1 root object (eg. Item, Rectangle, Row ect.). It is same a creating a QML file for a component (cf. https://doc.qt.io/qt-5/qml-qtqml-component.html) You should change your code to: Component { id: itemDelegate Item { Button { .. } Row { Rectangle {..} Rectangle {..} Rectangle {..} Rectangle {..} } } }
  • 0 Votes
    1 Posts
    811 Views
    No one has replied
  • can't find my qmlRegisteredType on rootObject() children

    Solved
    10
    0 Votes
    10 Posts
    1k Views
    D
    @kshegunov Yes, indeed, it makes sense, thanks :)
  • How do you make an original keyboard ?

    Solved
    8
    0 Votes
    8 Posts
    981 Views
    A
    @morita hi Morita, I want to create my layout and I have the same error as you had, so my question is, did you solve the problem? because I have a fresh Qt6 installation and I can use Virtual Keyboard with Input panel, but when I want to use Key, NumberKey, or BaseKey it gives me the same errors that you had? so I would be grateful if you can guide me.
  • How to ensure Popup is visible inside a QML Map

    Solved qml map openstreetmaps
    2
    0 Votes
    2 Posts
    569 Views
    M
    After looking for a while, I finally came across these two functions: mapToItem and mapFromItem. So, I first need to map the current item point to the map item coordinate system. Then, I must check the point is inside the map viewport. If not, I have to adjust the coordinate, and after that, I map the point back to the current item coordinate system. Popup width and height seem to decrease when approaching bottom and right borders, so I had to use contentHeight, contentWidth and padding properties to get the real popup size. And I had to initialize the popup x and y to a value different of zero to allow mouse event to pass on the blue dot. Here is the working code, for those who may need it. import QtQuick 2.11 import QtQuick.Controls 2.4 import QtLocation 5.11 import QtPositioning 5.11 import QtQuick.Window 2.11 Window { id: root; width: 800; height: 600; Plugin { id: mapPlugin; name: "osm"; } ListModel { id: myModel ListElement { latitude: 48.2351164; longitude: 6.8986936; name: "The point on the center"; } ListElement { latitude: 48.235111272600186; longitude: 6.9007217756551995; name: "The point on the right"; } ListElement { latitude: 48.23512783507458; longitude: 6.896574932520792; name: "The point on the left"; } ListElement { latitude: 48.23614708436043; longitude: 6.898623901851295; name: "The point on the top"; } ListElement { latitude: 48.23417574713512; longitude: 6.898641104398024; name: "The point on the bottom"; } } Map { id: map anchors.fill: parent plugin: mapPlugin center: QtPositioning.coordinate(48.2351164, 6.8986936) zoomLevel: 19 MapItemView { model: myModel delegate: MapQuickItem { anchorPoint.x: myRect.width / 2 anchorPoint.y: myRect.height / 2 width: myRect.width height: myRect.height coordinate: QtPositioning.coordinate(model.latitude, model.longitude) sourceItem: Rectangle { id: myRect readonly property int radius: 10 width: radius * 2 height: radius * 2 color: "transparent" Canvas { id: myCanvas anchors.fill: parent property alias textVisible: myPopup.visible onPaint: { var width = myRect.width; var height = myRect.height; var centreX = width / 2; var centreY = height / 2; var ctx = getContext("2d"); ctx.reset(); ctx.fillStyle = "blue"; ctx.globalAlpha = 1; ctx.beginPath(); ctx.moveTo(centreX, centreY); ctx.arc(centreX, centreY, myRect.radius, 0, Math.PI * 2, false); ctx.closePath(); ctx.fill(); } MouseArea { x: 0; y: 0; width: myRect.radius * 2 height: myRect.radius * 2 acceptedButtons: Qt.LeftButton hoverEnabled: true onPositionChanged: { myCanvas.textVisible = true; // absolute position in map coordinate system var absPos = mapToItem(map, mouse.x, mouse.y); // margin between mouse pointer and the popup var cursorMargin = 10; // extra margin for right and bottom side var bottomRightSideExtraMargin = 10; // add the cursor margin to the position var absPopupX = absPos.x + cursorMargin; var absPopupY = absPos.y + cursorMargin; // adjust if the popup is out of view on the bottom or right sides if (absPos.x + myPopup.contentWidth + myPopup.leftPadding + myRect.radius * 2 + bottomRightSideExtraMargin > root.width) { absPopupX = root.width - (myPopup.contentWidth + myPopup.leftPadding + cursorMargin + bottomRightSideExtraMargin); } if (absPos.y + myPopup.contentHeight + myPopup.topPadding + myRect.radius * 2 + bottomRightSideExtraMargin > root.height) { absPopupY = root.height - (myPopup.contentHeight + myPopup.topPadding + cursorMargin + bottomRightSideExtraMargin); } // convert back to the current item coordinate system var popupPos = mapFromItem(map, absPopupX, absPopupY); myPopup.x = popupPos.x; myPopup.y = popupPos.y; } onExited: { myCanvas.textVisible = false; } } } Popup { id: myPopup // original offset to allow mouse hover x: 20; y: 20; visible: false Label { text: model.name; horizontalAlignment: Text.AlignHCenter; } } } } } } }