Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • [Solved]Create a read only property in qml

    3
    0 Votes
    3 Posts
    8k Views
    S
    Thanks for your helps
  • 0 Votes
    8 Posts
    2k Views
    sierdzioS
    Majority of Android users are still running Android 2.3.x. I'm not entirely up-to-date with Qt on Android, so I can't say much about it. It is based on NDK, though, so Qt should not care too much for the SDK. Run SDK manager and download additional SDKs if you need to.
  • Qrc : cannot find file/directory issues

    6
    0 Votes
    6 Posts
    8k Views
    ?
    Hi Slerdizlo, Recently i got a solution for the question that i have asked and I want to write it in here. May be some others are also got this issue, I got the solution from the Qt forum, http://qt-project.org/forums/viewthread/7047 Thanks to Denis Kormalev, Volker and Brucewuu for solving this problem. If you can go through this link, you can easily understand it. For accessing any file outside QRC, use "absolute filepath" of the file. For example: In main.cpp file; QString path = QDir::currentPath(); //path where the exec is present if your file is in src/file.qml of exec folder, then you can access it like (path += "/src/file.qml";), now path is the absolute file path for file.qml. You can access it in any of the QRC file. QQuickView view; view.rootContext()->setContextProperty("myFile", path); view.setSource("qrc:/main.qml"); In main.qml file: Loader { id: loadItem source: myFile } Item { Component.onCompleted: loadItem.item } Regards Ansif
  • [Solved]ScrollView and Flickable don't respect Image.PreserveAspectFit

    4
    0 Votes
    4 Posts
    2k Views
    S
    Thanks to both of you and sorry that I haven't mentioned my intentions clearly. when the image is too large,I want to handle the view with two ways 1: when the fillMode is Pad, I could use the scrollView or flickable to view the whole image 2: when the fillMode is PreserveAspectFit, the image will shrink to appropriate size Since it is impossible to do it with Flickable or ScrollView, I would find another solutions, like create a new component, with two Images, when the fillMode is PreserveAspectFit, I show the Image with ScrollView or Flickable; change it back to normal Image when it is other fillMode
  • QML text rendering performance unacceptably slow

    3
    0 Votes
    3 Posts
    3k Views
    S
    Hi, Thanks, setting the rendertype to native fixed the problem! I'm not keen on trying to install a separate Qt from the one that comes from the Ubuntu repository, which lags a bit behind. Nice to know there's some performance gains still to come. Regards
  • Debugging QML throught Qt Quick 1 App (using cmake)

    1
    0 Votes
    1 Posts
    828 Views
    No one has replied
  • RubberBand in qml

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    2 Posts
    1k Views
    sierdzioS
    Possibly. However, there are no plans to deprecate or remove it. Sleep safe :) IMO, it's ready. People have different opinions here, though, and it depends on your use case. Definitely, both Widgets and Quick have their benefits, so it's best to pick whatever suits your project best. From my own experience, I'll say that QML and declarative mindset is the way to go. It's just so easy to build the UI this way :) QtQuick1 uses QGraphicsView, QtQuick2 uses Scene Graph - both are available in Qt5. Again, this is up for a debate, but scene graph is rather potent in power :) Functionality of scenegraph and QGraphicsView does not fully overlap, so they can't really be objectively compared without going into specific details. If your project will be used by other people, stick with Qt4 for a while, as Qt5 is still not in all repos.
  • Change the ListModel dynamically

    3
    0 Votes
    3 Posts
    2k Views
    S
    Thanks for your help:).Do we have a more flexible way to switch between different models? Solution one : Design a intermediate models(called C) with several properties when I switch the model, I could clear the data of C and copy the data of different models(A or B) to C Solution two : Use Loader to load the view, when the model change destroy the old table and load a new table Do you have easier solutions?Thanks a lot
  • Qt 5.1.0-rc1 Windows 8: Qml plugin cannot be loaded

    3
    0 Votes
    3 Posts
    2k Views
    N
    i've pushed the current project to "bitbucket":https://bitbucket.org/cidxxiii/lotti can a windows developer help me to figure out, why the project doesn't run on windows, please? (the required boost binaries can be found "here":http://sourceforge.net/projects/boost/files/boost-binaries/1.54.0/ thanks for your help!
  • [Solved] How to detect HTML text input field gets focus in a QML WebView

    9
    0 Votes
    9 Posts
    10k Views
    J
    You should have made another topic of this question, this topic is already marked as solved. And be patience, I did't like receiving a private email asking for an answer. Anyhow, I'm glad that my piece of code helped you get your keyboard to appear. My keyboard works differently. It uses C++ to send KeyEvents so standard QML components see it is a 'real' keyboard. Your info is a bit limited so I can honestly not say what is wrong in your case. Did you check if your onUpdate_text is called, is the value of the indice_in_text and editor_text correct. Did you try if 'hard-coding' the index and the text you, to see if that does work. If your script in evaluateJavaScript has an error, you do not see that in the Qt console. You could use the Web-inspector for that (need to right-click so attach a mouse to your target if possible or run your app on a PC). Add the following to your webview: @ settings.developerExtrasEnabled: true @ When you start the program right click on the web-page and select 'inspect'. In the console tab you can see the output of your javascript in the webpage, and so you can check for errors. I tried the following (for test I use a hardcoded index specific for the input field of google.com page) and that works. Hello appears in the google search bar @ import QtQuick 1.1 import QtWebKit 1.0 Rectangle { width: 800 height: 800 WebView { id: webView settings.javaEnabled: true settings.developerExtrasEnabled: true anchors.fill: parent url: "http://www.google.com/" onLoadFinished: { webView.evaluateJavaScript("var inputs = document.getElementsByTagName('INPUT'); var element = inputs[2]; element.value='Hello'") } } } @ So it looks like the general idea of your Script can work. It may be the GlobalJS stuff that you save. If that is a shared JavaScript file between different QML files, don't forget to add to that .js file @ .pragma library @ to make sure the value of your variables are shared between the QML files. I hope that this helps you in the right direction.
  • QTQuick 2.0 Problem with QT 5.1

    3
    0 Votes
    3 Posts
    3k Views
    J
    Yes, it is a bit of a let down. The MinGW QT5.1 package is only available as openGL version. MinGW QT5.0.1 and QT5.0.2 were available with ANGLE. So I guess since Jens says it is not working yet, that it has to do with the swith to the newer minGW 4.8. I saw that you issued "QTBUG-32232":https://bugreports.qt-project.org/browse/QTBUG-32232 on it, which has been closed rather quickly, stating that MinGW default is openGL. Which was not very helpfull. I issued a bug requesting the angle prebuild version, "QTBUG-32270":https://bugreports.qt-project.org/browse/QTBUG-32270 Let keep our fingers crossed
  • Change playback rate

    1
    0 Votes
    1 Posts
    724 Views
    No one has replied
  • QML TableView performance

    3
    0 Votes
    3 Posts
    3k Views
    A
    I used debug build. I've just created release build. It's working perfect! Thank you for your help!
  • [Solved] How to display items in a centered Flow-like way?

    5
    0 Votes
    5 Posts
    3k Views
    T
    Thanks for you answers. I ended up doing the following, even though it makes the last(s) items bigger than the others: @GridLayout { id: grid property alias model: repeater.model property int count: repeater.model.size Repeater { id: repeater delegate: Item { Layout.fillHeight: true Layout.fillWidth: true Layout.columnSpan: computeSpan(true) Layout.rowSpan: computeSpan(false) function computeSpan(columnAxis) { var axisLength = 0; if(columnAxis) { if(grid.flow == GridLayout.TopToBottom) { return 1; } else { axisLength = grid.columns; } } else { if(grid.flow == GridLayout.LeftToRight) { return 1; } else { axisLength = grid.rows; } } if(axisLength <= 0) { return 0; } else { var remaining = grid.count%axisLength; if((remaining == 0) || (index < grid.count-remaining)) { return 1; } else { return Math.floor(axisLength/remaining); } } } } }@ Maybe it will help someone, but I anyone has a better idea, I'm willing to hear/see it!
  • 0 Votes
    4 Posts
    2k Views
    L
    I've got the problem resolved. Created a parent folder and put the QML-UI contents, HTML-UI contents in 2 separate folders under parent folder. Created a DuoApp.pro in parent folder having following content and it worked as expected by giving the facility to select app to run and also by creating 2 separate .exe files as entry points. " TEMPLATE = subdirs CONFIG += ordered SUBDIRS += QML-UI HTML-UI "
  • Changing the text indent within a TextArea

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Items in the Grid component that are not Rectangle

    3
    0 Votes
    3 Posts
    1k Views
    S
    Oh, got it. Yeah I use different names in my actual code, I just tried to keep it similar. Thanks Jens!
  • [SOLVED]Qt Quick and QML Image Zoom

    2
    0 Votes
    2 Posts
    7k Views
    W
    Solved by : @ MouseArea { anchors.fill: parent; onClicked: { if(transformY > -((visibleImg.height/2 - (visibleImg.height-visibleImg.paintedHeight)/2)(visibleImg.scale-1)) + visibleImg.scale10) transformY -= visibleImg.scale10; else transformY = -(visibleImg.height/2 - (visibleImg.height-visibleImg.paintedHeight)/2)(visibleImg.scale-1); } } @ Resp. with +/- and X/Y on the appropriate directions.
  • [Solved] QPalette and SystemPalette

    3
    0 Votes
    3 Posts
    2k Views
    S
    I knew it was something that simple. Thanks for pointing it out!