Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • Cannot assign to non-existent property in another qml file

    5
    0 Votes
    5 Posts
    11k Views
    D
    You have probably already noticed that the id in marqueeText.qml should not start with an upper case letter as described "here":http://doc.qt.io/qt-5/qtqml-syntax-objectattributes.html#the-id-attribute I main.qml you do @ MarqueeText { id:scrolltext width: 800 height: 48 text: "Qt Quick Digital Signage Demo" } @ This allocates a new instance of the MarqueeText class/element and has nothing to do with the id you provided in the MarqueeText.qml file
  • I want add text from textedit to database

    2
    0 Votes
    2 Posts
    737 Views
    D
    Hi, I think what you are looking for is : " here":http://doc.qt.io/qt-5/qsqlquery.html#approaches-to-binding-values
  • [SOLVED] General scope question

    5
    0 Votes
    5 Posts
    2k Views
    B
    [quote]In simple terms, yes you’re right. To be more precise though, an ID is limited to Component Scope [doc.qt.io][/quote]Ahh.. ok that sounds interesting. So items in the main.qml have global ids but the other way round, it is not possible. [quote]That’s not possible. You cannot create a global item in QML. Anyway, can you think of a good use-case where you need to have a global item?[/quote]Hmm, I think I'm lacking in required experience to answer this question, but the way you ask tells me the answer :-P Btw.: On my extensive investigation using google I found another way that could also be useful. When I use a singleton, I can make the component accessable from other files (if I understood that right), but I don't think that this is the right way for my purposes, because singleton is "more" useful for components which are created lots of times to save memory/performance... Well, thank you for spending a lot of time explaining that stuff to me, I appreciate that much! :-) Cheers,
  • Starting remote a console program

    3
    0 Votes
    3 Posts
    993 Views
    A
    You can use ssh to run remote console program. Not sure if it will work on Windows. But on Linux or OSX it will work.
  • [Solved] How to link QZXing?

    14
    0 Votes
    14 Posts
    6k Views
    SGaistS
    AFAIK, it's a decoding library
  • How to disable sound of camera snaping at the Camera component

    6
    0 Votes
    6 Posts
    2k Views
    SGaistS
    Technically these kind of settings are handled by the user through the device's control panel. However I don't think that you should/can modify them like that. Personally I wouldn't like a program that tries to modify my device settings without even trying to ask me first.
  • [SOLVED] Best way to create image based button with variable size

    4
    0 Votes
    4 Posts
    1k Views
    sierdzioS
    You are welcome, happy coding! :-)
  • Qt QML - FastBlur with rounded corners rectange and background image

    4
    0 Votes
    4 Posts
    3k Views
    M
    Yes I tried it, but slightly different. The button1 has to be visible because it also has text which is not blurred, so I created a child rectangle which filled button1 and set this one to invisible and made it a source for FastBlur. But nothing was blurred. Maybe because the rectangle I created was two levels a above the background. I will do more experiments and report back. Thanks.
  • [Solved] Method or Function to load a ComboBox model dynamically ?

    4
    0 Votes
    4 Posts
    1k Views
    P
    Yep. works great. Thx. Modified slightly to... @QStringList CppObject::splitString( QString sepChar, QString myString ) { return myString.split( sepChar ); } @
  • Creating a lot of the same qml components

    5
    0 Votes
    5 Posts
    1k Views
    GianlucaG
    100 or more items for sure does not fit inside the screen together, so you should avoid to load all at once the Item delegated to visualize that information on the screen. Qt Quick come in your help with ListView, GridView and TableView. Each of them take a Model (ListModel, or something else) that contains only the data (i.e. the parameters of each item) and usually it's just one object very fast to load even if there is a list of thousands of elements, and then you define a delegate Item that it's your Qt Quick component that takes the parameters and visualize them on the screen. ListView (& co.) loads only the Items necessary to get displayed on the screen and in this way there will be only few loading/creation of objects.
  • Qt Quick - multi state home screen - embedded linux

    6
    0 Votes
    6 Posts
    2k Views
    p3c0P
    bq. If I understand this correctly then the Loader takes care of destroying the unused objects and all that needs to be done is just load a new object on button click. Correct. But only those which are loaded by Loader.
  • [SOLVED] Parallel Animation and property change in sequence

    3
    0 Votes
    3 Posts
    2k Views
    M
    Thanks! Here is what I did and it works perfectly. @ ParallelAnimation { id: fadeOut running: false NumberAnimation { target: screen; property: "opacity"; to: 0; duration: 300; easing.type: Easing.InQuad } NumberAnimation { target: screen; property: "scale"; to: 0; duration: 300; easing.type: Easing.InQuad } alwaysRunToEnd: true onStopped: { buttonMenu.updateSource() // source update is done by Loader in separate qml file fadeIn.start() } } ParallelAnimation { id: fadeIn running: false NumberAnimation { target: screen; property: "opacity"; to: 1; duration: 300; easing.type: Easing.InQuad } NumberAnimation { target: screen; property: "scale"; to: 1; duration: 300; easing.type: Easing.InQuad } alwaysRunToEnd: true } @
  • Source: "qrc:/images/starfish_1.png" in qml sample code

    3
    0 Votes
    3 Posts
    1k Views
    shavS
    Hi, If your QML file is save in the same qrc file with images you can use path like: @ path_to_image_from_current_qml_file/image.png @ For example, if you have path structure like this: @ qml/ images/ image.png mail.qml @ And you want to show file image.png you should use path in main.qml like: @ Image { id: icon source: "images/image.png" } @ or full path from resources like this: @ Image { id: icon source: "qrc:///qml/images/image.png" } @ But I recomend to you use the first way.
  • How to check the physical screen size of your display?

    2
    0 Votes
    2 Posts
    947 Views
    sierdzioS
    You can get it (although a bit unreliably) from QDesktopWidget, like this: @ int heightMiliMeters = QDesktopWidget::screen()->heightMM(); int widthMiliMeters = QDesktopWidget::screen()->widthMM(); @
  • Invalid write to global property

    9
    0 Votes
    9 Posts
    12k Views
    p3c0P
    bq. It seems, that setSc method does not work right. You can try printing the value in setSc function to check if it works. @ function setSc(ss) { sc = ss console.log(sc) } @
  • Native Copy/Paste, text selection in TextEdit at the Android

    7
    0 Votes
    7 Posts
    6k Views
    M
    O_o realy?? tomorow i'll test it, tnx a lot :)
  • How to use QML sprite.(solved)

    3
    0 Votes
    3 Posts
    1k Views
    H
    "sprites picture":http://pxlcobit.deviantart.com/art/MLSS-Hammer-and-Boomerang-Mario-sprites-sheet-309187434 I would like to use irregular sprite like attach. Where to find help?
  • Touch events on complex ui not always firing

    1
    0 Votes
    1 Posts
    437 Views
    No one has replied
  • Different delegates at the repeater

    5
    0 Votes
    5 Posts
    2k Views
    p3c0P
    bq. how i understand i should manualy calculate possition of new item? createObject returns the object that is created. It can be used to assign values to its properties. @ var obj = component.createObject(item); obj.y = index*40 @ Or (as you have already did) putting it in Row or Column should also work.
  • [SOLVED] Horizontally centering a rectangle in a window

    3
    0 Votes
    3 Posts
    2k Views
    B
    Oh yes, you're right. Thank you really much! :-)