跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.4k 貼文
  • How to use the javascript in QML

    1
    0 評價
    1 貼文
    727 瀏覽
    尚無回覆
  • [Solved] Error using states to change between pages

    4
    0 評價
    4 貼文
    2k 瀏覽
    J
    Hi oosavu You are right I'm overcomplicating things. Using: @onGameclick: root.state = "game"@ and in main.qml: @PagePanel { id: pagepanel state: "menu" }@ works fine. Thank you
  • [solved] Relative URL when creating a reusable QML PageLoader component

    2
    0 評價
    2 貼文
    1k 瀏覽
    P
    Okay, "Qt.resolvedUrl()" ... pretty simple :) All that time reading about import paths and it was right here all along http://qt-project.org/doc/qt-5.0/qtqml/qml-url.html
  • How to use Qt commercial chart

    6
    0 評價
    6 貼文
    4k 瀏覽
    AndySA
    Assuming you have posted a request via the link that JKSH has provided then we should have seen this appear in our system and depending on when you submitted it then it should have been answered. If you contact me directly on andy DOT shaw AT digia DOT com with the details of the request (i.e. your name, license id and the subject you used for the request) then I can try and track it down for you. We do answer everything within 2 working days, so either it is already answered and I'm just seeing this late, or something has gone awry in our system for some reason.
  • Images disappearing when using translucent OpenGL background

    2
    0 評價
    2 貼文
    980 瀏覽
    C
    Hi, I can't remember the bug number now, but ISTR Gunnar mentioning something about this in a bug report. Ask him on #qt-graphics and I'm sure he'll be able to point you to the bug. Cheers, Chris.
  • What should I do with QML code ?

    2
    0 評價
    2 貼文
    874 瀏覽
    C
    First, you need to ask questions which are (a) more precise, (b) more detailed, (c) less vague. What do you trying to achieve? What have you tried so far? What went wrong? Is there any information you can provide (such as error messages which were returned) which might provide some clue as to what went wrong? Second, you need to read the documentation. The documentation (in particular the Qt Quick Application Developer's Guide) contains a lot of information which should be useful to get developers up and running quickly. I'm not going to link you to it directly, as I think you should be able to find it on your own with a couple of minutes Googling or searching these forums (as I have posted the link here multiple times), if you find the Qt Project documentation landing page too complex to navigate directly - as I admit that it can be confusing at first. Cheers, Chris.
  • Qt Desktop Components rendering issues in Windows 7

    3
    0 評價
    3 貼文
    2k 瀏覽
    B
    Awesome! I started looking at the QStyleItem implementation but was not exactly sure what to look for. I modified the QStyleItem::paint implementation for the troubled components (CheckBox, RadioButton, and Button), where no widgets are passed when drawing the control: @qApp->style()->drawControl(QStyle::CE_CheckBox, m_styleoption, painter, NULL);@ Thanks again! This worked out very well with minimal code changes.
  • QML listmodel - search/sort, any helpful documentation?

    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆
  • How to disable font kerning in TextEdit

    3
    0 評價
    3 貼文
    2k 瀏覽
    H
    I have solved this problem, thanks. @ import QtQuick 2.1 Rectangle { id: container width: 360 height: 360 TextEdit{ id: textEdit text: "fasjkljklzvjjfopasdj09jropwejofjasdl" color: "red" } Item{ id: testItem anchors.fill: textEdit Component.onCompleted: { for(var i=0;i<textEdit.length;i++) { console.log(textEdit.positionToRectangle(i)); var object = Qt.createQmlObject("import QtQuick 2.0; Text{}",testItem); object.text = textEdit.text[i] object.x = textEdit.positionToRectangle(i).x } } } } @
  • How can I do 3D model without import QtQuick3D

    1
    0 評價
    1 貼文
    640 瀏覽
    尚無回覆
  • How to do 3D in QML ?

    3
    0 評價
    3 貼文
    1k 瀏覽
    U
    I've been thinking, how hard is to implement the few basic primitives as QQuickItems with custom geometry and use them in declarative to create compound objects. The scenegraph will do the same work, objects are just gonna end up taking a bit more space in ram, but will have the advantage of being more flexible, dynamic and reusable. Just plug a shader in it to get a material and voila.
  • Qml svg element id

    2
    0 評價
    2 貼文
    4k 瀏覽
    D
    So, I writed an own declarative item and now works. svgitem.h: @#ifndef SVGIMAGE_H #define SVGIMAGE_H #include <QDeclarativeItem> class QGraphicsSvgItem; class SvgImage : public QDeclarativeItem { Q_OBJECT Q_PROPERTY( QString source READ source WRITE setSource NOTIFY sourceChanged ); Q_PROPERTY( QString elementId READ elementId WRITE setElementId NOTIFY elementIdChanged ); QString mSource; QString mElementId; QGraphicsSvgItem* mSvgItem; public: SvgImage( QDeclarativeItem *parent = 0 ); QString source(){ return mSource; } QString elementId(){ return mElementId; } void setSource( QString source ); void setElementId( QString elementId ); signals: void sourceChanged(); void elementIdChanged(); }; QML_DECLARE_TYPE( SvgImage ) #endif //SVGIMAGE_H @ svgitem.cpp: @#include <QSvgRenderer> #include <QGraphicsSvgItem> #include "svgimage.h" SvgImage::SvgImage( QDeclarativeItem *parent ) : QDeclarativeItem( parent ) { mSvgItem = new QGraphicsSvgItem( this ); } void SvgImage::setSource( QString source ) { mSource = source; mSvgItem->setSharedRenderer( new QSvgRenderer( mSource ) ); emit sourceChanged(); } void SvgImage::setElementId( QString elementId ) { mElementId = elementId; mSvgItem->setElementId( mElementId ); emit elementIdChanged(); } @ Use: @SvgImage{ id: deck source: "william-tell.svgz" elementId: "back" } @ And the tutorial "here":http://www.developer.nokia.com/Community/Wiki/Creating_a_custom_QML_element_with_Qt
  • Unfreezing the QQmlEngine for script evaluation before GUI loading

    2
    0 評價
    2 貼文
    1k 瀏覽
    W
    I think you can use something like this: (I'm using this to load some QML model before the actual GUI loading, JSCode would be the same, I think.) @ QQmlEngine e; QQmlComponent global_object_component(&e, QUrl::fromLocalFile("global_object.qml"), QmlComponent::PreferSynchronous); QObject *global_object = global_object_component.create(); if (global_object) { e.rootContext()->setContextProperty("global_object", global_object); QQmlViewer view(e); view.setSource("GUI.qml"); view.show(); //at this point my QUI.qml can reference global_object } else { //error } @
  • [SOLVED] QQmlListProperty: QObject subclass usage

    4
    0 評價
    4 貼文
    4k 瀏覽
    J
    damm, had the same problem. for the record, the error message was Invalid property assignment: "roles" is a read-only property where Q_PROPERTY(QQmlListProperty<ModelRole> roles READ roleObjects)
  • A good way to allow editing of Model items?

    4
    0 評價
    4 貼文
    2k 瀏覽
    D
    [quote author="njeisecke" date="1368618421"]Models should be part of the business logic and belong to C++. Accessing model data is currently readonly. You must provide a Q_INVOKABLE setData method in your model if you want to modify data in a C++ model. [/quote] Thank's so much for your response and detailed reply neisecke.
  • How to perform tasks sequentially? [SOLVED]

    11
    0 評價
    11 貼文
    3k 瀏覽
    G
    Yeah, I managed to make a draft of a the manager. Now my application is waiting for the database before creating the interface. Like you said, I'll need to have a splashcreen to display the downloading of the database as it may take some time... thanks a lot.
  • [SOLVED] Need help at creating components module

    5
    0 評價
    5 貼文
    2k 瀏覽
    P
    Yep you where right. It has to be in the qml folder not in the import folder. Thank you very much. :)
  • [Solved] Can't dynamically add and display objects to QML from C++ (Qt 5.02)

    4
    0 評價
    4 貼文
    2k 瀏覽
    sierdzioS
    Cool :) Please prepend "[Solved]" to the topic's title (you need to edit your first post too do that), it might help some other bloke in need ;)
  • QGraphicsProxyWidget and KeyNavigation - not a QDeclarativeItem?

    2
    0 評價
    2 貼文
    1k 瀏覽
    T
    It sort of looks to me like I'm going to have to go through the whole business of putting a QComboBox into a QDeclarativeItem rather than a QGraphicsProxyWidget. If I've stumped the crowd here, I'm guessing that getting keyboard focus working with a QGraphicsProxyWidget would be hard.
  • Using QGraphicsView inside QML doesn't receive Touch Events!

    2
    0 評價
    2 貼文
    2k 瀏覽
    J
    Nobody has an idea? Workaround?