Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Qml more advanced shapes

    Unsolved
    5
    1 Votes
    5 Posts
    3k Views
    L
    Hi @GrecKo , thanks for that amazing input! It really lookes awsome :) I have just one further question: How is such an approach combinable with actually using a Toolbar from Qt Quick Controls 2? I know that the toolbar as it is (and on the picture) is not really special, but the normal toolbar provides theming and might change it look depending on the theme used. So I would like to still use the Qt Quick Controls 2 components. Above I have mentioned one way I came up with: Using a toolbar and setting the custom shape as an oppacity mask. I just tried this with your code as well and it works like a charm! I do wonder though, if this is the right way to do it?
  • 0 Votes
    2 Posts
    508 Views
    JonBJ
    @Ahti Dunno, but why don't you start by showing us/yourself the return values of the calls to user_model.setData(user_model.index(...? What's the result for you of: https://doc.qt.io/qt-5/qsqltablemodel.html#editStrategy ?
  • QVariantList Repeater

    Unsolved
    3
    0 Votes
    3 Posts
    738 Views
    T
    Thanks for your answer GrecKo, know it works with this code: Map { id: id_quizMap plugin: mapPlugin MapItemView { id: id_mapViewQuizMarker model: quizfiles.getLocations delegate: id_quizDelegate } Component { id: id_quizDelegate MapQuickItem { id: id_marker anchorPoint.x: id_positionImage.width/2 anchorPoint.y: id_positionImage.height coordinate: QtPositioning.coordinate(id_mapViewQuizMarker.model[index].Lat, id_mapViewQuizMarker.model[index].Long) sourceItem: Image { id: id_quizImage width: sourceSize.width*2 height: sourceSize.height*2 source: "images/map-question-marker.svg" } } } }
  • problem With Audio.Metadata At Qt5.12.6

    Unsolved
    2
    0 Votes
    2 Posts
    208 Views
    M
    guys? i am waiting already..
  • Customising ComboBox (delegateModel)

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    B
    @GrecKo Thanks for confirming.
  • Graphic bug

    Solved
    5
    0 Votes
    5 Posts
    464 Views
    ODБOïO
    @IntruderExcluder said in Graphic bug: Not sure if having 360 dymically created rectangles is a good idea. That is may be the issue. Because the same code with less rectangles works correctly. It looks like the limit is 30... if i bind sliders value to repeaters model import QtQuick 2.12 import QtQuick.Controls 2.12 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") id: w property double centerX :150 property double centerY : 150 property int rad : 60 Slider{ id: sl from: 1 to :30 stepSize: 1 } Repeater{ id:rp anchors.centerIn: parent model:sl.value Rectangle{ height: 10 width: 10 radius: 5 color: "blue" x : centerX + (centerX + (rad * Math.sin(index * 2 * (Math.PI / 30))) ) y : centerY + (centerY + (rad * Math.cos(index * 2 * (Math.PI / 30))) ) } } } But if use hardcoded value, i can even put 2000 as model and there is no bug This tired me, this is first time i observe such stupid behavior in QtQuick @IntruderExcluder thx for your inputs, i will try with QQuickPaintedItem
  • Qt QML virtual keyboard not showing keys

    Unsolved
    3
    0 Votes
    3 Posts
    375 Views
    I
    @LeLev hi, thank your for your reply. I'm using Qt 5.8.0 and cross compilation with gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf compiler on Ubuntu Mate LeMaker Guitar board. My desktop OS is Ubuntu 16.04 LTS.
  • 0 Votes
    2 Posts
    2k Views
    J.HilkJ
    @Ashok-Kumar please do not double post closed as duplicate of https://forum.qt.io/topic/111493/i-want-to-geocode-the-location-and-get-the-latitude-and-longitude-in-qml-but-when-i-tried-to-do-it-iam-getting-qgeotileproviderosm-tileserver-disabled-at-qurl-http-maps-redirect-qt-io-osm-5-8-satellite-error-how-to-resolve-it
  • Canvas onPaint in ui.qml

    Unsolved qml design ui design
    4
    0 Votes
    4 Posts
    2k Views
    ODБOïO
    @TMJJ001 hi the canvas content is generated programmatically, i'm not sure you can do it in the Designer
  • Combining MouseArea and MultiPoint TouchArea

    Unsolved
    1
    0 Votes
    1 Posts
    372 Views
    No one has replied
  • Handeling CheckBoxes in ListView via SQLite

    Solved
    7
    0 Votes
    7 Posts
    725 Views
    N
    Finally I used onClicked signal rather than using onStateChanged signal! Using onClicked signal prevents items to fall in infinite loop. But I'm still curious for a better way...
  • Using QML tableview is there away to set column and row spanning?

    Unsolved
    1
    0 Votes
    1 Posts
    190 Views
    No one has replied
  • Help with error. Renamed icon failing upon being referenced.

    Solved
    3
    0 Votes
    3 Posts
    225 Views
    C
    @J-Hilk Which file would you like to see more of? I figured out that the ThemedIcon is being created in a file which is holding another custom component: Component { id addNew NewFlow { id: _addNewFlow anchors.fill: parent { { which is then holding another compoenent of it's own: SettingsValueContainer { ... } which is the script housing the property. Here is what I also know. If I simply change the name back from _helpIcon to help it works again. This is a bit concerning because I have been starting all of my compoenent and element id's with an _ EDIT: I think I figured out the problem but I am not sure what the convention is for how this should have been done. It would seem that there are multiple ThemedIcon's fighting over who owns this property or who this property is referencing. One exists within a file called ImplementSettingScreen: ThemedIcon { id: help imageSource: "qrc:/Assets/Images/information.svg" height: 30 checked: false width: height anchors { top: parent.top topMargin: 20 } } and again in the file i mentioned earlier called GuidanceSettingScreen: ThemedIcon { id: help imageSource: "qrc:/Assets/Images/information.svg" height: 30 checked: false width: height anchors { right: parent.right top: parent.top rightMargin: 20 topMargin: 20 } } So when they are both named "help" then np but as soon as I change the name of one or the other (but not both) then they it's like the machine finally recognizes there was a conflict... how could this property possibly know which themedIcon called "help" it is suppose to be basing it's logic off of? EDIT 2 There are many (many) more ThemedIcon's called "help". Now I am starting to understand the comment I think.
  • Is it possible to use QML ListView as "pagination"

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    J.HilkJ
    @Wiru I don't know for sure, but I think it simply resets the currentItem/Index I'm not an expert in the model view field, so maybe someone else can give you a better/more detailed answer
  • Image orientation with qml Camera

    Unsolved qml camera ios
    6
    0 Votes
    6 Posts
    2k Views
    J.HilkJ
    @vudangkhoa2906 said in Image orientation with qml Camera: Screen.orientationUpdateMask I never specified an orientation update mask, and this readonly property bool isPortrait: (Screen.primaryOrientation === Qt.PortraitOrientation || Screen.primaryOrientation === Qt.InvertedPortraitOrientation) works fine for me, maybe you don't need it ? 🤷‍♂️
  • Qt Crash when switching between 'States'.

    Unsolved
    1
    0 Votes
    1 Posts
    156 Views
    No one has replied
  • C++ and QML

    Unsolved
    5
    0 Votes
    5 Posts
    442 Views
    KroMignonK
    @AB_TrP Your QML code seems strange to me, can you show the header of CGPSData? For me, it should be something like: class CGPSData : public QObject { Q_OBJECT Q_PROPERTY(QString gpsData READ getGPSData NOTIFY gpsDataChanged) public explicit CGPSData(QObject * parent = 0); QString getGPSData() const { return m_gpsData; } void setGpsData(const QString &gpsData) { if(gpsData != m_gpsData) { m_gpsData = gpsData; emit gpsDataChanged(); } } signals: void gpsDataChanged(); private: QString m_gpsData; }; And then, in your QML import IGPSData 1.1 // this is the registered C++ class, CGPSData{ id: cGPSData } Text { id:txtData anchors.left: parent.left anchors.leftMargin: 5 anchors.top: parent.top anchors.topMargin: 80 text: cGPSData.gpsData visible: true font.family: "Helvetica [Cronyx]" font.bold: true font.pixelSize: parent.width * 0.08 color: "#ffffff" }
  • AnimatedImage very slow on first load

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    C
    I am having the same problem on a raspberry pi 4
  • Accessing and altering the same view from different Qml files

    Unsolved model view prog qml model-view
    2
    0 Votes
    2 Posts
    948 Views
    IntruderExcluderI
    You can get StackView instance from Profile.qml quite easy, using StackView attached properties. Define new property at your StackView: StackView { id: home property var modeldata: null // Define StackView property initialItem: Pane { ... ListView { ... delegate: SwipeDelegate { ... swipe.onCompleted: { if (swipe.position > 0) { home.modeldata = model; // Set StackView property home.pop(); home.push("Profile.qml"); } ... } ... } } } } And then at Profile.qml you can easily get attached StackView property: Pane { id: profile ... Button { ... text: "Delete" onClicked: { let modeldata = profile.StackView.view.modeldata; // Accessing StackView property via attached properties if (modeldata !== null) { user_model.removeRow(modledata.index); } ... } } } In this case you do not need workaround with helper row. Also if you need some objects like your helper - better way is to use QtObject rather than visual 'invisible' object.
  • Tooltip with ComboBox

    Unsolved
    9
    0 Votes
    9 Posts
    3k Views
    U
    @gabor53 : This works for me. Not sure if this will meet your requirement ComboBox{ id: row3_combo_box_element currentIndex: 2 model:["Level 1", "Level 2", "Level 3"] MouseArea{ id: row3_label_ma anchors.fill: parent hoverEnabled: true } ToolTip{ text: qsTr("Test x") visible: row3_label_ma.containsMouse } }