Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.2k Topics 77.9k Posts
  • [SOLVED]Scroll issue in Qlistview

    13
    0 Votes
    13 Posts
    4k Views
    M
    Yes..Sure.Thanks a lot
  • [Solved] How to QML Graph layout ?

    6
    0 Votes
    6 Posts
    4k Views
    L
    Short example @ import QtQuick 2.0 Rectangle { width: 300 height: 200 color : "#ddf" ListView { anchors.fill: parent interactive: false model : ListModel { // nodes ListElement { nx:50; ny:100; } // node position is (nx, ny) ListElement { nx:150; ny:50; } ListElement { nx:250; ny:100; } ListElement { nx:150; ny:150; } } delegate : Item { x:0; y:0; width:0; height:0 // here is the "trick" Rectangle { x: nx; y:ny; width:10; height:10; radius: 5; border.color: "#113" MouseArea { anchors.fill: parent; drag.target: parent; } } } } } @
  • Problem with drag and drop in qtquick 2

    2
    0 Votes
    2 Posts
    2k Views
    C
    Here how I solve your problem... @import QtQuick 2.0 Rectangle { id: rootTarget width: 800 height: 800 DropArea { id: dragTarget1 property alias dropProxy: dragTarget1 width: 200; height: 200 y: 100; x: 100 Rectangle { id: target anchors.fill: parent color: "lightgreen" } states: [ State { when: dragTarget1.containsDrag PropertyChanges { target: target color: "green" } } ] } DropArea { id: dragTarget2 width: 200; height: 200 y: 400; x: 100 Rectangle { id: target2 anchors.fill: parent color: "lightgreen" } states: [ State { when: dragTarget2.containsDrag PropertyChanges { target: target2 color: "green" } } ] } Rectangle { id: debut width: 120; height: 120 x: 600; y: 600 color: "red" MouseArea { id: maDrag drag.target: carre width: 100; height: 100 anchors.centerIn: parent onReleased: { console.log('onReleased') parent = carre.Drag.target !== null ? carre.Drag.target : debut } Rectangle { id: carre color: "blue" width: 100; height: 100 anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter Drag.active: maDrag.drag.active Drag.source: maDrag Drag.hotSpot.x: width/2 Drag.hotSpot.y: height/2 states: [ State { when: maDrag.drag.active PropertyChanges { target: carre opacity: 0.5 } ParentChange { target: carre parent: debut } AnchorChanges { target: carre; anchors.horizontalCenter: undefined; anchors.verticalCenter: undefined } } ] } } } }@
  • Some kind of GridView with groupable items and subheaders???

    5
    0 Votes
    5 Posts
    3k Views
    A
    GridView does not seem to handle visual grouping and sections as ListView does. On the other hand, laying items in a grid in a ListView might not be so straight-forward.
  • Need help to make a smooth animation

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • ReferenceError: Can't find variable: because area is overlapped

    9
    0 Votes
    9 Posts
    5k Views
    W
    Thanks. Yes, there is more code, not relevant to this issue. When I show all, it becomes hard to read/find the relevant code. Meanwhile I have made some more signal/functions. They all generate errors, but they do work. I have the feeling that is some kind timing problem. First, the variable cannot be found, and possibly it is instantiated or resolved just a split second later... But I am just guessing here.
  • QtMultimediaKit in Windows XP

    6
    0 Votes
    6 Posts
    2k Views
    J
    It works now, maybe a Windows restart was needed. Anyway thanks for your help.
  • Font Loading Issues on OSX Qt5.1 Beta Qt Quick 2.0

    6
    0 Votes
    6 Posts
    3k Views
    R
    Hey Thanks we can close this one as solved, I filed a bug report. Your right forums are bad places to post bugs. I will likely post if asking if someone gets similar behaviour and then file a bug report. Anyways heres the report if your interested I will likely post more bugs as I go along https://bugreports.qt-project.org/browse/QTBUG-31359 thanks again!
  • QQuickView fullscreen glitch OSX?

    5
    0 Votes
    5 Posts
    4k Views
    R
    Yeah got the same issue here
  • How to access v8's debug API in QJSEngine

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • how two connect two qml file using simple buttom

    11
    0 Votes
    11 Posts
    5k Views
    W
    Aha. So, I'll create one main.qml with the specific UI pages based on components and use visible as switch. Thanks.
  • [SOLVED] Wierd looking text in TableView section in Qt 5.1.0 Beta

    7
    0 Votes
    7 Posts
    5k Views
    R
    Unfortunaltey I do not get a real solution to the problem, but I found setting "renderType: Text.NativeRendering" of text that renders wierd to use solved my immediate problem. There are some disadvantages to this when the text is animated in any way. The blog post explains it in more detail: "Native-looking text in QML 2":http://blog.qt.digia.com/blog/2012/08/08/native-looking-text-in-qml-2/ Below is how I changed my text to display properly: @ Text { id: ta x: 20 text: section renderType: Text.NativeRendering // Added this } @ Hope that helps.
  • Program doesn't generate QML

    4
    0 Votes
    4 Posts
    2k Views
    SGaistS
    That's the wrong template, you should create a new Qt Quick application
  • Error: array initializer must be an initializer list or string literal

    3
    0 Votes
    3 Posts
    13k Views
    A
    It is discouraged to use C-style static arrays in C++; the code you wrote will probably not compile because of not specifying an array size beforehand. Instead of going this way, have a look at "C++ std::string":http://www.cplusplus.com/reference/string/string/ or better yet, since you're dabbling in Qt, stick to "QStrings":http://qt-project.org/doc/qt-5.0/qtcore/qstring.html when wanting to represent textual data of any kind and to "QByteArrays":http://qt-project.org/doc/qt-5.0/qtcore/qbytearray.html when wanting to represent "lower-level" data (bytes, flags, et cetera). @#include <QByteArray> #include <QDebug> #include <QString> int main() { QString string = QString::fromUtf8("This is a test QString variable. ½ ¼ ¾ ⅓ ⅔ † ‡ µ ¢ £ €"); QByteArray array = string.toUtf8(); qDebug() << string; qDebug() << array; }@
  • OpenGL 3.2+ and Qt Quick2

    13
    0 Votes
    13 Posts
    6k Views
    W
    I just compiled and ran the exact same code on windows on the same machine and it worked perfectly. It seems it's an OS X issue :/
  • Remove element from Row when changing states

    1
    0 Votes
    1 Posts
    588 Views
    No one has replied
  • How to access other QML elements ?

    2
    0 Votes
    2 Posts
    914 Views
    A
    You should read on the "QML Object identifier attribute":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-syntax-objectattributes.html#the-id-attribute, and then also on the "QML Object scope":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-documents-scope.html#component-scope.
  • What is .qmlproject file?

    3
    1 Votes
    3 Posts
    10k Views
    T
    .qmlproject is used by Qt Creator to handle projects that are QML-only. As Tomma already said, these kinds of projects use the Qmlviewer application to show QML files. This is rather convenient to play with small examples, but requires that a qmlviewer is installed. It also makes it close to impossible to use such projects on devices since it is very hard to limit these apps in what they can do. Basically the qmlviewer will need to have all the interesting permissions (access the network, etc.) so that all Qml applications will actually run in it and all these Qml applications will inherit those permissions. That is why bigger non-toy things have a .pro file that builds a small piece of code that is basically a stripped down Qmlviewer application and bundles that with the Qml files. This is a separate binary then which gets its own set of permissions. Since this binary is specific to one Qml application you can limit the program to those it actually needs to function.
  • 0 Votes
    2 Posts
    3k Views
    T
    Please "file bug reports":https://bugreports.qt-project.org/ about regressions. Bugreports will be seen by the developer, while it takes a bit of luck for the issue to get noticed here.
  • OpenGL (QGLWindow) functionality in QDeclarativeView

    7
    0 Votes
    7 Posts
    4k Views
    W
    Just found out that signals in QML (to c++) don't work. Changed QDeclarativeView->setScene etc. to QDeclarativeView->setSource Now it works. QGLWindow overlaps qml page.