跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.4k 貼文
  • How QObject got notified when children add in

    2
    0 評價
    2 貼文
    577 瀏覽
    A
    Events are used for that. Reimplement bool QObject::childEvent(QChildEvent* e); and do your magic :)
  • [Solved] qml: problem with TableView refresh on model update

    6
    0 評價
    6 貼文
    8k 瀏覽
    A
    uhm. dataChanged works. There is something wrong elsewhere. index in dataChanged is wrong, not only elementsSize()-1 but also for the columns you are using 4 instead of 2. That could be a reason. Did you tried to see if data is invoked after the call to showPasswords. Also in showPassword you are updating this->showPsws while in data you are using this->hidePsws. Could be that data is called but you are returing always the same value.
  • Reinventing the wheel: qtQuick input widgets

    4
    0 評價
    4 貼文
    1k 瀏覽
    JKSHJ
    You're welcome. [quote author="jsprenkle" date="1423144212"]I was surprised that the Qt4 widget version of the input control provides a property that indicates if the input was changed but the qml version does not. It would be used to determine if writing content back to the database was required after the form is dismissed.[/quote]You can implement it yourself in two lines: @ TextInput { property bool isModified: false onTextChanged: isModified = true } @ To unset the flag, just call isModified = false [quote author="jsprenkle" date="1423144212"]Maybe I can start with the code from the widget and refactor it to inherit from QQuickItem.[/quote]I recommend implementing it in QML. It's much less effort.
  • Admod in qt 5.3

    4
    0 評價
    4 貼文
    2k 瀏覽
    SGaistS
    Probably missing something like @./android@ to call the executable
  • [WIP] C++/QML fully recursive TreeView

    5
    0 評價
    5 貼文
    2k 瀏覽
    M
    Ohh, I see it now. I've added the missing files. I messed things up with .gitignore. Sorry about that, and thanks for spotting
  • How to call qml signal handler synchronously from cpp code from another thread?

    3
    0 評價
    3 貼文
    1k 瀏覽
    R
    bq. Connect with a BlockingQueuedConnection AFAIK you can not connect to a signal handler manually. Connection is generated by qml, qml creates signal handler and I don't know a way to change that.
  • Is there some kind of destroy/close event for QQuickItem?

    2
    0 評價
    2 貼文
    1k 瀏覽
    A
    Handle the close event in the QQuickWindow or QQuickView. You have to reimplement event() in a subclass since there is no virtual closeEvent() function in QWindow. Then handle QEvent::Close, call the base class implementation for all other event types. In the Close event handler change the event's accepted flag to false so the window won't actually close. Then initate whatever you need doing. When it's done, exit the app (and make sure your close event handler recognizes this and accepts the event)
  • Qml - QtWebEngine, QtWebKit, QtWebView

    1
    1 評價
    1 貼文
    2k 瀏覽
    尚無回覆
  • Qt iOS: access to local .js file

    2
    0 評價
    2 貼文
    887 瀏覽
    SGaistS
    Hi, AFAIK, you are trying to do something forbidden on iOS i.e. modifying your app bundle. IIRC download code to run in your application is also something that's forbidden. You should rather use one of the official accessible folder that you can get through QStandardPaths::AppDataLocation but again, I'm not sure you'll be able to get your application through the AppStore with that download code part. Hope it helps
  • [SOLVED] Qt 5.4.0 does not compile statically with -opengl dynamic

    6
    0 評價
    6 貼文
    2k 瀏覽
    H
    And it has been fixed \o/ https://codereview.qt-project.org/#/c/103908/ It was accepted after the 5.4.1 downmerge so it will be in 5.4.2
  • Scrollbar ? Like the "a-z" sidebar list in the Apple "Contacts" app

    3
    0 評價
    3 貼文
    1k 瀏覽
    P
    Thx. Kind of expected that.
  • QML ListView does not reflect updates from its C++ data model [Solved]

    16
    0 評價
    16 貼文
    7k 瀏覽
    K
    Okay, I did manage to get this to work finally. When clearing data, I used: @ beginResetModel(); m_data.clear(); endResetModel();@ When removing an individual item in the data, I used: @ beginRemoveRows(QModelIndex(), index, index); m_data.removeAt(index); endRemoveRows();@ And I worked on this bit of code separately from my main application. Will have to see what kind of fun awaits when I merge the changes with the rest of the application ;) Appreciate the help folks!
  • How to mix QML view part with a Qt model code.

    3
    0 評價
    3 貼文
    844 瀏覽
    Q
    If you are looking for another example, you can take a look at "the QxModelView module of QxOrm library":http://www.qxorm.com/doxygen/html/group___qx_model_view.html : this is an implementation of the QAbstractItemModel Qt class and allows to display in QML views (and Qt Widgets too) all classes/properties registered into QxOrm context. The source code is available in the QxOrm package. There is a FAQ here : http://www.qxorm.com/qxorm_en/faq.html#faq_300 And there is a sample project in the ./test/qxBlogModelView/ directory of QxOrm package. And with QxEntityEditor, you can also generate the source code for nested models to manage relationships between entities (1-n, n-1, n-n, 1-1).
  • QChart animation

    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆
  • Mixing qrc and local QML files

    5
    0 評價
    5 貼文
    2k 瀏覽
    F
    Hi, I've just posted on a similar thread, how it is possible to mix qrc and non-qrc files with "V-Play":http://v-play.net... You can find the forum thread "here":http://qt-project.org/forums/viewthread/52478/P15/#217901. Cheers, Chris
  • Problem with dynamically loaded images when using Qt Resource System

    17
    0 評價
    17 貼文
    8k 瀏覽
    F
    Hi, I thought I'd step into this thread, maybe you can benefit from our learnings.. We have also been seeing issues with qrc in our projects, and the default Qt implementation has a couple of disadvantages: It is ugly to have to change the qrc:/ scheme in all your images - ideally you would not need to change the scheme when you switch between qrc and non-qrc Qrc has problems if the size of all combined images gets bigger than 50MB. Thus ideally you would ship the image assets separately as non-qrc, and use qrc for your qml files (to protect them from outside use). However, you still should have the option to also put the assets into qrc, if exposing your image files is a problem. That's exactly what we allow to do in V-Play: the QML & JS files are put into qrc files (this also makes sure no one can read your source code) – the assets are put into an own assets folder and are deployed with DEPLOYMENTFOLDERS += assets in the .pro file. You can also use qrc for assets if your prefer, but it has some limitations like the 50MB limit). That way, you don’t have the size limitation of qrc files (at above ~50MB qrc hangs). Also, during development working with DEPLOYMENTFOLDERS is better on Desktop, because you can just re-run your application and dont need to recompile. What we did additionally, is to abstract the file access, i.e. you dont need a prefix assets:/… for your images, or mix up your code with any qrc:/… prefixes. You can have a look at some .pro files of our games by downloading the "V-Play SDK":http://v-play.net and then check out the <QtSDK>/examples/V-Play/demos directory. I’ve also posted some comments about the qrc approach set as default since Qt Creator 3.1 on the Qt Blog, maybe that’s interesting to the pros and cons of it (and why I think it’s bad..): http://blog.qt.digia.com/blog/2014/03/04/qt-creator-3-1-beta-released/#comment-1193034 Hope that helps, Chris
  • Ticks labels on QValueAxis / QAbstractAxis

    1
    0 評價
    1 貼文
    735 瀏覽
    尚無回覆
  • Non rectangle/custom shape button in QML. HOW?

    2
    0 評價
    2 貼文
    2k 瀏覽
    JKSHJ
    Hi, You can use a custom-shaped image with transparency.
  • Exposing object from C++ to qml returns null

    6
    0 評價
    6 貼文
    2k 瀏覽
    p3c0P
    Glad that its working :) Don't forget to delete that object or there would be a memory leak. Since it is in NotificationWindow widget you can pass it as a parent using this to MessageBoard so that when NotificationWindow gets deleted so does MessageBoard gets too.
  • [solved] Flickable: Items added from C++ not moving

    4
    0 評價
    4 貼文
    1k 瀏覽
    p3c0P
    Glad that it worked :) You can mark the post as solved by editing the post title and prepend [solved].