跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.4k 貼文
  • How to make a MouseArea not react on transparent area of an Image

    6
    0 評價
    6 貼文
    3k 瀏覽
    slettaS
    As I pointed out, grabWindow will include the window itself and will thus most likely be opaque and therefore not useful for the purpose of an AlphaMouseArea.
  • Dialog QtQuick access problem

    1
    0 評價
    1 貼文
    663 瀏覽
    尚無回覆
  • QML Singleton causes app to hang at launch

    4
    0 評價
    4 貼文
    1k 瀏覽
    D
    bq. Is there a limit on the number of singletons in one directory? I don't know. I suppose the limit is on the developper side since it's not so great to have a lot of singleton About the initial problem perhaps there is an order to follow. Since the last singleton use other ones, they must be created/available before the last one ???
  • [SOLVED] Deploy QtQuick on OS X Yosemite it doesn't work

    7
    0 評價
    7 貼文
    2k 瀏覽
    freddy311082F
    Thank you very much my friend. It's work PRFECTLY !!! awesome work regards
  • Best way to create a rollover buttons

    9
    0 評價
    9 貼文
    2k 瀏覽
    _
    Here you can find the debugging output with QSG_INFO=1: http://qt-project.org/forums/viewthread/48610/#199687 without I get no warnings.
  • [solved] QQmlListProperty from QList

    4
    0 評價
    4 貼文
    3k 瀏覽
    V
    Thank you both. Gianluca - good to know, and andreyc's is good reference for future requirements. Cheers
  • Connect SpinBox to Slider (Dynamic Qml) [SOLVED]

    2
    0 評價
    2 貼文
    3k 瀏覽
    H
    Ok, solved. Here is the code: @ import QtQuick 2.3 import QtQuick.Controls 1.2 ApplicationWindow { id: appWindow visible: true width: 400 height: 300 color: Qt.rgba(0, 0, 0, 1) property var sliders: [] property var spinBoxes: [] function createControl(itemType, where) { return Qt.createQmlObject("import QtQuick.Controls 1.2; " + itemType + " {}", where, "ApplicationWindow") } function spinBoxChanged() { for (var spinBox in appWindow.spinBoxes) appWindow.sliders[spinBox].value = appWindow.spinBoxes[spinBox].value } function sliderChanged() { for (var sliders in appWindow.sliders) appWindow.spinBoxes[sliders].value = appWindow.sliders[sliders].value } Component.onCompleted: { // Create some controls. for (var i = 0; i < 10; i++) { var slider = createControl("Slider", grid) var spinBox = createControl("SpinBox", grid) // Connect the SpinBox to the Slider. appWindow.sliders.push(slider) appWindow.spinBoxes.push(spinBox) slider.onValueChanged.connect(appWindow.sliderChanged) spinBox.onValueChanged.connect(appWindow.spinBoxChanged) } } Grid { id: grid columns: 2 anchors.fill: parent } } @
  • Cannot add a Qt resources file to Qt Quick UI

    2
    0 評價
    2 貼文
    604 瀏覽
    p3c0P
    Hi, AFAIK you can't add any cpp or resource files in Qt Quick UI project since this kind of project is meant to run only qml and javascript files with qmlscene executable.
  • [solved] Qml 'PathLine' - Controlling Spread of Elements

    4
    0 評價
    4 貼文
    1k 瀏覽
    p3c0P
    You're Welcome :) Please mark the post as solved by editing the post title and appending [solved]. Happy Coding...
  • Sending signal from Qt Quick ApplicationWindow to C++ class

    5
    0 評價
    5 貼文
    3k 瀏覽
    SGaistS
    Hi and welcome to devnet, Do you mean like described "here":http://qt-project.org/doc/qt-5/qtqml-cppintegration-interactqmlfromcpp.html#connecting-to-qml-signals ?
  • Memory Allocation

    4
    0 評價
    4 貼文
    2k 瀏覽
    S
    The QML is: @ import QtQuick 1.1; Rectangle { id: root width: 500; height: 500; color: "white"; Rectangle { id: smallRectangle; anchors.centerIn: parent; width: 50; height: 50; } Rectangle { id: outputTextBorder anchors.centerIn: outputText color: smallRectangle.color; } Text { id: outputText anchors { left: parent.left; top: parent.top; margins: 30 } onTextChanged: { outputTextBorder.width = outputText.paintedWidth + 10; outputTextBorder.height = outputText.paintedHeight + 3; } } Text { id: outputText2 anchors { right: parent.right; top: parent.top; margins: 30 } } Text { id: outputText3 anchors { right: parent.right; bottom: parent.bottom; margins: 30 } } Text { id: outputText4 anchors { left: parent.left; bottom: parent.bottom; margins: 30 } } Loader { id: loader anchors.verticalCenter: smallRectangle.verticalCenter; anchors.left: smallRectangle.right; width: 100; height: 100; sourceComponent: theSource } Component { id: theSource Rectangle { anchors.fill: parent border.width: 2 radius: 5 border.color: "blue" function setColor(c) { border.color = c; innerText2.color = innerText.color; innerText.color = c; } function setText(t) { innerText.text = t; } function setText2(t2) { innerText2.text = t2; } Text { id: innerText height: 30 anchors.centerIn: parent color: "black" } Text { id: innerText2 anchors.top: innerText.bottom; anchors.horizontalCenter: innerText.horizontalCenter; color: "black" } } } Connections { target: model onColorChanged: { smallRectangle.color = color; outputTextBorder.color = color; loader.item.setColor(color); gc(); } onTextChanged: { outputText4.text = outputText3.text; outputText3.text = outputText2.text; outputText2.text = outputText.text; outputText.text = text; loader.item.setText(text); loader.item.setText2(outputText3.text); gc(); } } } @ The QML is also quite messy. I was trying to figure out what components/actions in QML exacerbate the frequency in allocations. It seems that Loaders really make this thing increase in size. When I run the program alongside task manager, it starts out at 5K which is what I would expect once loaded. However memory keeps increasing until it reached about 30K (took about a minute to two minutes to plateau). This is what I think I'm seeing in our production application only we are never able to reach the plateau because we run out of memory. An interesting exercise was to see if I could keep the memory from climbing from 5K to 30K. The way I finally found of achieving this was to clear the QPixmapCache. With this clearing, the result was the memory size would increase from 5 to 7, then back to 5. It was exactly what we needed. I'm not convinced that clearing the QPixmapCache is going to make the difference. The reason is because with multiple declarative views, only so much would fit in the cache anyways before it would start deallocating pixmaps. I did find an interesting thread that does match what I'm seeing: "http://qt-project.org/forums/viewthread/14492":http://qt-project.org/forums/viewthread/14492 Thanks again for the help.
  • RSS and QML

    3
    0 評價
    3 貼文
    2k 瀏覽
    shavS
    Hi, Did you try to get access to 'content:encode' like 'content' or 'encoded'? I've the same problem when use QXmlInputSource and QDom* in C++ code. When I receive parsed datas and try to use it I receive 'content' field not 'content:encode'. I don't is this bug or this is right. Try to use content field. The problem when you RSS has a to field like in this rss http://blog.qt.digia.com/feed/ : @ <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0"> <channel> <title>Qt Blog</title> <atom:link href="http://blog.qt.digia.com/feed/" rel="self" type="application/rss+xml"/> <link>http://blog.qt.digia.com</link> <description>For Developers by Developers</description> <lastBuildDate>Fri, 17 Oct 2014 09:21:55 +0000</lastBuildDate> <language>en-US</language> sy:updatePeriodhourly</sy:updatePeriod> sy:updateFrequency1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.6.1</generator> <item> <title>Qt 5.4 Beta Available</title> <link> http://blog.qt.digia.com/blog/2014/10/17/qt-5-4-beta-available/?utm_source=rss&utm_medium=rss&utm_campaign=qt-5-4-beta-available </link> <comments> http://blog.qt.digia.com/blog/2014/10/17/qt-5-4-beta-available/#comments </comments> <pubDate>Fri, 17 Oct 2014 09:00:21 +0000</pubDate> dc:creatorTuukka Turunen</dc:creator> <category> <![CDATA[ Licensing ]]> </category> <category> <![CDATA[ Qt ]]> </category> <category> <![CDATA[ Releases ]]> </category> <guid isPermaLink="false">http://blog.qt.digia.com/?p=40509</guid> <description> </description> content:encoded...</content:encoded> wfw:commentRss //get like commentRss http://blog.qt.digia.com/blog/2014/10/17/qt-5-4-beta-available/feed/ </wfw:commentRss> slash:comments14</slash:comments> //get like comments </item> @
  • [SOLVED] Update Property in a Qml (JS usage)

    5
    0 評價
    5 貼文
    1k 瀏覽
    D
    So please add [SOLVED] to your thread title!
  • Difference between Qt Quick Application and Qt Quick UI?

    1
    0 評價
    1 貼文
    732 瀏覽
    尚無回覆
  • Error with QtMultimedia 5.0 -qrc_qml.0 Error1

    1
    0 評價
    1 貼文
    545 瀏覽
    尚無回覆
  • QQuickRenderControl example not working on Desktop OSX

    4
    0 評價
    4 貼文
    1k 瀏覽
    SGaistS
    You're welcome ! Don't forget to post here if you can find a solution :)
  • Trying to access properties inside a dynamically created qml component [ Solved]

    4
    0 評價
    4 貼文
    2k 瀏覽
    D
    Two hints: 1)For maintenance purpose, dynamic creation of QML object can be done using a QML file:(instead of a string ) Example: @ myObj = Qt.createComponent("Obj.qml"); if (myObj.status === Component.Ready) finishToCreateObj(); else myObj.statusChanged.connect(finishToCreateObj); function finishToCreateObj() { if (myObj.status == Component.Ready) { myObj.createObject(objParent, {id: anIdEasytoDefined } ); } else { ...error... } }@ 2) Using this method you can specified an id easily (in the previously code I set "anIdEasytoDefined"
  • Timeline (like Facebook) with GridView

    2
    0 評價
    2 貼文
    1k 瀏覽
    D
    I don't check you code but I will do this using a Flickable element. This flickable is composed of a Repeater using a model When the scrollbar of the flickbale is "near then end", you just add need element in the model.
  • Qt Quick Application hangs when launched from remote desktop

    2
    0 評價
    2 貼文
    901 瀏覽
    D
    OpenGL apps used GPU to work. On remote desktop the GPU is not available
  • QQuickView in fullscreen

    9
    0 評價
    9 貼文
    4k 瀏覽
    GianlucaG
    In Qt 5.3 the QQuickView has a showFullScreen method that to what the name suggest without setting any special flag. Of course, you still need to resize your root object correctly or let the QQuickView resize it for you specifying SizeRootObjectToView It works on Windows and Mac.