跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k 主題 77.7k 貼文
  • Make JS-object available in any file without import. How?

    Unsolved
    1
    0 評價
    1 貼文
    150 瀏覽
    尚無回覆
  • Dynamically create inline Component

    Unsolved
    4
    0 評價
    4 貼文
    576 瀏覽
    jeremy_kJ
    I hadn't noticed the addition of the component keyword. Thanks for pointing it out. The syntax I've used previously is: Item { property Component myComponent: Text { ... } Component.onComplete: myComponent.createObject() }
  • QML application fails to start when QT_OPENGL=desktop set

    Solved
    4
    0 評價
    4 貼文
    850 瀏覽
    SGaistS
    The idea behind the dynamic backend is to be able to detect what is available. From the looks of it there's an issue with the driver on that machine. In any case, forcing the backend to desktop for all Qt applications on a system is wrong. It should be done on an application basis.
  • Get the total window dimensions

    Solved
    2
    0 評價
    2 貼文
    294 瀏覽
    raven-worxR
    @Circuits you can access the current window from "anywhere" using the attached property. Is thats what you are after?
  • QML signal and slot between 2 different QML

    Solved
    8
    0 評價
    8 貼文
    3k 瀏覽
    G
    @J-Hilk That solved the error. Thank you :)
  • How to save code in QML

    Unsolved
    5
    0 評價
    5 貼文
    491 瀏覽
    jeremy_kJ
    @ACaldas If they're all visual children of a container item, this imperative block works: onToggled: { for (var child in parentItem.children) { if (undefined !== parentItem.children[child].checked) { parentItem.children[child].checked = false; } else if (undefined !== parentItem.children[child].enabled) { parentItem.children[child].enabled = false; parentItem.children[child].value = 0; } } } You might also look into either directly binding the values, or using a State. I don't think that these will result in fewer lines, but the relationships might be easier to understand and modify when necessary.
  • Component load modelData failed

    Solved
    6
    0 評價
    6 貼文
    582 瀏覽
    jeremy_kJ
    @Silvia-V said in Component load modelData failed: @jeremy_k Well, The mechanism make me confused Fond a way to fix it ... If there is no better solution, it can only become solved. If that works and is something you find understandable, that looks like a reasonable structure. Presuming that this is representative of the real structure rather than a compact example, you might consider changing property Component delegate to be an alias for the Repeater delegate, and then define the default delegate inline. For non-inline delegates, I favor passing modelData as an explicit property. That makes the delegate easier to reuse or test outside of a view. Thank you @jeremy_k Forgive my broken English[cry] The question was clear, and the included code resolved any doubt. There's nothing to apologize for.
  • How to customize Popup dimming effect?

    Unsolved
    3
    0 評價
    3 貼文
    503 瀏覽
    P
    @J-Hilk Dimming effect is not related to background. I think I need to use Overlay.modal attached property like so: Popup { ... modal: true Overlay.modal: Rectangle { color: "#aacfdbe7" // color/opacity } }
  • Moving Popup when main window resized

    Solved
    7
    0 評價
    7 貼文
    1k 瀏覽
    B
    @fcarney actually, I am not too bothered about anchors and centering as the popups are initially shown in positions based on user mouse clicks, etc. The initial stumbling block for me was just getting hold of the top-level window size and being notified of changes. Now that I can do that, I can think about the details of how I need to react to the changes.
  • QML force delegate instantiation

    Unsolved qml delegate
    2
    0 評價
    2 貼文
    628 瀏覽
    sierdzioS
    You should not want that. Delegates are only a visual representation of the model, and ListView is designed to only show (and instantiate) what the user needs to see. Forcing it to show everything will decrease performance. If you definitely need to generate UI for all elements in a model, use Repeater.
  • Responsive Design in QML

    Unsolved
    2
    0 評價
    2 貼文
    436 瀏覽
    sierdzioS
    Rectangle { anchors.fill: parent } This will make your Rectangle fill the window.
  • I am having some sort of problem with Q_PROPERTY

    Unsolved
    3
    0 評價
    3 貼文
    252 瀏覽
    A
    I did what you said, there was one thing that I had to change that you would have overlooked, but this loads the tile = 0 for all tiles.
  • How to apply the same background to all DelegateChioces in DelegateChooser?

    Unsolved
    6
    0 評價
    6 貼文
    552 瀏覽
    fcarneyF
    @Puya said in How to apply the same background to all DelegateChioces in DelegateChooser?: How would that work with the delegate (a QML component) coming from the model (C++ object)? No idea. I don't know what that means.
  • Can't scroll content of a ScrollView

    Unsolved
    4
    0 評價
    4 貼文
    403 瀏覽
    ocgltdO
    I suspect that adding a scrollbar to a scrollview disconnects it from everything. I've read the docs, and although the don't explicitly say so, I think scrollView contains an inherint scrollbar. So add a new one: ScrollBar.vertical: ScrollBar {} cases a standlone scrollbar connected to nothing.
  • EGLFS : OpenGL error while trying to open a new Window in QML

    Solved
    11
    0 評價
    11 貼文
    1k 瀏覽
    raven-worxR
    @Gunkut i think you are better off by using a StackView element instead of a loader. To push (a new page) into or pop (remove the current page) the StackView in which your current page/window currently is use the provided attached properties (e.g. StackView.view.push() / StackView.view.pop())
  • ListView: disable auto selection

    Solved
    4
    0 評價
    4 貼文
    963 瀏覽
    M
    @KroMignon Thank you, it works
  • Passing a variable to a CircularGauge object.

    Unsolved
    1
    0 評價
    1 貼文
    203 瀏覽
    尚無回覆
  • 此主題已被刪除!

    Unsolved
    1
    0 評價
    1 貼文
    12 瀏覽
    尚無回覆
  • DelegateChooser not working with TableView and QStandardItemModel

    Unsolved
    5
    0 評價
    5 貼文
    1k 瀏覽
    strahlexS
    I'm seeing the same thing here as well. Has anyone reported it as bug?
  • Qml TextEdit Custom key event not processed properly

    Solved
    2
    0 評價
    2 貼文
    240 瀏覽
    C
    Seems like I have to write event.accepted = false and then it works