error dialog box with Qt quick - qt

i'm programming a Qt Quick application and I'm looking for a possibility to display the user errors. In Qt widgets there is QMessageBox but i can not find any equivalent to this in Qt Quick.
Sure i can create a MessageBox by myself but I can't imagine that there is no given possibility?
I found an ebook on the official site here and there is an Dialog described on page 67 but it doesn't work anymore and i can't find any further information about that. Is it dropped in the current version?
Thanks in advance

There is no Qt-Quick component for this yet. What I do in my application is using the Window QML component. I set the modality property to Qt.WindowModal to have it as a modal Window. You can then use the Button component to create OK/Cancel buttons.
Another thing I do is create these modals dynamically when something wrong occurs using Qt.createComponent() in QML.
Edit: Just discovered a new Dialog component that will be released in Qt5.2 that seems to match what you are looking for: MessageDialog

Related

Daydream keyboard implementation

I am attempting to implement the Daydream keyboard into an app built in Unity and am not able to get this to work. I have added the keyboard prefab as a sibling of the main camera and added two input fields with the onpointerclick function added as instructed. I however get a null reference exception and assume this is due to the daydream keyboard delegate field being blank. The example scene in the SDK shows the daydream delegate example prefab but I am unsure how to implement this for two input fields. Also does the keyboard render in the Unity editor or must it be built and run on a phone?
This is an old question and has probably already been answered, but I figured I'd publicize my answer anyway.
For those reading, if you haven't checked out the Keyboard Demo scene that can be found within the Demos folder of the Google VR Unity package, I would highly recommend doing so. Following this object hierarchy has worked for me in the past.
To answer your first question, it seems that they have included a KeyboardDelegateExample object within the scene's hierarchy, and then used this object as the Keyboard Delegate in the GVRKeyboardManager.
They manage to fake an Input Field by creating a background and overlaying a Text object on top. If this method does not suffice and using an Input Field is crucial in your particular case, then drop your Input Fields into two separate GVRKeyboardCanvas objects.
Clicking on either canvas will activate the GVR Keyboard. You may have to add a small script to manage the transitioning of the input field.
Lastly, no the GVR Keyboard does not render in the Unity Editor, it only appears while running a build. Hopefully this will be addressed in later releases. There are also Keyboard plugins that you may find useful on the Asset Store.

Use condition in the Qt Creator designer

I'm pretty new to Qt, and I can't find an answer to very basic question:
is it possible to use conditions when using the ui designer?
for example, that if a var x is set to true widget 1 will be displayed, otherwise widget b will be displayed in the same area?
I know how to do it in the code but wondered if it possible using the design tool...
In my experience there is not a way to do it using the designer in a QWidgets application, though I have to admit I never really tried to do that. In a Qt Quick QML application you can probably use a binding on the visible property to hide/show the desired item.

Qt creator - make a dynamic interface

I am working on a small UI with QT Creator and its drag-n'-drop tool (QT Designer). Everything was fine till I realized I had to make some widgets dynamic. For example, I have a checkbox and I want some button to appear only if this checkbox is checked by the user or I would like to change the appearance of another widget when the user clicks on some button.
Is it possible to do it only with QT Designer?
Yes, but it's very limited.
Qt designer have signal&slot editor. Yes, you can connect signal clicked(bool) to setVisible(bool) slot on button and make button visible only when checkbox is checked (see screenshot).
But when You need more complex dynamic interface (e.g. creating buttons), designed will not help You.

How to add About dialog to project

I have just completed my first Qt 5 project and I want to add an About dialog. Is there a default, and how do you use it? If not, what's the best way to add one and edit it and display its content using the Help menu action? Any help would be appreciated. Thanks in advance.
The way to add a dialog to your project depends a little bit on what development environment you are using. You can always use QtDesigner (part of Qt) to design your About dialog and then add it to your project. To display it, just call the exec() function of the QDialog class in a slot connected to the triggered() signal of your About QAction object.

How to make a slide up modal page in Meego?

I'm developing an app which works more or less like the Notes app. When user click the + button a modal window with TextEdits is to be slided up,just like the Notes app did. However I was unable to locate any resource mentioning this kind of thing. Any clues?
I think you are looking for the QML Sheet element. You will need to implement the TextEdit part yourself.

Resources