[PyQt] QtQuick ApplicationWindow
Fabien Castan
fabcastan at gmail.com
Sun Nov 17 12:37:32 GMT 2013
I use it on desktop. It's in QtQuick.Controls.
http://qt-project.org/doc/qt-5.1/qtquickcontrols/qml-qtquick-controls1-applicationwindow.html
2013/11/17 Jens Persson <xerxes2 at gmail.com>
> AFAIK there is no such thing as an ApplicationWindow in QtQuick. Where did
> you find that? It exists in Silica though.
>
> Greets Jens
>
>
> On Sun, Nov 17, 2013 at 1:12 PM, Fabien Castan <fabcastan at gmail.com>wrote:
>
>> Oops... Thanks!
>>
>> Now, I have 2 strange things:
>>
>> 1) If I put all the code into a function, the application stay stuck when
>> I try to close it.
>>
>> https://github.com/buttleofx/testsQml/tree/qmlApplicationWindow
>> > python3 testQmlApplicationWindow.py
>> A
>> B
>> C
>> D
>> E
>> F
>> <Here the application is created, I can use it>
>> <Now I close the application>
>> Z
>> <But it stays stuck here... I have to kill it.>
>>
>> The 'print("End")' is never called.
>> If I create the QGuiApplication outside of the function, it works fine.
>> Something like:
>> "
>>
>> if __name__ == '__main__':
>> app = TestApp(sys.argv)
>>
>> main(sys.argv, app)
>> app.exec_()
>> "
>>
>>
>> 2) The second problem is that I can't override the notify function of the
>> QGuiApplication.
>> In my sample code there: https://github.com/buttleofx/testsQml/tree/
>> qmlApplicationWindow, the code is commented...
>> If I uncomment the notify function:
>> > python3 testQmlApplicationWindow.py
>> A
>> B
>> C
>> <It stays stuck here... I have to kill it.>
>>
>> So it stays stuck on the "component.loadUrl()"
>>
>>
>> Regards,
>> Fabien
>>
>>
>>
>> 2013/11/16 Phil Thompson <phil at riverbankcomputing.com>
>>
>>> On Sat, 16 Nov 2013 20:22:50 +0100, Fabien Castan <fabcastan at gmail.com>
>>> wrote:
>>> > Hi,
>>> >
>>> > I'm trying to create a qtquick application using PyQt5.
>>> > I would like to use an ApplicationWindow as the top level item of my
>>> qml
>>> > file. To do that, I shouldn't use the QQuickView but directly
>>> QQmlComponent
>>> > as it's done here with a non-graphic example:
>>> > http://pyqt.sourceforge.net/Docs/PyQt5/qml.html
>>> >
>>> > My sample code:
>>> > https://github.com/buttleofx/testsQml/tree/qmlApplicationWindow
>>> >
>>> > But it crashes:
>>> > A
>>> > B
>>> > C
>>> > D
>>> > QObject::connect: Cannot connect (null)::destroyed(QObject*) to
>>> > QWindow::screenDestroyed(QObject*)
>>> > Erreur de segmentation (core dumped)
>>> >
>>> > Same result if I use Window instead of ApplicationWindow.
>>> >
>>> > Any idea?
>>> >
>>> > Regards,
>>> > Fabien
>>>
>>> It's not a non-graphic application. Use a QGuiApplication instead of a
>>> QCoreApplication.
>>>
>>> Phil
>>>
>>
>>
>> _______________________________________________
>> PyQt mailing list PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20131117/80a9c267/attachment-0001.html>
More information about the PyQt
mailing list