I have a video output embedded in a QML view. It is working fine, but I want to make that video output go fullscreen when I click on it.
Every time, some images that are in the view (some sibiling, and some not) are visible on top of my video. In fact, it should fill the root element, and be at the front screen.
Changing the z property doesn't do anything.
What is the best trick to make a video go fullscreen? When I switch from normal to fullscreen, the video should continue its flow with no interuption.
A solution only in QML (and no C++) would be preferable, as I build my QMLs by parsing XML files.
You can create new fullscreen window from QtQuick.Window module and pass tpo that window video path,time and play.
Component {
Window{
id: videoWindow
flags: Qt.FramelessWindowHint
HereYourPlayer{
}
}
}
than you should create that Component and call videoWindow.showFullScreen()
I finaly found the solution I needed. In fact it was simplier that it seemed. I created an Item just under the root, and I changed the parent of my video element when I wanted to go fullscreen. I put my new Item as the parent of my video element.
I didnt know that we could change the parent of an element.
Related
I have an app which is small in terms of width and height, I want a popup to show when a button is clicked. Problem is the popup is larger than the app window and when i open it, it scales down and looks weird
APP
APP WITH POPUP
POPUP CONTENT IN DESIGNER
How can i make the popup independent from the app window, like this:
Or is there a better approach rather than using popup, it would be nice if i were able to move the popup/window around. It still needs to be somehow connected to the main app because it get's data from there
A Popup in QML appears as a layer on top of the parent window, so it cannot be bigger than the parent window. If you want a separate, top level window, you should use a Window or a Dialog instead.
I've gotten it sorted out. I encapsulated the component i wanted to show inside a window and created it using Qt.createComponent()
var playListComponent = Qt.createComponent("CustomPlaylist.qml")
var window = playListComponent.createObject(rootWindow)
window.show()
The root element of CustomPlaylist.qml is a Window
The application I currently work on has a map as a background, and above it various other dialogs(views) with more than one view inside can be opened. When some of the dialogs is active, when dragging over it's background map is moving like there's nothing above it. Does someone know how to disable this? I don't want map to react on clicks or anything inside a dialog.
The project is organised so that each dialog is implemented in separate qml file:
I have each qml file for each dialog, and each component of application (map), so
when you click, for example on settings tab in scrollable horizontal list, settings tab is opened from qml that holds all dialogs, including bottom and top of the app
each dialog is above map and has a 50% transparent background, with related images and buttons in it
I want to disable dragging map while dragging over dialog's background. I tried with setting this to each dialog:
MouseArea {
anchors.fill: parent
onClicked: mouse.accepted = true
}
(parent is Item that holds all elements of a dialog), but this doesn't work.
If I'm understanding your question correctly, it should suffice to set the MouseArea's propagateComposedEvents to false.
I use QtQuick 1.1 and I have an item like this below:
Item {
id: myItem
width: 12345
height: 12345
//...
}
When I run my qml project, it doesn't show any scroll bar for this item (horizental and vertical).
How can i add scroll bar to it? And if I use Qt and QML together (using a QWidget and QDeclarativeView on it), then what's the solution?
Making UI using qml is kind of UI paradigm shift when compared to making desktop widgets. What you are expecting is a normal desktop widget behavior, which is absent in the most mobile platforms UIs. In them, usually, scroll bars are associated with the lists and not with complete pages.
You can however implement that in qml as well. You can have the top element as flickable instead of a rectangle, and the show the scroll bars yourself based on flicks on the page. Try to go through the qml RSSfeed example to understand how you can use combination of flickable and other elements to achieve this.
P.S. : Also, see the qml desktop components introduced in Qt5. They will give you the widget behavior. See if it fits what you want.
But again, you should ask yourself, what exactly are you trying to achieve here ?
The flex title window component is nice and all, but before it shows up it insists on blurring out the background of your window if it's set to modal. What if I want it to just show up immediately or at least speed it up so that the user doesn't have to wait around to enter data. Am I going to have to build a custom component based on TitleWindow to get this or not have it be modal? If I were to do that could I extend current TitleWindow or just copy out the source directly?
Play with Application styles, such as modalTransparencyDuration.
Yes, you can apply those in the CSS:
global {
modalTransparencyBlur: 2;
modalTransparency: 0.8;
modalTransparencyColor: #000000;
modalTransparencyDuration: 500;
}
In your PopupManager set the modal to false.This will allow the user to interact with other popups.
PopUpManager.addPopUp(titleWindow, this, false);
I'm aware of PopUpManager and that custom modal windows can be created.
But let's say I have a simple Canvas(or any component) and when I show it the background needs to be blurred out like how PopUpManager does when a new pop-up is shown.
Is this possible?
Not without a lot of work. The PopupManager puts a blur on Application, and then puts the popup in front of the Application, but as a child of the SystemManager, so it's a sibling to the Application in the display list rather than a child. You could take a screen shot of the Application, run a blur filter over it, and place it as the last child of Application, and then place your component on top of that, but if you do that you might as well just use PopupManager in the first place.
I think the blurring has to do with how you set the alpha level on the component.