Allow multiple buttons to be pressed simultaneously via multitouch in QT - qt

I’m looking to allow multiple buttons to be pressed at the same time when using a multi touch device for an application developed in QT for ios/android etc
I cannot for the life of me see how to do this.
Any help much appreciated

Qt's stock buttons use MouseArea, which doesn't support multi touch, amongst other things.
Use MultiPointTouchArea instead to implement your own multi-touch friendly buttons.

Related

Qt - globally enable touch scrolling

I've been using a wacom tablet lately on windows 10 and I do like how Windows natively supports gestural scrolling when you're using a tablet. In trying to implement this in my PyQt apps I was able to get kinetic scrolling working quite nicely with tablet events and a QScroller. However you need to do this for every (scrolling) widget you want to have support for it... So my question is: can this be somehow enabled globally? Perhaps this is a dumb question, but I think it would make sense to have this work for all widgets and scroll bars without reimplementing all over the place and extensive refactoring. Is there a clean way to replace all scroll areas or scroll bars throughout the app?

Recommended way for using GStreamer with Qt and QML?

Because of display up to 4 UDP/RTP streams in different modes (single / dual / quad) I first decided to use GStreamer. It works but it is not easy to handle and I can not switch between viewing modes during runtime. To solve that issue I want to use Qt (5.12.4) with QML.
I read a lot about the integration of GStreamer in Qt (QGStreamer, QMediaPlayer), different GStreamer plugins (qmlglsink) and so on. At the end of the day I always end by the QMediaPlayer which integrates since Qt 5.12.x a gst-pipeline element.
I realized a Qt-QML application that show 4 UDP/RTP streams as a kind of preview and when I choose one of this previews it changes to full screen mode. A further tap on the full screen image changes back to preview mode.
BUT the performance is not really satisfied. Either one ore two previews are frozen and when I tap them the full screen is working or the preview is running and the full screen is frozen.
This leads me to the questions:
Is there a performance issue with my embedded device? -> I will check that soon. I can exclude a bandwith problem because only GStreamer works.
Is MediaPlayer with gst-pipeline the right way?
Are there other solutions with more performance using Qt with QML?
Thanks.

QML, code once, deploy twice

I am creating an application in QML. Initially it was for desktop use only, but I decided to cover Android devices too.
The problem I'm struggling with is how to handle different platforms. For now, I have a separate class that provides informations about screen ratio, platform(mobile, desktop) orientation etc.
What is the best approach to provide UX closest to native, for each platform?
How to handle situations like this?
Mobile
StackView with 2 pages
ListView taking entire screen space
Clicking on object in the ListView navigates to the second page with
additional info
Desktop
No StackView
ListView taking only 300 pixels
Additional info about currently selected element on the list should
be visible in TextArea next to ListView
Designing scalable UI, based on calculated screen ratio or pixel density for a given device is one solution. But, this kind of mobile-ish interface looks pretty bad on desktop. Can you imagine Android Gmail app running on PC?
The solution I see is to place as much logic as possible into C++ and create lightweight layouts for both mobile and desktop platforms in QML.
What is, in your opinion best way to target multiple devices. Should I create scalable UI for mobile and use it on desktop and just 'deal with it' or should I sacrifice more time and create UI for each platform so that it will be user friendly everywhere?
Should I create scalable UI for mobile and use it on desktop and just 'deal with it' or should I sacrifice more time and create UI for each platform so that it will be user friendly everywhere?
This question is quite subjective, and we haven't seen the UI in question, but in my opinion, you should sacrifice more time and create a decent UI for desktop and mobile. This is assuming that the desktop version of your application has enough content and/or features to warrant it.
The solution I see is to place as much logic as possible into C++ and create lightweight layouts for both mobile and desktop platforms in QML.
This is the right approach. QML is super easy to write, and super easy to maintain as long as you keep it simple. Qt Quick Controls learned this the hard way, and this is why Qt Quick Controls 2 are being created: to use as much C++ and as little JavaScript, expensive bindings, Loaders etc. as possible.

Creating a home screen for my embedded board using Qt/Qt Quick

I am not an expert but I have been using Qt/QtEmbedded for sometime now, for SBC 6845. I have created a few applications and have successfully run them on my device.
Now I want all of those applications to appear on a home screen. I understand that using QML/Qt Quick this might be achieved, but I don't have any idea on how to proceed with it. I have gone through some links and tutorials but most of them show how to create buttons and all that with Qt Quick, but not much than that. I am yet to find some tutorial/docs which can point me how to proceed with all applications on my home-screen. I need some directions, any links, advice on docs/books is welcome.
[While cross-compiling the QtEmbedded 4.6.2 libraries for my SBC I encountered problems with enabling opengl support. And, I am unaware of the other methods for using QtQuick2 without opengl.
The applications (5-6 of them) are QWidgets and linking icons require to stay in the home screen. I want to keep them as simple as possible without any effects for the icons.
Plainly speaking, I am trying to create a bunch of icons displayed on the home screen linked to those applications. The applications if launched in windows style application, (or like a popup QDialog) will also serve my purpose.]
Thanks.
"I have gone through some links and tutorials but most of them show
how to create buttons and all that with Qt Quick, but not much than
that"
For this part of the question, I'd advise you to download QtCreator
and start playing with the demos (using more than just some buttons:
you have demos for ListViews, GridViews, Delegates, Animations,
Particles, QtQuick Layouts (Qt5.1 only), QtQuick Controls (Qt5.1
only).
There's also the rather complete :
http://qt.gitorious.org/qt-labs/qt5-everywhere-demo
I'm completely unfamiliar with all the embedded/cross-compiling
aspects of your question.
About OpenGL/QtQuick2 : http://qt-project.org/forums/viewthread/30483
http://qt-project.org/forums/viewthread/17201
Also note that you can embed QtQuick2 scenes into a QWidget, but not
the other way around (no QtWidget inside the scenegraph).
So maybe the easiest/fastest way to go for you would be to stick with Qt4 or Qt5 declarative/QtQuick1 module (might be deprecated/removed starting with Qt 5.2). In this setup, there is no scenegraph/mandatory need for OpenGL. And you can embed QWidgets into your qml scene (no scenegraph: it uses the QGraphicsView backend) via QGraphicsProxyWidget.
You'd then have some GridView (you also could use some Grid with a Repeater) filled with models and delegates (= a delegate acts as a template item to be filled with the model).
Your delegates would have states/maybe Loader(s) (for on-demand loading) : icon state and when clicked, some maximized state containing a loader, loading your widget through QGraphicsProxyWidget.
You already have half of this presented in this example (a grid + 2 states : small icons grid and maximized view, you only need to implement the delegate/loading/model/QGraphicsProxyWidget things):
http://developer.nokia.com/Community/Wiki/Implementing_parent_change_animation_with_QML

Is there a way to utilize the Mac Laptops' touchpad pinch gestures on Flex?

I have written a Google Maps-based application in Flex. Currently you can use the mouse wheel to zoom in and out the map. Is it possible on Mac laptops to use the pinch gesture to zoom?
Not without some hacking. There's MultiCluch, which is an InputManager that lets you assign gestures to keyboard shortcuts, which might be a starting point.
In any case, you're in for some pain, because there's (currently) no (public) way to do this even in Cocoa.

Resources