Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • Loading Image in DocumentGalleryModel takes extremely long time

    5
    0 Votes
    5 Posts
    2k Views
    Q
    First of all, set asynchronous property of Image in delegate to true. Then use sourceSize property to set optimal size of image. Result - Image of this size will be loaded in memory asynchronously! So UI will not be blocked!
  • Unable to open webpage sections using WebView

    4
    0 Votes
    4 Posts
    3k Views
    C
    I had the same problem. My "Fix" is this function: @ function checkForAnchor(scrollObject,webOject,url){ var a = new String(url); if (a.split("#").length > 1){ var textPosition = webOject.evaluateJavaScript("document.getElementById('"+a.split("#")[1]+"').getClientRects()"); if (textPosition == 'undefined'){ evaluateJavaScript('function getElementsByAttribute(oElm, strTagName, strAttributeName, strAttributeValue){ var arrElements = (strTagName == "" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); var oAttributeValue = (typeof strAttributeValue != "undefined")? new RegExp("(^|\s)" + strAttributeValue + "(\s|$)", "i") : null; var oCurrent; var oAttribute; for(var i=0; i<arrElements.length; i++){ oCurrent = arrElements[i]; oAttribute = oCurrent.getAttribute && oCurrent.getAttribute(strAttributeName); if(typeof oAttribute == "string" && oAttribute.length > 0){ if(typeof strAttributeValue == "undefined" || (oAttributeValue && oAttributeValue.test(oAttribute))){ arrReturnElements.push(oCurrent); } } } return arrReturnElements; }') textPosition = webOject.evaluateJavaScript('getElementsByAttribute(document,"", "title", "'+a.split("#")[1]+'")[0].getClientRects()') } if (textPosition != undefined){ scrollObject.contentY = textPosition[0]["top"]; } } } @ After this, on webView call: @ onLoadFinished: { checkForAnchor(flickable,pageViewer,url); } @ I know is a old post, but maybe will help someone in the future. Happy Qt-ing
  • Children vs. resources

    3
    0 Votes
    3 Posts
    2k Views
    W
    Ah thanks. I understood it as "all items inherit from Item" that is, I seemingly overlooked the word "visual".
  • Portable QML app using Qt Component

    3
    0 Votes
    3 Posts
    2k Views
    L
    Thanks, I'm trying that...
  • How to get information about a object which is drag?

    2
    0 Votes
    2 Posts
    1k Views
    L
    Any idea about this?
  • Qt::QueuedConnection from QML

    5
    0 Votes
    5 Posts
    4k Views
    C
    Or make box2dCppEngine.deleteObject() add the object to a list and trigger a 0-timer to delete the objects in the list.
  • N9 virtual keyboard feedback effect

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Is it possible to use qDeclarativeView in QtQuick 2.0

    8
    0 Votes
    8 Posts
    4k Views
    C
    Ah, I see. QtQuick2 requires opengl, and doesn't directly use a software rasteriser. I imagine that VMware Player provides opengl support via a software pipeline with greatly reduced performance, which could result in the performance problems you are seeing. I'm not 100% certain, of course.
  • QSqlTableModel in QML

    3
    0 Votes
    3 Posts
    6k Views
    R
    I have the same issue, not happy with the design of Model/View with QML. It seems that only very basic use cases are possible without tons of workarounds. Model/View was a pain using plain Qt, it is even worse now with QML. Thanks for your input, I will try this.
  • App is always launched in landscape orientation in N9

    5
    0 Votes
    5 Posts
    3k Views
    L
    I have the same problem. I simply created e new mobile widget Qt application with only a QLabel in the center. When I deploy in my N9 I only see the MainWindow in Landscape. Is this a bug?
  • Synchronize ListViews

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Get current focus item

    3
    0 Votes
    3 Posts
    4k Views
    V
    Thanks for the link.
  • QML + OpenGL = No Smooth Fonts?

    6
    0 Votes
    6 Posts
    4k Views
    X
    Sorry, can't help.
  • How to use *.qml from qrc?

    10
    0 Votes
    10 Posts
    23k Views
    V
    I tried a lot of different approaches and for me this is the easiest solution: I have a main.qml and a Button.qml in my resource file with prefix '/qml/views'. By default main.qml cannot use Button.qml, but if I add 'Button.qml' as alias for Button.qml it finds it and works properly. Tested on Windows (7 64bit) with Qt 4.8.1 (MSVC 2010) Note: it even works if the file is not capitalized correctly (e.g. 'button.qml') but the alias is ('Button.qml'), only the alias matters.
  • Getting Starting time of Process

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    T
    Please do not duplicate threads. I marked this one as closed, please see http://qt-project.org/forums/viewreply/85515/ for the same topic.
  • Advice on approach needed QML GridView [SOLVED]

    2
    0 Votes
    2 Posts
    2k Views
    C
    Sorry - SOLVED of course... "SOLUTION":http://qt-project.org/wiki/Drag_and_Drop_within_a_GridView
  • Issue with extending QML by C++ classes in a custom namespace

    10
    0 Votes
    10 Posts
    11k Views
    T
    In response to my previous post, the problem is in the Q_DECLARE_METATYPE macro, which uses #TYPE without allowing users to specify the Qt type name. It would be handy to have the following macro: @ #define Q_DECLARE_METATYPE2(TYPE, NAME ) QT_BEGIN_NAMESPACE template <> struct QMetaTypeId< TYPE > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); if (!metatype_id) metatype_id = qRegisterMetaType< TYPE >(#NAME, reinterpret_cast< TYPE *>(quintptr(-1))); return metatype_id; } }; QT_END_NAMESPACE @
  • FolderListModel

    10
    0 Votes
    10 Posts
    8k Views
    W
    Hi, Just a side remark I am also using FolderListModel but I am unsure it is supported by nokia ovi store for symbian platform http://www.developer.nokia.com/Community/Discussion/showthread.php?231131-import-com.nokia.symbian-1.0-with-latest-Qt-SDK-1.1.4&highlight=labs You have been warned http://qt-project.org/doc/qt-4.8/qml-folderlistmodel.html Note: This type is made available by importing the Qt.labs.folderlistmodel module. Elements in the Qt.labs module are not guaranteed to remain compatible in future versions. More details : http://rzr.online.fr/q/symbian
  • Painting on QML Element

    7
    0 Votes
    7 Posts
    5k Views
    L
    If you want to do your painting in C++ you will have to subclass QDeclarativeItem (resp. QQuickItem when you are on Qt 5 / QtQuick 2.0); see the example I've mentioned. Another option would be creating the item entirely in QML; the "QML clock":http://doc.qt.nokia.com/4.7-snapshot/declarative-toys-clocks-content-clock-qml.html example might be interesting for you in this case.