Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • How to change source

    3
    0 Votes
    3 Posts
    976 Views
    mrdebugM
    I have used Loader to embed in the main qml file the new files, as pages but I don't like so mutch this approach. With Declarative I can change the screen as I want.
  • How to give a JavaScript function to a qml component [solved]

    3
    0 Votes
    3 Posts
    998 Views
    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 Votes
    4 Posts
    1k Views
    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 Votes
    2 Posts
    613 Views
    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.
  • 1 Votes
    1 Posts
    893 Views
    No one has replied
  • QML List Model

    2
    0 Votes
    2 Posts
    875 Views
    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 Votes
    2 Posts
    841 Views
    ?
    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 Votes
    2 Posts
    2k Views
    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 Votes
    3 Posts
    2k Views
    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 Votes
    2 Posts
    868 Views
    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 Votes
    5 Posts
    3k Views
    T
    Thanks, I will check it out.
  • Qml items with native look and feel

    11
    0 Votes
    11 Posts
    4k Views
    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 Votes
    9 Posts
    3k Views
    B
    Sorry, I forgot to do that :D
  • Is there a widget to draw a function ?

    5
    0 Votes
    5 Posts
    1k Views
    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 Votes
    11 Posts
    13k Views
    D
    That's it http://developer.blackberry.com/native/documentation/cascades/dev/integrating_cpp_qml/
  • Clear an Array? how to clear array

    3
    0 Votes
    3 Posts
    3k Views
    S
    Dynamic array is from STL or Qt?
  • [SOLVED] Qt Quick designer crash Qt Creator

    8
    0 Votes
    8 Posts
    7k Views
    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 Votes
    3 Posts
    2k Views
    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 Votes
    2 Posts
    886 Views
    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 Votes
    7 Posts
    4k Views
    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).