跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.4k 貼文
  • How to give a JavaScript function to a qml component [solved]

    3
    0 評價
    3 貼文
    1k 瀏覽
    A
    Hi, i found it. If my component use f(x) and this component is in a file Draw.qml Simply do it @ Draw { function f(x) { return Math.cos(x) } } @ Have a nice day
  • Set size of the a window according to its items

    4
    0 評價
    4 貼文
    1k 瀏覽
    SGaistS
    Sorry, my bad, i didn't notice the sub-forum of the question. I currently can't tell from a qml point of view.
  • QML / Akonadi

    2
    0 評價
    2 貼文
    613 瀏覽
    SGaistS
    Hi and welcome to devnet, Since you want to interface Akonadi, you should rather ask this on the KDE forums. You'll probably have better chances to get a quick answer about that. Looking at the KDE sdk might also give you some hints.
  • Qt3D Mesh component - loading *.mesh files with *.material file. How to do that?

    1
    1 評價
    1 貼文
    895 瀏覽
    尚無回覆
  • QML List Model

    2
    0 評價
    2 貼文
    879 瀏覽
    N
    Right way is to write model in pure C++. QQmlListModel is internal class, so you can not use it from C++.
  • Can't focus on TextField in Intergration Mode

    2
    0 評價
    2 貼文
    842 瀏覽
    ?
    Someone can help me? Selection doesn't work for the TextInput and TextAreaInput even when it's not read only. this is a bug ?! how can I solve this problem ?
  • Question about selection in the new TableView QML type

    2
    0 評價
    2 貼文
    2k 瀏覽
    J
    This is actually not currently supported by TableView. However it is not all that hard to do yourself. I made an example spreadsheet to give you an idea: @import QtQuick 2.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.1 TableView { id: table model: 100 width: 600 height: 400 TableViewColumn { } TableViewColumn { } TableViewColumn { } TableViewColumn { } property int currentColumn: 0 Keys.onRightPressed: if (currentColumn < table.columnCount - 1) currentColumn++; Keys.onLeftPressed: if (currentColumn > 0) currentColumn--; rowDelegate: Rectangle { // grid height: 20 color: "#fff" } itemDelegate: Rectangle { property bool selected: styleData.row === table.currentRow && styleData.column === currentColumn color: "transparent" Rectangle { anchors.fill: parent color: selected ? "#4488ee" : "transparent" } Label { id: label verticalAlignment: Text.AlignVCenter anchors.leftMargin: 4 anchors.rightMargin: 4 anchors.fill: parent elide: Text.ElideRight text: styleData.value color: selected ? "white" : "black" } Rectangle { anchors.right: parent.right height: parent.height ; width: 1 color: selected ? "transparent" : "#eee" } Rectangle { width: parent.width ; height: 1 color: selected ? "transparent" : "#eee" } MouseArea { anchors.fill: parent onClicked: { currentColumn = styleData.column currentRow = styleData.row table.forceActiveFocus(); } } } } @
  • ColumnLayout problem [solved]

    3
    0 評價
    3 貼文
    2k 瀏覽
    A
    Hi, thanks it works now, here is the code @import QtQuick 2.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.1 ApplicationWindow { minimumHeight: 100 maximumHeight: 300 minimumWidth: 100 maximumWidth: 300 width: 300 height: 300 Rectangle { id: rectangle anchors.fill: parent onWidthChanged: console.log("Rectangle Width : "+width) ColumnLayout { anchors.fill: parent // Doesn't work with that //width: 100 // Works with that onWidthChanged: console.log("Column Width : "+width) Rectangle { color: "red" onWidthChanged: console.log("Rectangle 1 Width : "+width) Layout.fillHeight: true // Doesn't extend Layout.fillWidth: true // Doesn't extend Layout.minimumHeight: 50 Layout.maximumHeight: 100 } Rectangle { color: "green" //width: rectangle.width height: 100 onWidthChanged: console.log("Rectangle 2 Width : "+width) Layout.fillHeight: true // Doesn't extend Layout.fillWidth: true // Doesn't extend Layout.minimumHeight: 50 Layout.maximumHeight: 100 } Rectangle { color: "blue" onWidthChanged: console.log("Rectangle 3 Width : "+width) Layout.fillHeight: true // Doesn't extend Layout.fillWidth: true // Doesn't extend Layout.minimumHeight: 50 } } } } @
  • Run my exe file from outside of QtCreator

    2
    0 評價
    2 貼文
    870 瀏覽
    SGaistS
    Hi, Please take the time searching the forum. This question comes almost every week. Have a look a this well written "wiki entry":http://qt-project.org/wiki/Deploy_an_Application_on_Windows for windows deployment. You also have the "Windows Deployment Guide":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html
  • X and y offset on tiled images

    5
    0 評價
    5 貼文
    3k 瀏覽
    T
    Thanks, I will check it out.
  • Qml items with native look and feel

    11
    0 評價
    11 貼文
    4k 瀏覽
    J
    I solved using QApplication in the main.cpp. I used the header from the Gallery example. @ #ifndef QTQUICKCONTROLSAPPLICATION_H #define QTQUICKCONTROLSAPPLICATION_H #ifdef QT_WIDGETS_LIB #include <QtWidgets/QApplication> #else #include <QtGui/QGuiApplication> #endif QT_BEGIN_NAMESPACE #ifdef QT_WIDGETS_LIB #define QtQuickControlsApplication QApplication #else #define QtQuickControlsApplication QGuiApplication #endif QT_END_NAMESPACE #endif // QTQUICKCONTROLSAPPLICATION_H @ and in the main.cpp @ QtQuickControlsApplication app(argc, argv); @ I also added this line in the .pro file @ !android: !ios: !blackberry: qtHaveModule(widgets): QT += widgets @ But they are not actually needed :) Thanks for the help guys!!
  • [Solved] ListView: How to get snapped item when snaps occur?

    9
    0 評價
    9 貼文
    3k 瀏覽
    B
    Sorry, I forgot to do that :D
  • Is there a widget to draw a function ?

    5
    0 評價
    5 貼文
    1k 瀏覽
    A
    Hi, that what i thought i will have to do it by myself or use qwt. Thanks for your answers
  • Qwidgets in QML

    11
    0 評價
    11 貼文
    14k 瀏覽
    D
    That's it http://developer.blackberry.com/native/documentation/cascades/dev/integrating_cpp_qml/
  • Clear an Array? how to clear array

    3
    0 評價
    3 貼文
    3k 瀏覽
    S
    Dynamic array is from STL or Qt?
  • [SOLVED] Qt Quick designer crash Qt Creator

    8
    0 評價
    8 貼文
    7k 瀏覽
    sierdzioS
    This is understandable - QtQuick 1 and 2 are completely separate beasts and require different designer rendering helpers.
  • How to import 3rd party js lib to qml

    3
    0 評價
    3 貼文
    2k 瀏覽
    M
    Tnx a lot 4 answer! ok, but my app will be run at mac os, etc, where Android API will not be available, and what next? About C++ version, i think i can't use is so maybe some one know other libs or some service or something other solutions?
  • Qml image sub region (spritesheet) but with centered image

    2
    0 評價
    2 貼文
    887 瀏覽
    S
    went image provider route, seems the best/only real way. ( i also needed some resizing code for when the source is larger than the element, to downsize it
  • [SOLVED] Qt 5.3 and QtQuick 1.1

    7
    0 評價
    7 貼文
    4k 瀏覽
    sierdzioS
    [quote author="MrBolton" date="1400665764"]But I'm still wondering: Does the QQuickWidget not support QtQuick 1 at all?[/quote] Correct. It does not need to (plus, QtQuick 1 is deprecated in Qt 5).
  • QT4.8.4 : QtQuick 1.1 : images ressource management

    4
    0 評價
    4 貼文
    1k 瀏覽
    sierdzioS
    Nice, so now we know for sure :-)