跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k 主題 77.7k 貼文
  • Access properties from dynamically loaded component

    Unsolved loader binding properties
    2
    0 評價
    2 貼文
    6k 瀏覽
    C
    Maybe //main.qml: import QtQuick 2.5 Loader { id: loader source: "MyComponent.qml" onLoaded: { loader.item.property1 = "secret" loader.item.property2 = 777 } } //MyComponent.qml: import QtQuick 2.0 Rectangle { id: rect property string property1 property int property2 TextEdit { id: text_edit anchors.centerIn: parent text: property1 + property2 } } or //main.qml: import QtQuick 2.5 Item { id: main width: 200; height: 200 property string property1: "secret" property int property2: 777 Loader { id: loader source: "MyComponent.qml" onLoaded: loader.item.text = property1 + property2 } } //MyComponent.qml: import QtQuick 2.0 Rectangle { id: rect property alias text: text_edit.text TextEdit { id: text_edit anchors.centerIn: parent text: property1 + property2 } } or import QtQuick 2.0 Rectangle { id: rect TextEdit { id: text_edit anchors.centerIn: parent // rect.parent -> loader; rect.parent.parent -> Item with id 'main' text: (rect.parent.parent.property1 !== undefined) ? rect.parent.parent.property1 : "" } }
  • MouseArea not working on headerDelegate

    Unsolved
    1
    0 評價
    1 貼文
    374 瀏覽
    尚無回覆
  • QML Map View Mark Location By Lat Long

    Unsolved
    1
    0 評價
    1 貼文
    805 瀏覽
    尚無回覆
  • Qml FileDialog on Windows Runtime

    Unsolved
    3
    0 評價
    3 貼文
    1k 瀏覽
    T
    @p3c0 Thanks! It works well without files on OneDrive. I think that it's an other probrem because StorageFile::CopyAsync fails too. void copyFile(const QString &fileUrl) { QFileInfo fromFile(QUrl(fileUrl).toLocalFile()); QString toPath = cd.absoluteFilePath(fromFile.fileName()); qDebug() << fromFile.absoluteFilePath() << "->" << toPath; bool res = QFile::copy(fromFile.absoluteFilePath(), toPath); }
  • failed to load images

    Unsolved
    8
    0 評價
    8 貼文
    2k 瀏覽
    SGaistS
    The path to the iOS assets is QCoreApplication::applicationPath() + QLatin1String("/../Resources/") + path_to_your_file;
  • DropShadow over entire Rectangle

    Unsolved
    2
    0 評價
    2 貼文
    556 瀏覽
    L
    Use RectangularGlow instead of Dropshadow and place it on top of your Rectangle. Rectangle { id: root width: Screen.width height: patientName.height + 20 + rectangle2.height + 132 + gridView1.height + 20 color: "#00000000" RectangularGlow { anchors.fill: background glowRadius: 1 spread: 0 cornerRadius: 10 color: "#80000000" } Rectangle{ id: background anchors.topMargin: 50 anchors.centerIn: parent radius: 15 width: parent.width *2/3 height: root.height - 10 color: "#ffdbeef5" } }
  • module "QtQuick.Controls" version 1.4 is not installed

    Unsolved
    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆
  • Model-View-Delegate Problem

    Unsolved mvc qml qtquick folderlistmodel filedialog
    1
    0 評價
    1 貼文
    962 瀏覽
    尚無回覆
  • Loading many images locally, Photo Album Viewer

    Unsolved folderlistmodel loadimages qml qtquick serialize
    1
    0 評價
    1 貼文
    701 瀏覽
    尚無回覆
  • Serializing Tons of Images

    Unsolved images loading images qimage qml qtquick
    1
    0 評價
    1 貼文
    854 瀏覽
    尚無回覆
  • check Hover in pool of rectangles

    Solved qml canvas hover qt quick popovee popup
    11
    0 評價
    11 貼文
    7k 瀏覽
    A
    @p3c0 Thank You, your answers were really helpful, it's solved.
  • Photo Album Example

    Unsolved xmllistmodel folderlistmodel mvc m-v-delegate model-view
    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆
  • Detect mouse click outside the modal window

    Unsolved qml modal dialog popup
    2
    0 評價
    2 貼文
    3k 瀏覽
    J
    A small clarification. Popup window should work the same way as menu or combobox, so it should be closed when you click anywhere outside popup.
  • StackView.pop() from Item on Stack

    Solved
    4
    0 評價
    4 貼文
    4k 瀏覽
    S
    So, after playing around and a another few looks into the qt touch-gallery example, where they do exactly the with on of their buttons, I found a working solution and maybe a bug in the StackView. But thats I'm not really sure of. Maybe someone with more experience in QtQuick and StackView can confirm it ;) After adding a Text in App1 that displays the current stackdepth, I was surprised it shows a value of 2 even when I've only added one Item. And from this visibility of the depth, I was able to see that the call if (appStack) appStack.pop() call at onReleased: in App1 is actually working. The last Item was popped so that that there was only one left on the stack. As those were both yellow I havn't seen the pop effect before. What I'm not sure about now: As I havn't found a rule, that a StackViewalways needs a initialItem, is it working as intended, that the first item to be added on a empty StackView is added twice? Is it working as intended, that the last item on the Stackview can't be popped with pop() but must be popped with clear() ? If anyone with more experience in QtQuick and the usage of StackView knows anything about this points, feel free to explain your knowledge/thougths. If this is really a bug in StackView I would report it after confirmation ;) PS: as a workaround for now I'm using onReleased: appStack.depth > 1 ? appStack.pop() : appStack.clear() in App1. Like this both instances on the Stack are popped at the same time.
  • Make TreeView flickable

    6
    0 評價
    6 貼文
    2k 瀏覽
    p3c0P
    @bmurphy You can make a feature request at bugreports.qt.io. Also you can try asking the same on http://lists.qt-project.org/mailman/listinfo/interest or http://lists.qt-project.org/mailman/listinfo/development.
  • How do I make my custom button element focusable?

    Solved button custom widget focus
    3
    0 評價
    3 貼文
    2k 瀏覽
    A
    @p3c0 Thank you! Works fine.
  • TreeView unknown component (M300) - Qt5.5.1

    Unsolved
    5
    0 評價
    5 貼文
    4k 瀏覽
    T
    @p3c0 Thanks for the tip: it doesn't fix the designer itself, but at least I can continue using the text editor without too much hassle...
  • Qt quick applications glitching

    Unsolved
    2
    0 評價
    2 貼文
    494 瀏覽
    S
    Hi. What GPU do you use ?
  • Binding list from C++ to QML

    Solved qml binding
    25
    0 評價
    25 貼文
    17k 瀏覽
    p3c0P
    @TonyN GridView doesnot have the facility to get items using columns. AFAIK your current solution is the only way to go. Btw inside GridView you already have the index attached property.
  • Dynamically adding a Menu to a MenuBar

    Unsolved qml menubar
    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆