Blur an image in QML without using QtGraphicalEffects - qt

I want to make an image blur in QML without using the QtGraphicalEffects support.
If it is possible, can somebody please share me the sample to achieve this?

Related

Qt Virtual Keyboard: Set Custom Font Size

I have created a custom keyboard layout for my QtQuick application using the VirtualKeyboard in 5.9.2. I am trying to fit this keyboard on a small screen to make it more readable and usable than the Virtual Keyboard was stock.
There are two things I need to do which I cannot seem to make work:
Make the font larger on the keyboard buttons. After changing the layout, the buttons are larger, but the text on the buttons is still the same, tiny size. It looks strange.
Reduce margins surrounding the keyboard to use up more of the available screen space. The keyboard is already set to the width of the screen. I could make it larger, but if I could simply reduce the margins that would be a much more simple solution.
Any help would be appreciated!
you can use screen properties in qml and set font.pixelSize and margin according to screen height and width.
import QtQuick.Window 2.2
and use below properties
Screen.pixelDensity
Screen.height
Screen.width
The best way to solve this is by using a style.qml sheet. This is answered in a different question of mine located here: Qt Virtual Keyboard Custom Style

Is it possible to have a transparent video playing in QT application

Some codecs alow alpha transparency, like flv, Mov and Webm. I am about to build a QT app and i want to know if it will be possible to make a video player using QML which will support transparency and i will be able to see the background of my app even when the video is playing.
You can set a widget to have a level of transparency, so if the video stream is also transparent it should show transparent to the widget and then if the widget is also transparent then through that.
Have you already looked at the QML Video example which ships with the current QTCreator / QT 5.1.1 SDK package?. If you wish to draw a transparent/translucent video window, you can modify the 'opacity' property of a QML VideoOutput element to have translucent Video overlay.
You can build the example if you download and install the SDK.
Here's is the online link to the example:
QML Video Example
Take a close look at this file:
VideoItem.qml
You can modify the opacity as shown below:
import QtQuick 2.0
import QtMultimedia 5.0
VideoOutput {
id: root
height: width
source: mediaPlayer
opacity: 0.7 // Set the opacity as you wish
...
You can play around with the example by importing any type of video files you wish.

QML Video alpha-blending/rendering a video into a Qt Quick Scene Graph

I'm trying to get an alpha-blending effect in QML with a video in RGBA.
Now the problem is that the Video Item supplied by QtMultimedia actualy opens an overlaying window in the QtQuick scene, so I don't think it's possible to alpha-blend other QML elements with the Video element (I sure hope I'm wrong, but I can't find a solution).
So another way would be rendering a video myself in a class that inherits from QQuickItem, in the updatePaintNode method.
Has anyone seen anything like this before? Is it even possible if the guys behind QtMultimedia couldn't achieve it?
Can I maybe change the background of the MediaPlayer element, maybe to be transparent or just a color in QML?
So far I was thinking about QAbstractVideoSurface and QVideoFrame but I have no idea how to render it onto the QSG, or even how should the GeometryNode look for a video.
The best solution would be to get the alpha-blending with other QML Elements for example in:
Rectangle {
width: 1024
height: 768
color: "yellow"
focus: true
Video {
id: video
anchors.fill: parent
source: "alpha-video.mov"
autoPlay: true
}
}
Thanks in advance!
I tried a few things, but in the end I used the Qt example called VideoWidget that uses QAbstractVideoSurface and QVideoFrame, and painted the frames in a QQuickPaintedItem, using MediaPlayer to load the data from QML.
It's important to put ARGB32 on top of the QList that describes the supported pixel formats in the QAbstractVideoSurface, unfortunately the Qt logic is that they take the first availibe format and that's why the native Video element doesn't show the alpha channel (it plays the video in RGB32, either that or it's a thing with the overlaying window in the native element instead of painting it in the QtQuick Scene Graph).

How to define number of images in Qt image's carousel?

Well, i saw a Qt Quick Image's Carousel Example in http://developer.qt.nokia.com/wiki/Qt_Quick_Carousel. I adapted for my specific situation and it worked!
Ok, but i'm with problems still. I want to show just 4 images each time, but i didn't see something about this. I'm reading also a QML documentation in http://doc.qt.nokia.com/4.7-snapshot/qml-tutorial.html...
Do someone know how can i to show just 4 images each time in the that example code?
pathItemCount property from PathView will help you.

Flex Drag and resize

I need to draw Line, Circle, and rectangle by mouse drag on canvas and then i need to to move and resize the drawn shapes.
How i can perform this in flex as i am new on this platform.
Please suggest me the method or refer any example with source to make it understand to me.
Please Help.
Thanks in Advance.
There is no such native feature in Flex. But, there are a couple of options, commercial and not:
http://www.rogue-development.com/objectHandles.html (free)
http://www.flashcomguru.com/components/flex_whiteboard/whiteboard_demo/ (payed)
You can do it by hand, if you wish, it's not very hard. I advice you to use Degrafa (http://degrafa.org/) for the actual drawing since it is way easier than native drawing API and it is opensource.

Resources