[Interest] Modal Dialog with QQuickView in Qt5

Mitchell Verter mitchell.verter at gmail.com
Sat Sep 7 00:30:25 CEST 2013


got it!  use eventloop instead!  sorry for clogging up the list!


On Fri, Sep 6, 2013 at 6:18 PM, Mitchell Verter
<mitchell.verter at gmail.com>wrote:

> In Qt4, I was able to implement a modal Keyboard Dialog by doing
>
> ModalKeyboard::ModalKeyboard(QWidget *parent) :
>     QDialog(parent)
> {
>     setModal(false);
>     keyboard = new QDeclarativeView(this);
>     keyboard->setSource(QUrl::fromLocalFile("qml/main.qml"));
>     keyboardObject = keyboard->rootObject();
> }
> ...
> void ModalKeyboard::exec()
> {
>     keyboard->show();
>  QObject * keyboardValueLabel =
> ((QObject*)keyboardObject)->findChild<QObject *>("keyboardText");
>  QDeclarativeProperty(keyboardValueLabel, "text").write(typed);
>     QDialog::exec();
> }
>
> However, there is no more QDeclarativeView in Qt5.  Instead there is a
> QQuickView, which has a QWindow as a parent, not a QWidget and therefore
> not a QDialog.
>
> Is tere a way to replicate the same bheaviour, to have the application
> block until the user accepts the keyboard input?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130906/e4449afe/attachment.html>


More information about the Interest mailing list