qml

How to implement pagination in a Qt 5.2 QML app

狂风中的少年 提交于 2019-12-22 23:36:54
问题 I am trying to make an app which shows 3 pages at a time. The central page shows 3 rectangles displying sql query results 1-3 , the left page is a link to an image from query result 4, and the right page is also built from the same query and has a different layout. Now I am unable to fit these 3 pages into a listmodel and use pathview to make it look like a paginator, because all 3 pages are incongruent and not really a model, hence giving me error ListElement: cannot contain nested elements.

How to implement pagination in a Qt 5.2 QML app

99封情书 提交于 2019-12-22 23:35:35
问题 I am trying to make an app which shows 3 pages at a time. The central page shows 3 rectangles displying sql query results 1-3 , the left page is a link to an image from query result 4, and the right page is also built from the same query and has a different layout. Now I am unable to fit these 3 pages into a listmodel and use pathview to make it look like a paginator, because all 3 pages are incongruent and not really a model, hence giving me error ListElement: cannot contain nested elements.

How to show a phonepad with a certain number in Blackberry Cascades

点点圈 提交于 2019-12-22 14:00:32
问题 I am using Blackberry Cascades 10 Beta 3 SDK with C++ QT & QML with the Blackberry 10 Dev Alpha Simulator and the QNX Momentics IDE, and I'm trying to implement the ability to click on a button with a phone number from QML and have it bring up a dialpad with that number in from at which point the user should be able to press call and it would call that number. The following is the sort of thing I have done: Button { text: "555-555-5555" //just a sample number - I don't actually use this

Custom listModel does not notify the view

家住魔仙堡 提交于 2019-12-22 12:41:37
问题 I have my custom list model where I put data which should be displayed on the QML view. But for some kind of reason the view in QML sometimes is updated normally, sometimes with previous data and sometimes updating is not performed. Here is the function where I fill the model - this function is called from some other thread. void MyScreen::fillListModel() { const QString SEPARATOR = " "; myListModel->resetModel(); for (int i = 0; i < MAX_ROWS; ++i) { QString key = QString::fromUtf16(MyData:

How to embed QML toolbar and menubar into QMainWindow

扶醉桌前 提交于 2019-12-22 12:26:30
问题 I am using QWT library to plot data. It seems that it is not possible to embed QWidget into QML Quick 2 . So, I decided to create QMainWindow as my main window and create its toolbar and menubar using Quick Controls . How should I embed that qml toolbar and menubar into QMainWindow ? 回答1: You should create QML ApplicationWindow with QML MenuBar and ToolBar main.qml ApplicationWindow { visible: false menuBar: MenuBar { Menu { title: "Edit" MenuItem { text: "Cut" } } } toolBar: ToolBar { Row {

How to embed QML toolbar and menubar into QMainWindow

我们两清 提交于 2019-12-22 12:26:17
问题 I am using QWT library to plot data. It seems that it is not possible to embed QWidget into QML Quick 2 . So, I decided to create QMainWindow as my main window and create its toolbar and menubar using Quick Controls . How should I embed that qml toolbar and menubar into QMainWindow ? 回答1: You should create QML ApplicationWindow with QML MenuBar and ToolBar main.qml ApplicationWindow { visible: false menuBar: MenuBar { Menu { title: "Edit" MenuItem { text: "Cut" } } } toolBar: ToolBar { Row {

How to use QWebEngineUrlRequestInterceptor

家住魔仙堡 提交于 2019-12-22 11:11:04
问题 I need to intercept requests made in our WebEngine qml component in our Qt application. I have found documentation on QWebEngineUrlRequestInterceptor which seems to do just this here http://doc.qt.io/qt-5/qwebengineprofile.html#details and here http://doc.qt.io/qt-5/qwebengineurlrequestinterceptor.html#details. However I haven't found any code examples on how to do this in Qt/C++. Any help is appreciated. 回答1: Managed to puzzle it together with the help of this post: https://forum.qt.io/topic

QML - MouseArea/MouseEvent issue

混江龙づ霸主 提交于 2019-12-22 11:10:24
问题 The following piece of code generates a white rectangle containing a red rectangle and a grey rectangle. Every rectangle has an associated MouseArea. The grey rectangle becomes blue when the mouse is clicked inside it. The red rectangle prints a console message when the mouse cursor enters inside it and another message when the released signal is emitted. I would like to: press and hold the mouse button inside the grey rectangle (becoming blue) move the cursor outside the grey/blue rectangle

How do I correctly handle mouse events in a QML TableView with overlapping mouse areas?

[亡魂溺海] 提交于 2019-12-22 09:53:43
问题 I've got a delegate attached to my TableViewColumn that contains a MouseArea . I use the MouseArea to detect double clicks on individual cells in the table, which allows me to show a TextField for editing purposes. The problem is the delegate MouseArea blocks mouse events from propagating through to TableView . This means that the selection behaviour of TableView no longer works. Specifically, I have SelectionMode.ExtendedSelection enabled. The MouseArea child item is simple and originally