Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

own embedded QML Notification Center as Notification Center of Android or iOS

$
0
0
no, i mean else things. but thank you for your answer! i mean i want create dragdown notification panel. as it was made in ios and adroid- so it place for a clock, unanswered calls and news. i want make absolutelly as ios drag-down information panel by qml. it functional named Notification center. Hi, _dmp If I understand you correctly you want to fire some action when user is scrolling content to up or down, right? If this true, you may use signals for this. Qt is based on slot-signal technology. It’s looks like iOS Notification centre. Please read more about signals from this link [qt-project.org] or here [qt-project.org]. QML object have a property which can be changed and you may use signal which called every time when property has changed value. it’s work for all standard components from QML. If you using custom component you must create signal yourself. It’s simple, all you need it’s added to your C++ class code like this: class Logger : public QObject {         Q_OBJECT           Q_PROPERTY(QString version READ getVersion WRITE setVersion NOTIFY versionChanged)       private:         QString m_version;         public:         inline QString getVersion(){return m_version;}   //Getter         inline void setVersion(QString ver){m_version = ver; emit versionChanged(m_version);} //Setter       signals:         void versionChanged(QString data);  //signal which called when you change the property } In the QML you may use it like: import QtQuick 2.0 import <access_to_your_cpp_module> 1.0   Rectangle {     Logger{         version: "1.0.0"         onVersionChanged: {             //Some code here which called when value of version property was changed.         }     } } I’m not check the code, so I’m not sure is it work or not, so if you have any problem leave post here, I will trying to help. If you not understand how to find signal for standard component you may try do this using a simple rule: All signals in QML have a prefix “on” and suffix “Changed”. For example, is your component have a property with name “onAgeChanged” the name of signal will be “onAge” and so on. Also, you can create custom signal in QML components please look here [qt-project.org] for more information.

Viewing all articles
Browse latest Browse all 4972

Trending Articles