[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] PyQt5==5.7.1 Missing libQt5QuickTest.so.5
From: Elvis Stansvik <elvstone () gmail ! com>
Date: 2017-11-16 9:09:47
Message-ID: CAHms=eZjsor4E7K5wNnSZFwEZfDUj556bkQ5bM=CG-z58Jou1w () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Den 15 nov. 2017 6:00 em skrev "Cody Scott" <cody@perspexis.com>:
My current plan is to use the pyqt5qmlplugin with qmltestrunner. You can
compile PyQt5 from source to build the pyqt5qmlplugin and then create a qml
plugin so that you can register types defined in Python and use them with
qmlscene and qmltestrunner.
Here is a basic example
https://github.com/Siecje/qmlplugin/commit/6d591abf3784ee858acf2853ff05e6
c9b2abce07
Please let me know if you can't get this working and I will be able to help.
Ah, thanks for the pointers. A little unfortunate that it will require a
custom pyqt build, since we're currently relying on the pre-built one. But
if I go ahead and start looking at tests for our app I'll evaluate your
approach.
Elvis
On Wed, Nov 15, 2017 at 10:25 AM, Elvis Stansvik <elvstone@gmail.com> wrote:
> 2017-03-16 13:06 GMT+01:00 Phil Thompson <phil@riverbankcomputing.com>:
> > On 14 Mar 2017, at 4:20 pm, Cody Scott <cody@perspexis.com> wrote:
> >>
> >> The types defined in C++ need to be registered before calling
> QUICK_TEST_MAIN()
> >>
> >> https://github.com/qt/qtquickcontrols/blob/5.8/src/controls/
> plugin.cpp#L159
> >>
> >> Sorry if I don't understand your question.
> >
> > If you look at what QUICK_TEST_MAIN expands to (a complete self
> contained main() function), there is no opportunity to register the types.
> The code you refer to is implemented in a plugin which (I assume) gets
> loaded by the internals of QUICK_TEST_MAIN. Plugins don't play well with
> Python - see the restrictions on using qmlscene.
> >
> > I will look at how to test QML from Python in the future - but not at
> the moment (unless somebody has a bright idea).
>
> (Sorry for necroposting.)
>
> Just wanted to ask what the story is nowadays? Is it possible to test
> PyQt+QML apps that use registered Python types with Qt Quick Test? [1]
> Or do people only do manual testing of their apps?
>
> Elvis
>
> [1] http://doc.qt.io/qt-5/qtquick-qtquicktest.html
>
> >
> > Phil
> >
> >> On Sat, Mar 11, 2017 at 1:59 PM, Phil Thompson <
> phil@riverbankcomputing.com> wrote:
> >> On 8 Mar 2017, at 4:53 pm, Cody Scott <cody@perspexis.com> wrote:
> >> >
> >> > It seems that you can't do this. Qt handles QuickTest specially. It
> won't load the package if the program is not started via QUICK_TEST_MAIN.
> >> >
> >> > Is this something that PyQt5 is missing because there is no sip
> wrapper for QUICK_TEST_MAIN?
> >> >
> >> > Is there another way to run QML tests with a type registered in
> Python?
> >>
> >> How does the C++ implementation of registered types get loaded when
> using QUICK_TEST_MAIN?
> >>
> >> Phil
> >>
> >
> > _______________________________________________
> > PyQt mailing list PyQt@riverbankcomputing.com
> > https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
[Attachment #5 (text/html)]
<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">Den 15 nov. \
2017 6:00 em skrev "Cody Scott" <<a \
href="mailto:cody@perspexis.com">cody@perspexis.com</a>>:<br \
type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><div dir="ltr"><div>My current plan is to use the \
pyqt5qmlplugin with qmltestrunner. You can compile PyQt5 from source to build the \
pyqt5qmlplugin and then create a qml plugin so that you can register types defined in \
Python and use them with qmlscene and qmltestrunner.<br><br>Here is a basic \
example<br><a href="https://github.com/Siecje/qmlplugin/commit/6d591abf3784ee858acf2853ff05e6c9b2abce07" \
target="_blank">https://github.com/Siecje/<wbr>qmlplugin/commit/<wbr>6d591abf3784ee858acf2853ff05e6<wbr>c9b2abce07</a><br><br></div>Please \
let me know if you can't get this working and I will be able to \
help.<br></div></blockquote></div></div></div><div dir="auto"><br></div><div \
dir="auto">Ah, thanks for the pointers. A little unfortunate that it will require a \
custom pyqt build, since we're currently relying on the pre-built one. But if I \
go ahead and start looking at tests for our app I'll evaluate your \
approach.</div><div dir="auto"><br></div><div dir="auto">Elvis</div><div \
dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div \
class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br></div><div \
class="elided-text"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov \
15, 2017 at 10:25 AM, Elvis Stansvik <span dir="ltr"><<a \
href="mailto:elvstone@gmail.com" target="_blank">elvstone@gmail.com</a>></span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><span>2017-03-16 13:06 GMT+01:00 Phil Thompson <<a \
href="mailto:phil@riverbankcomputing.com" \
target="_blank">phil@riverbankcomputing.com</a>>:<br> > On 14 Mar 2017, at 4:20 \
pm, Cody Scott <<a href="mailto:cody@perspexis.com" \
target="_blank">cody@perspexis.com</a>> wrote:<br> >><br>
>> The types defined in C++ need to be registered before calling \
QUICK_TEST_MAIN()<br> >><br>
>> <a href="https://github.com/qt/qtquickcontrols/blob/5.8/src/controls/plugin.cpp#L159" \
rel="noreferrer" target="_blank">https://github.com/qt/qtquickc<wbr>ontrols/blob/5.8/src/controls/<wbr>plugin.cpp#L159</a><br>
>><br>
>> Sorry if I don't understand your question.<br>
><br>
> If you look at what QUICK_TEST_MAIN expands to (a complete self contained main() \
function), there is no opportunity to register the types. The code you refer to is \
implemented in a plugin which (I assume) gets loaded by the internals of \
QUICK_TEST_MAIN. Plugins don't play well with Python - see the restrictions on \
using qmlscene.<br> ><br>
> I will look at how to test QML from Python in the future - but not at the moment \
(unless somebody has a bright idea).<br> <br>
</span>(Sorry for necroposting.)<br>
<br>
Just wanted to ask what the story is nowadays? Is it possible to test<br>
PyQt+QML apps that use registered Python types with Qt Quick Test? [1]<br>
Or do people only do manual testing of their apps?<br>
<br>
Elvis<br>
<br>
[1] <a href="http://doc.qt.io/qt-5/qtquick-qtquicktest.html" rel="noreferrer" \
target="_blank">http://doc.qt.io/qt-5/qtquick-<wbr>qtquicktest.html</a><br> \
<span><br> ><br>
> Phil<br>
><br>
>> On Sat, Mar 11, 2017 at 1:59 PM, Phil Thompson <<a \
href="mailto:phil@riverbankcomputing.com" \
target="_blank">phil@riverbankcomputing.com</a>> wrote:<br> >> On 8 Mar \
2017, at 4:53 pm, Cody Scott <<a href="mailto:cody@perspexis.com" \
target="_blank">cody@perspexis.com</a>> wrote:<br> >> ><br>
>> > It seems that you can't do this. Qt handles QuickTest specially. It \
won't load the package if the program is not started via QUICK_TEST_MAIN.<br> \
>> ><br> >> > Is this something that PyQt5 is missing because there \
is no sip wrapper for QUICK_TEST_MAIN?<br> >> ><br>
>> > Is there another way to run QML tests with a type registered in \
Python?<br> >><br>
>> How does the C++ implementation of registered types get loaded when using \
QUICK_TEST_MAIN?<br> >><br>
>> Phil<br>
>><br>
><br>
</span>> ______________________________<wbr>_________________<br>
> PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" \
target="_blank">PyQt@riverbankcomputing.com</a><br> > <a \
href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" \
target="_blank">https://www.riverbankcomputing<wbr>.com/mailman/listinfo/pyqt</a><br> \
</blockquote></div><br></div> </div></blockquote></div><br></div></div></div>
[Attachment #6 (text/plain)]
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic