Re: [Interest] moveToThread used in constructor to move "this"

2016-02-24 Thread André Somers



Op 24/02/2016 om 18:23 schreef Thiago Macieira:

On quarta-feira, 24 de fevereiro de 2016 10:22:18 PST Lorenz Haas wrote:

Foo() : QObject(nullptr) {
   moveToThread(&m_thread);
   m_thread.start();
}

~Foo() {
   m_thread.quit();
   m_thread.wait();
}

This destructor is either never run or deadlocks.

A QObject can only be destroyed in its thread of affinity. So the above is
running in that m_thread thread, which means it hasn't exited. Waiting for it
to exit will wait forever.


Thanks indeed; I did not spot this issue either.

Would it be possible to circumvent this issue by moving the thread 
object onto its own thread too?


   Foo() : QObject(nullptr) {
  moveToThread(&m_thread);
  m_thread->moveToThread(m_thread);
  m_thread.start();
   }


Looks like the much debated move-QThread-onto-its-own-thread 
antipattern, but it's not the same obviously.


André

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Android Studio and Qt

2016-02-24 Thread rpzrpz...@gmail.com

Jason:

On 2/24/2016 8:38 PM, Jason H wrote:

How does one "regenerate it back into the build directory"?


You want to look at the "use gradle builds" and then generate android 
files in the project android setup in project preferences.


This will create an android subdirectory from your project main 
directory.  Put in their your MyActivity.java override java files and 
then edit them.


When you "regenerate the project", these files are copied into the 
android-build directory.


cheers.

md


I would figure that there would be some ability to extend the supplied 
QtActivity and tell the build system to use that? But it seems like I need to 
set up some build steps to overwrite the supplied activity? That doesn't seem 
'Qt' to me.

Many thanks for the insights so far!


Sent: Wednesday, February 24, 2016 at 8:25 PM
From: "m...@rpzdesign.com" 
To: No recipient address
Cc: "Jason H" , "interest@qt-project.org" 

Subject: Re: [Interest] Android Studio and Qt

Yes, edit the java code uptream and regenerate it back into the build
directory.



On 2/24/2016 6:41 PM, Jason H wrote:

Hrm, that's not what the instructions said, but I can see your point. If 
correct though, I'd be usin the Qt-supplied/generated classes, but that means 
I'm editing code in the build dir? Shouldn't the code be under my project's 
android dir?

The article alludes to a projdir/android/src/com/company/... directory.



Sent: Wednesday, February 24, 2016 at 5:59 PM
From: "m...@rpzdesign.com" 
To: interest@qt-project.org
Subject: Re: [Interest] Android Studio and Qt

Jason:

Its a little tricky, I think you have to open up the created project in
the build directory, not try to import from the source directory tree
where the qmake pro file is located.

Look at Build Settings -> Build Steps -> Make: main in /bla/bla/bla
directory and find the Debug -> android-build directory and magically
inside this directory is another gradle file.

Import from that build location and Android Studio will come up and be
able to process the java files while the compiled so C++ files are
loaded but not able to step into them as a native library.

That help?

md

On 2/24/2016 4:41 PM, Jason H wrote:

There is a step missing in http://www.kdab.com/qt-android-episode-6/
Where we go from importing the build.gradle to somehow having Java source to 
start debugging.

Can someone fill in the missing steps?
I didn't find any .java files.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest





___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Android Studio and Qt

2016-02-24 Thread Jason H
How does one "regenerate it back into the build directory"?

I would figure that there would be some ability to extend the supplied 
QtActivity and tell the build system to use that? But it seems like I need to 
set up some build steps to overwrite the supplied activity? That doesn't seem 
'Qt' to me.

Many thanks for the insights so far!

> Sent: Wednesday, February 24, 2016 at 8:25 PM
> From: "m...@rpzdesign.com" 
> To: No recipient address
> Cc: "Jason H" , "interest@qt-project.org" 
> 
> Subject: Re: [Interest] Android Studio and Qt
>
> Yes, edit the java code uptream and regenerate it back into the build 
> directory.
> 
> 
> 
> On 2/24/2016 6:41 PM, Jason H wrote:
> > Hrm, that's not what the instructions said, but I can see your point. If 
> > correct though, I'd be usin the Qt-supplied/generated classes, but that 
> > means I'm editing code in the build dir? Shouldn't the code be under my 
> > project's android dir?
> >
> > The article alludes to a projdir/android/src/com/company/... directory.
> >
> >
> >> Sent: Wednesday, February 24, 2016 at 5:59 PM
> >> From: "m...@rpzdesign.com" 
> >> To: interest@qt-project.org
> >> Subject: Re: [Interest] Android Studio and Qt
> >>
> >> Jason:
> >>
> >> Its a little tricky, I think you have to open up the created project in
> >> the build directory, not try to import from the source directory tree
> >> where the qmake pro file is located.
> >>
> >> Look at Build Settings -> Build Steps -> Make: main in /bla/bla/bla
> >> directory and find the Debug -> android-build directory and magically
> >> inside this directory is another gradle file.
> >>
> >> Import from that build location and Android Studio will come up and be
> >> able to process the java files while the compiled so C++ files are
> >> loaded but not able to step into them as a native library.
> >>
> >> That help?
> >>
> >> md
> >>
> >> On 2/24/2016 4:41 PM, Jason H wrote:
> >>> There is a step missing in http://www.kdab.com/qt-android-episode-6/
> >>> Where we go from importing the build.gradle to somehow having Java source 
> >>> to start debugging.
> >>>
> >>> Can someone fill in the missing steps?
> >>> I didn't find any .java files.
> >>> ___
> >>> Interest mailing list
> >>> Interest@qt-project.org
> >>> http://lists.qt-project.org/mailman/listinfo/interest
> >>>
> >> ___
> >> Interest mailing list
> >> Interest@qt-project.org
> >> http://lists.qt-project.org/mailman/listinfo/interest
> >>
> 
> 
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Android Studio and Qt

2016-02-24 Thread m...@rpzdesign.com
Yes, edit the java code uptream and regenerate it back into the build 
directory.




On 2/24/2016 6:41 PM, Jason H wrote:

Hrm, that's not what the instructions said, but I can see your point. If 
correct though, I'd be usin the Qt-supplied/generated classes, but that means 
I'm editing code in the build dir? Shouldn't the code be under my project's 
android dir?

The article alludes to a projdir/android/src/com/company/... directory.



Sent: Wednesday, February 24, 2016 at 5:59 PM
From: "m...@rpzdesign.com" 
To: interest@qt-project.org
Subject: Re: [Interest] Android Studio and Qt

Jason:

Its a little tricky, I think you have to open up the created project in
the build directory, not try to import from the source directory tree
where the qmake pro file is located.

Look at Build Settings -> Build Steps -> Make: main in /bla/bla/bla
directory and find the Debug -> android-build directory and magically
inside this directory is another gradle file.

Import from that build location and Android Studio will come up and be
able to process the java files while the compiled so C++ files are
loaded but not able to step into them as a native library.

That help?

md

On 2/24/2016 4:41 PM, Jason H wrote:

There is a step missing in http://www.kdab.com/qt-android-episode-6/
Where we go from importing the build.gradle to somehow having Java source to 
start debugging.

Can someone fill in the missing steps?
I didn't find any .java files.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Has some examples about new version qt3d (5.5 or later) to operate 3d model mesh and sub mesh?

2016-02-24 Thread Jordon Wu
Hi Sean,

Thanks very much. I will try is later.

Best Regards
Jordon Wu

2016-02-25 3:25 GMT+08:00 Sean Harmer :

> Hi Jordan,
>
> On 24/02/2016 02:27, Jordon Wu wrote:
>
> Hi Sean,
>
> This is a cool 3d demo(https://www.youtube.com/watch?v=zCBESbHSR1k )!
>
> Is this demo using assimp to load 3d model or using gltf to load 3d model ?
>
>
> Nope, each sub mesh is in it's own OBJ file which we load using the Mesh
> component. So in essence what we have is a scene graph hierarchy of
> RenderEntity's which look something like this:
>
> Entity {
> id: root
>
> property alias translation: transform.translation
> property real scale: transform.scale
> property Mesh mesh
> property Material material
> property Layer layer
>
> Transform {
> id: transform
> translation: Qt.vector3d(x, y, z)
> }
>
> components: [
> mesh,
> material,
> transform,
> layer
> ]
> }
>
> And then when we instantiate them they look like:
>
> // LEFT DOOR
> RenderEntity {
> mesh: leftDoor
> material: materials.doorPaint
> layer: carLayer
> y: 0.5 * root.explodeProgress
> x: 1 * root.explodeProgress
>
> RenderEntity {
> mesh: leftDoorGlass
> material: materials.window
> layer: carLayer
> }
>
> RenderEntity {
> mesh: leftDoorHinge
> material: materials.darkPlastic
> layer: carLayer
> }
> RenderEntity {
> mesh: leftDoorMirror
> material: materials.trim
> layer: carLayer
> }
>
> RenderEntity {
> mesh: leftDoorOpener
> material: materials.aluminium
> layer: carLayer
> }
>
> RenderEntity {
> mesh: leftDoorInnerLower
> material: materials.salonDevicesPlate
> layer: carLayer
> }
>
> RenderEntity {
> mesh: leftDoorInnerUpper
> material: materials.salonMaterial
> layer: carLayer
> }
> }
>
> where for e.g. mesh: leftDoor just refers to a Mesh property elsewhere in
> the scope.
>
>
> BTW, Are you open this demo source code to public? Thanks
>
>
> I can't publish it just yet as we can't distribute the model itself so I
> need to strip that out. Hopefully soon though.
>
> Sean
>
>
> Best Regards
> Jordon Wu
>
> 2016-02-23 15:58 GMT+08:00 Sean Harmer :
>
>> Hi,
>>
>> On 23/02/2016 07:04, Jordon Wu wrote:
>>
>> Hi list all,
>>
>> I'm begin study qt3d(qt5.5 version) now. And I want to found some
>> examples about 3d model mesh and sub mesh operation.
>>
>> I google found a good example QtQuick3D Tutorial - Car3D (
>> http://www.youtube.com/watch?v=VvQ_NHKtHwE ), but this qt3d is V1.0  and
>> the example did not run on qt3d 5.5 or later.
>>
>> Has anyone know where could found example about qt3d to operate 3d model
>> mesh and sub mesh like above Car3D examples ? Thanks
>>
>>
>> Well, in making of this car demo,
>> 
>> https://www.youtube.com/watch?v=zCBESbHSR1k we simply exported the
>> submeshes we needed explicit control over as separate obj files and loaded
>> each one usign a Mesh component aggregated to an Entity. Each Entity has
>> it's own Transform component that we then bind properties to QML
>> expressions that reference the Qt Quick Controls, e.g. slider values or
>> boolean switches.
>>
>> You can also have all meshes in a single OBJ file and reference the sub
>> mesh you wish to render in the Mesh component. We tried this but found it
>> to be better to split them out as it allows more work to be done in
>> parallel at start up, leading to faster startup times.
>>
>> Cheers,
>>
>> Sean
>>
>>
>>
>> Best Regards
>>
>> Jordon Wu
>>
>>
>>
>> ___
>> Interest mailing 
>> listInterest@qt-project.orghttp://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>>
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Android Studio and Qt

2016-02-24 Thread Jason H
Hrm, that's not what the instructions said, but I can see your point. If 
correct though, I'd be usin the Qt-supplied/generated classes, but that means 
I'm editing code in the build dir? Shouldn't the code be under my project's 
android dir? 

The article alludes to a projdir/android/src/com/company/... directory.


> Sent: Wednesday, February 24, 2016 at 5:59 PM
> From: "m...@rpzdesign.com" 
> To: interest@qt-project.org
> Subject: Re: [Interest] Android Studio and Qt
>
> Jason:
> 
> Its a little tricky, I think you have to open up the created project in 
> the build directory, not try to import from the source directory tree 
> where the qmake pro file is located.
> 
> Look at Build Settings -> Build Steps -> Make: main in /bla/bla/bla 
> directory and find the Debug -> android-build directory and magically 
> inside this directory is another gradle file.
> 
> Import from that build location and Android Studio will come up and be 
> able to process the java files while the compiled so C++ files are 
> loaded but not able to step into them as a native library.
> 
> That help?
> 
> md
> 
> On 2/24/2016 4:41 PM, Jason H wrote:
> > There is a step missing in http://www.kdab.com/qt-android-episode-6/
> > Where we go from importing the build.gradle to somehow having Java source 
> > to start debugging.
> >
> > Can someone fill in the missing steps?
> > I didn't find any .java files.
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
> >
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
> 
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Tempalted QObjects

2016-02-24 Thread Thiago Macieira
On quarta-feira, 24 de fevereiro de 2016 22:28:23 PST Jean-Michaël Celerier 
wrote:
> On Wed, Feb 24, 2016 at 8:50 PM, Thiago Macieira 
> wrote:
> > no compilers is currently able to merge implementations that
> > produce the same code, if they come from different functions.
> 
> Isn't this what MSVC's /OPT:ICF (
> https://msdn.microsoft.com/en-us/library/bxwfs976%28v=vs.140%29.aspx)

I've never seen that before. I'll need to take a better look.

> and gcc's -ffunction-sections -fdata-sections --gc-sections 

No.

> or gold's --icf

Kinda. As the link you pointed out:

> https://gcc.gnu.org/ml/gcc-patches/2014-06/msg01499.html

Says, a compiler-based ICF is more efficient than a linker-based ICF. The 
linker 
can only do ICF if you've compiled with -ffunction-sections and can only do it 
at function granularity. The compiler can do better.

> 
> do ? (although maybe not with a 100% hit rate).
> 
> A quick research has shown that clang contains a "mergefunc" option but it
> does not seem to be production-quality.

It looks like the GCC option -fipa-icf is already enabled at -O2 level and has 
been for some time. That is good, but given that I am still seeing duplicate 
code where strict analysis says it isn't needed, it means there's still a long 
way to go for the compilers to do the heavy-lifting.

Helping the compiler is still necessary.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Android Studio and Qt

2016-02-24 Thread m...@rpzdesign.com

Jason:

Its a little tricky, I think you have to open up the created project in 
the build directory, not try to import from the source directory tree 
where the qmake pro file is located.


Look at Build Settings -> Build Steps -> Make: main in /bla/bla/bla 
directory and find the Debug -> android-build directory and magically 
inside this directory is another gradle file.


Import from that build location and Android Studio will come up and be 
able to process the java files while the compiled so C++ files are 
loaded but not able to step into them as a native library.


That help?

md

On 2/24/2016 4:41 PM, Jason H wrote:

There is a step missing in http://www.kdab.com/qt-android-episode-6/
Where we go from importing the build.gradle to somehow having Java source to 
start debugging.

Can someone fill in the missing steps?
I didn't find any .java files.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Android Studio and Qt

2016-02-24 Thread Jason H
There is a step missing in http://www.kdab.com/qt-android-episode-6/
Where we go from importing the build.gradle to somehow having Java source to 
start debugging. 

Can someone fill in the missing steps?
I didn't find any .java files.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Tempalted QObjects

2016-02-24 Thread Jean-Michaël Celerier
On Wed, Feb 24, 2016 at 8:50 PM, Thiago Macieira 
wrote:

> no compilers is currently able to merge implementations that
> produce the same code, if they come from different functions.
>

Isn't this what MSVC's /OPT:ICF (
https://msdn.microsoft.com/en-us/library/bxwfs976%28v=vs.140%29.aspx)

and gcc's -ffunction-sections -fdata-sections --gc-sections or gold's --icf
:
https://gcc.gnu.org/ml/gcc-patches/2014-06/msg01499.html

do ? (although maybe not with a 100% hit rate).

A quick research has shown that clang contains a "mergefunc" option but it
does not seem to be production-quality.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] moveToThread used in constructor to move "this"

2016-02-24 Thread Lorenz Haas
> This destructor is either never run or deadlocks.

Indeed, my example/test code was bad. The destructor was never called
and thus I haven't saw the error output.

> A QObject can only be destroyed in its thread of affinity. So the above is 
> running in that m_thread thread, which means it hasn't exited. Waiting for it 
> to exit will wait forever.

Thanks for spotting this issue and pointing it out. The "self managing
class" was so tempting ... but it's not working :(

Thanks for your help.

Lorenz
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How can I set proxy settings and QNetworkCookieJar with QWebEngine

2016-02-24 Thread NoRulez
Ok i think the most is solved in Qt 5.6.0 rc.

Thanks

Am 22.02.2016 um 11:08 schrieb Koehne Kai :

>> -Original Message-
>> From: NoRulez [mailto:noru...@me.com]
>> [...]
>>> Could you elaborate?
>> 
>> 
>> In the Qt 5.5 examples there are a CookieJar example with QWebEngine. But
>> in the Qt 5.6 beta this example and functions are removed. See for example:
>> http://doc.qt.io/qt-5/qtwebenginewidgets-browser-cookiejar-cpp.html
> 
> It got only renamed: 
> http://doc-snapshots.qt.io/qt5-5.7/qtwebengine-webenginewidgets-demobrowser-cookiejar-cpp.html
> 
> But we btw now also added an explicit example for the new cookie API:
> 
> http://doc-snapshots.qt.io/qt5-5.7/qtwebengine-webenginewidgets-cookiebrowser-example.html
> 
> Regards
> 
> Kai
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Can't build Qt 5.6 RC on Windows - configure.exe is not recognized as internal or external command

2016-02-24 Thread Philippe
>>I see configure.exe in qtbase-opensource-5.6.0-rc.zip, but it's missing
>>in all  the other packages.

It is not present in the commercial zip package.

But configure.exe is built by configure.bat and this works ok.

The problem I encounter is something else.

Philippe

On Wed, 24 Feb 2016 11:39:22 -0800
Thiago Macieira  wrote:

> On quarta-feira, 24 de fevereiro de 2016 16:37:07 PST Nuno Santos wrote:
> > Can't build Qt 5.6 RC with the very same command I have been using since 
> > Qt 5.6 alpha. Does anyone knows why?
> 
> I see configure.exe in qtbase-opensource-5.6.0-rc.zip, but it's missing in 
> all 
> the other packages.
> 
> I've risen the priority of https://bugreports.qt.io/browse/QTBUG-35314 to P1 
> for the final release.
> 
> -- 
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Can't build Qt 5.6 RC on Windows - configure.exe is not recognized as internal or external command

2016-02-24 Thread Thiago Macieira
On quarta-feira, 24 de fevereiro de 2016 20:48:49 PST Philippe wrote:
> But configure.exe is built by configure.bat and this works ok.
> 
> The problem I encounter is something else.

Only if the .gitignore file is present. You can create it (empty is fine) to 
force configure.bat compiling the configure.exe application.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Tempalted QObjects

2016-02-24 Thread Thiago Macieira
On quarta-feira, 24 de fevereiro de 2016 20:13:44 PST Jean-Michaël Celerier 
wrote:
> I saw some other approaches to produce static reflection information by
> libclang usage,
> would inspired approaches be acceptable ? e.g.
> https://github.com/AustinBrunkhorst/CPP-Reflection/
> 
> Also, why is "#include'ing it from your class's header file," considered
> bad ?

Because it means that you need to install the Moc output as a header file for 
ALL of your users to include. The output isn't meant for that, as it has an 
#if check that you're compiling against the QtCore headers which came along 
with the moc that created that output. It also declares functions and 
variables that aren't properly namespaced for headers, and it declares static 
variables that would end up in every since translation unit that #included the 
output.

And that's just what we can fix, with some work.

> In "standard" Qt software, it is sometimes useful to #include
> "foo_moc.cpp"  (or foo.moc, I don't remember)
> in the implementation file, for instance if multiple classes are defined in
> the same header IIRC.

Right, but you're including it from the .cpp and you never distribute that 
moc_foo.cpp file.

We're talking about including it from a header and distributing that with your 
software so your users include it too (indirectly).

> But when doing template-heavy software the .hpp have more or less the same
> role
> for the developer that "traditional" implementation files so it should not
> come as shocking to require
> inclusion of files in the .hpp. But it's only my personal opinion.

We find that poor coding practice. All-inline template code leads to template 
bloat because the no compilers is currently able to merge implementations that 
produce the same code, if they come from different functions.

Qt takes care to fall back to a common implementation, often non-inline, for 
its template classes whenever it can.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Can't build Qt 5.6 RC on Windows - configure.exe is not recognized as internal or external command

2016-02-24 Thread Thiago Macieira
On quarta-feira, 24 de fevereiro de 2016 18:11:54 PST Philippe wrote:
> qtBase builds fine, but later ActiveX and XMLPatterns projects fail.

Please report those issues. Obviously, they compiled for us.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Can't build Qt 5.6 RC on Windows - configure.exe is not recognized as internal or external command

2016-02-24 Thread Thiago Macieira
On quarta-feira, 24 de fevereiro de 2016 16:37:07 PST Nuno Santos wrote:
> Can't build Qt 5.6 RC with the very same command I have been using since 
> Qt 5.6 alpha. Does anyone knows why?

I see configure.exe in qtbase-opensource-5.6.0-rc.zip, but it's missing in all 
the other packages.

I've risen the priority of https://bugreports.qt.io/browse/QTBUG-35314 to P1 
for the final release.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Has some examples about new version qt3d (5.5 or later) to operate 3d model mesh and sub mesh?

2016-02-24 Thread Sean Harmer

Hi Jordan,

On 24/02/2016 02:27, Jordon Wu wrote:

Hi Sean,

This is a cool 3d demo(https://www.youtube.com/watch?v=zCBESbHSR1k)!

Is this demo using assimp to load 3d model or using gltf to load 3d 
model ?


Nope, each sub mesh is in it's own OBJ file which we load using the Mesh 
component. So in essence what we have is a scene graph hierarchy of 
RenderEntity's which look something like this:


Entity {
id: root

property alias translation: transform.translation
property real scale: transform.scale
property Mesh mesh
property Material material
property Layer layer

Transform {
id: transform
translation: Qt.vector3d(x, y, z)
}

components: [
mesh,
material,
transform,
layer
]
}

And then when we instantiate them they look like:

// LEFT DOOR
RenderEntity {
mesh: leftDoor
material: materials.doorPaint
layer: carLayer
y: 0.5 * root.explodeProgress
x: 1 * root.explodeProgress

RenderEntity {
mesh: leftDoorGlass
material: materials.window
layer: carLayer
}

RenderEntity {
mesh: leftDoorHinge
material: materials.darkPlastic
layer: carLayer
}
RenderEntity {
mesh: leftDoorMirror
material: materials.trim
layer: carLayer
}

RenderEntity {
mesh: leftDoorOpener
material: materials.aluminium
layer: carLayer
}

RenderEntity {
mesh: leftDoorInnerLower
material: materials.salonDevicesPlate
layer: carLayer
}

RenderEntity {
mesh: leftDoorInnerUpper
material: materials.salonMaterial
layer: carLayer
}
}

where for e.g. mesh: leftDoor just refers to a Mesh property elsewhere 
in the scope.




BTW, Are you open this demo source code to public? Thanks


I can't publish it just yet as we can't distribute the model itself so I 
need to strip that out. Hopefully soon though.


Sean



Best Regards
Jordon Wu

2016-02-23 15:58 GMT+08:00 Sean Harmer >:


Hi,

On 23/02/2016 07:04, Jordon Wu wrote:

Hi list all,

I'm begin study qt3d(qt5.5 version) now. And I want to found some
examples about 3d model mesh and sub mesh operation.

I google found a good example QtQuick3D Tutorial - Car3D (
http://www.youtube.com/watch?v=VvQ_NHKtHwE ), but this qt3d is
V1.0  and the example did not run on qt3d 5.5 or later.

Has anyone know where could found example about qt3d to operate
3d model mesh and sub mesh like above Car3D examples ? Thanks


Well, in making of this car demo,
https://www.youtube.com/watch?v=zCBESbHSR1k we simply exported the
submeshes we needed explicit control over as separate obj files
and loaded each one usign a Mesh component aggregated to an
Entity. Each Entity has it's own Transform component that we then
bind properties to QML expressions that reference the Qt Quick
Controls, e.g. slider values or boolean switches.

You can also have all meshes in a single OBJ file and reference
the sub mesh you wish to render in the Mesh component. We tried
this but found it to be better to split them out as it allows more
work to be done in parallel at start up, leading to faster startup
times.

Cheers,

Sean




Best Regards

Jordon Wu



___
Interest mailing list
Interest@qt-project.org 
http://lists.qt-project.org/mailman/listinfo/interest



___
Interest mailing list
Interest@qt-project.org 
http://lists.qt-project.org/mailman/listinfo/interest




___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] moveToThread used in constructor to move "this"

2016-02-24 Thread Thiago Macieira
On quarta-feira, 24 de fevereiro de 2016 10:22:18 PST Lorenz Haas wrote:
>Foo() : QObject(nullptr) {
>   moveToThread(&m_thread);
>   m_thread.start();
>}
> 
>~Foo() {
>   m_thread.quit();
>   m_thread.wait();
>}

This destructor is either never run or deadlocks.

A QObject can only be destroyed in its thread of affinity. So the above is 
running in that m_thread thread, which means it hasn't exited. Waiting for it 
to exit will wait forever.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Can't build Qt 5.6 RC on Windows - configure.exe is not recognized as internal or external command

2016-02-24 Thread Philippe
Same her, impossible to build fully under Windows 10 / VS 2015 (I tried
both 32 and 64 bit).
qtBase builds fine, but later ActiveX and XMLPatterns projects fail.

I tried with a basic configuration:
configure -debug-and-release -make-tool jom -commercial -confirm-license

Philippe

Here, even with the most default 
:: configure -debug-and-release -make-tool jom -commercial -confirm-license

On Wed, 24 Feb 2016 16:37:07 +
Nuno Santos  wrote:

> Hi,
> 
> Can't build Qt 5.6 RC with the very same command I have been using since Qt 
> 5.6 alpha. Does anyone knows why?
> 
> Is not being able to find configure.exe. Is it supposed to be included?
> 
> This is the output:
> 
> C:\Qt\5.6\src_32>configure.bat -prefix c:\qt\5.6\msvc2013_5_6_rc_32_static 
> -commercial -debug-and-release -static -nomake examples -nomake tools -nomake 
> tests -opengl dynamic -skip multimedia
> 
> + cd qtbase
> + C:\Qt\5.6\src_32\qtbase\configure.bat -top-level -prefix 
> c:\qt\5.6\msvc2013_opengl_5_6_rc_32_static -commercial -debug-and-release 
> -static -nomake examples -nomake tools -nomake tests -opengl dynamic -skip 
> multimedia -openssl-linked -I c:\openssl-lib\include -L c:\openssl-lib\lib 
> OPENSSL_LIBS_DEBUG="ssleay32MTd.lib libeay32MTd.lib" 
> OPENSSL_LIBS_RELEASE="ssleay32MT.lib libeay32MT.lib" -qtnamespace 
> com_imaginando_drc
> 'C:\Qt\5.6\src_32\qtbase\configure.exe' is not recognized as an internal or 
> external command,
> operable program or batch file.
> 
> Thanks,
> 
> Nuno
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] emitting signals from UIApplication app delegate?

2016-02-24 Thread Nuno Santos

Jason,

A signal is a function. You just need to call it.

But first you need to have a valid object to call it.

Nuno

Em 24/02/2016 16:17, Jason H escreveu:

I want a QObject class to emit a signal when a function in my app delegate is 
invoked. (Code follows) How can I do that? I don't know how to use QObjects in 
ObjectiveC

--- PlatformShimImpl.cpp
PlatformShimImpl::PlatformShimImpl(){
qDebug() << Q_FUNC_INFO;
QtAppDelegate *appDelegate = (QtAppDelegate *)[[UIApplication 
sharedApplication] delegate];
[[UIApplication sharedApplication] setDelegate:[QtAppDelegate 
sharedQtAppDelegate]];
//[[QtAppDelegate sharedQtAppDelegate] setWindow:appDelegate.window];
}


--- QtAppDelegate.mm
- (void)applicationWillResignActive:(UIApplication *)application
{
[application setIdleTimerDisabled:NO];
// emit resignActive()
}


Many thanks.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Can't build Qt 5.6 RC on Windows - configure.exe is not recognized as internal or external command

2016-02-24 Thread Nuno Santos

Hi,

Can't build Qt 5.6 RC with the very same command I have been using since 
Qt 5.6 alpha. Does anyone knows why?


Is not being able to find configure.exe. Is it supposed to be included?

This is the output:

C:\Qt\5.6\src_32>configure.bat -prefix 
c:\qt\5.6\msvc2013_5_6_rc_32_static -commercial -debug-and-release 
-static -nomake examples -nomake tools -nomake tests -opengl dynamic 
-skip multimedia


+ cd qtbase
+ C:\Qt\5.6\src_32\qtbase\configure.bat -top-level -prefix 
c:\qt\5.6\msvc2013_opengl_5_6_rc_32_static -commercial 
-debug-and-release -static -nomake examples -nomake tools -nomake tests 
-opengl dynamic -skip multimedia -openssl-linked -I 
c:\openssl-lib\include -L c:\openssl-lib\lib 
OPENSSL_LIBS_DEBUG="ssleay32MTd.lib libeay32MTd.lib" 
OPENSSL_LIBS_RELEASE="ssleay32MT.lib libeay32MT.lib" -qtnamespace 
com_imaginando_drc
'C:\Qt\5.6\src_32\qtbase\configure.exe' is not recognized as an internal 
or external command,

operable program or batch file.

Thanks,

Nuno
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] emitting signals from UIApplication app delegate?

2016-02-24 Thread Jason H
I want a QObject class to emit a signal when a function in my app delegate is 
invoked. (Code follows) How can I do that? I don't know how to use QObjects in 
ObjectiveC

--- PlatformShimImpl.cpp
PlatformShimImpl::PlatformShimImpl(){
qDebug() << Q_FUNC_INFO;
QtAppDelegate *appDelegate = (QtAppDelegate *)[[UIApplication 
sharedApplication] delegate];
[[UIApplication sharedApplication] setDelegate:[QtAppDelegate 
sharedQtAppDelegate]];
//[[QtAppDelegate sharedQtAppDelegate] setWindow:appDelegate.window];
}


--- QtAppDelegate.mm
- (void)applicationWillResignActive:(UIApplication *)application
{
[application setIdleTimerDisabled:NO];
// emit resignActive()
}


Many thanks.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to hide keyboard while clicking outside of keyboard in qml

2016-02-24 Thread mark diener
Gianluca:

For simple QML layouts, I think your technique would work.

But I found that mousearea had issues when you had Loader objects in the chain.

Another approach is to use a Q_INVOKABLE function to register any QML
object that you want to have the keyboard hide whenever the touch
outside
of the registered QML Edit object.  I generally call this register
function for edit controls when they gain focus and use a common edit
control classname like "MyEdit"

Then in the overridden Application::eventproc(...), I look for
QEvent::TouchBegin or QEvent::MouseButtonPress event.

Then I use the incoming message's object metaObject() and parent() to
scan up the
parent chain to look for a object class name that matches my QML class
name "MyEdit"

Example: String(gobj->ClassName()).contains("MyEdit",Qt::CaseInsensitive")
== true

If I cannot find a match, I set the "focus" property of the registered
object "false".

You can also NOT hide the keyboard if the incoming mouse/touch message
is related to an object that is another "MyEdit" class.

I built this into a general library so now I don't even think about
it, I get fully functional soft keyboard hiding across all my apps and
it works.

Cheers,

md


On Wed, Feb 24, 2016 at 3:35 AM, Gian Maxera  wrote:
> Hello,
> I do in this way:
>  - add a MouseArea covering the entire screen that got a z level lower than 
> any other input area (like TextArea)
>  - on the onClicked I just call: Qt.inputMethod.hide() and the keyboard will 
> close is you click outside any other active elements.
>
> Ciao,
> Gianluca.
>
>
>> On 24 Feb 2016, at 09:32, 黄裔  wrote:
>>
>> I use TextArea as input in qml file. When clicking TextArea, keyboard pops 
>> up. But the keyboard could not hide while clicking outside of it. Whether 
>> there is a method or any API in qml can resolve this problem conveniently?
>>
>> thanks.
>> Yi
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] moveToThread used in constructor to move "this"

2016-02-24 Thread André Somers



Op 24/02/2016 om 10:22 schreef Lorenz Haas:

Hi André,


That should work just fine, with the exception of using &m_thread as a
member.

thanks for your answer. I am, however, not sure what you mean
regarding the m_thread member. For a better understanding here is a
working example I have in mind:

Ah, so you want a per-object thread.
I guess your design is possible. I'm not sure it is a good idea though. 
Depending on what API you expose, you will have to assume that the 
methods called on your class are called from another thread. Or, worse, 
the caller needs to be aware of that. That gets ugly quite fast if the 
things you want to expose are not as trivial as your example below...


André



**
#include 

class Foo : public QObject
{
Q_OBJECT
public:
Foo() : QObject(nullptr) {
   moveToThread(&m_thread);
   m_thread.start();
}

~Foo() {
   m_thread.quit();
   m_thread.wait();
}

void printFooInformation() const {
   qDebug() << "foo affinity" << thread();
}

void printThreadInformation() const {
   qDebug() << "m_thread affinity" << m_thread.thread();
}

private:
QThread m_thread;
};

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << "GUI affinity" << a.thread();
Foo *foo = new Foo;
foo->printThreadInformation();
foo->printFooInformation();
return a.exec();
}

#include "main.moc"
**

Of course, every instance of Foo would create a new thread and
therefor multiple instance of Foo would _not_ share the same thread.
Did you mean that? (In my special case this is intended.)

Lorenz


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to hide keyboard while clicking outside of keyboard in qml

2016-02-24 Thread Gian Maxera
Hello,
I do in this way:
 - add a MouseArea covering the entire screen that got a z level lower than any 
other input area (like TextArea)
 - on the onClicked I just call: Qt.inputMethod.hide() and the keyboard will 
close is you click outside any other active elements.

Ciao,
Gianluca.


> On 24 Feb 2016, at 09:32, 黄裔  wrote:
> 
> I use TextArea as input in qml file. When clicking TextArea, keyboard pops 
> up. But the keyboard could not hide while clicking outside of it. Whether 
> there is a method or any API in qml can resolve this problem conveniently?
> 
> thanks.
> Yi
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] How to hide keyboard while clicking outside of keyboard in qml

2016-02-24 Thread 黄裔
I use TextArea as input in qml file. When clicking TextArea, keyboard pops up. 
But the keyboard could not hide while clicking outside of it. Whether there is 
a method or any API in qml can resolve this problem conveniently?


thanks.
Yi___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] moveToThread used in constructor to move "this"

2016-02-24 Thread Lorenz Haas
Hi André,

> That should work just fine, with the exception of using &m_thread as a
> member.

thanks for your answer. I am, however, not sure what you mean
regarding the m_thread member. For a better understanding here is a
working example I have in mind:

**
#include 

class Foo : public QObject
{
   Q_OBJECT
public:
   Foo() : QObject(nullptr) {
  moveToThread(&m_thread);
  m_thread.start();
   }

   ~Foo() {
  m_thread.quit();
  m_thread.wait();
   }

   void printFooInformation() const {
  qDebug() << "foo affinity" << thread();
   }

   void printThreadInformation() const {
  qDebug() << "m_thread affinity" << m_thread.thread();
   }

private:
   QThread m_thread;
};

int main(int argc, char *argv[])
{
   QCoreApplication a(argc, argv);
   qDebug() << "GUI affinity" << a.thread();
   Foo *foo = new Foo;
   foo->printThreadInformation();
   foo->printFooInformation();
   return a.exec();
}

#include "main.moc"
**

Of course, every instance of Foo would create a new thread and
therefor multiple instance of Foo would _not_ share the same thread.
Did you mean that? (In my special case this is intended.)

Lorenz
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] moveToThread used in constructor to move "this"

2016-02-24 Thread André Somers



Op 24/02/2016 om 09:39 schreef Lorenz Haas:

Hi,

keep calm, it is not about moveToThread(this) :)

One canonical way to use QObjects and QThreads is this

void SomeClass::init() {
 // m_thread is a member of SomeClass
 Foo *foo = new Foo; // Foo inherits QObject
 foo->moveToThread(&m_thread);
}

So in my case I want that an instance of Foo is always moved to a
(single) thread. In order to take this knowledge/requirement - as well
as the boilerplate code - from the caller (here SomeClass::init) I am
curious if this is would be a valid substitution:

Foo::Foo() : QObject(nullptr) {
 // m_thread is now a member of Foo
 moveToThread(&m_thread);
}

void SomeClass::init() {
 Foo *foo = new Foo;
}


I guess that in the constructor of Foo the base class QObject is
already instantiated and since moveToThread only has implications on
QObject it should be right.
Can any one with deeper QThread insight confirm that using
moveToThread in a constructor like above is safe?

That should work just fine, with the exception of using &m_thread as a 
member. If you want to use the class as you write it above, then there 
is no way to set that member. You will probably need to use some form of 
a static here, either inside the class itself if you don't need control 
over the actual thread creation itself, or externally, perhaps wrapped 
in some kind of singleton.


André
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] moveToThread used in constructor to move "this"

2016-02-24 Thread Lorenz Haas
Hi,

keep calm, it is not about moveToThread(this) :)

One canonical way to use QObjects and QThreads is this

void SomeClass::init() {
// m_thread is a member of SomeClass
Foo *foo = new Foo; // Foo inherits QObject
foo->moveToThread(&m_thread);
}

So in my case I want that an instance of Foo is always moved to a
(single) thread. In order to take this knowledge/requirement - as well
as the boilerplate code - from the caller (here SomeClass::init) I am
curious if this is would be a valid substitution:

Foo::Foo() : QObject(nullptr) {
// m_thread is now a member of Foo
moveToThread(&m_thread);
}

void SomeClass::init() {
Foo *foo = new Foo;
}


I guess that in the constructor of Foo the base class QObject is
already instantiated and since moveToThread only has implications on
QObject it should be right.
Can any one with deeper QThread insight confirm that using
moveToThread in a constructor like above is safe?


Thanks,
Lorenz
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] QML Drag Type `dragStarted` and `dragFinished` signals

2016-02-24 Thread Sina Dogru
Hello,

As documentation of Drag QML Type says on `active
`
property,

Binding this property to the active property of MouseArea::drag
>  will cause
> startDrag 
> to be called when the user starts dragging.


And same documentation also says on `dragStarted
` signal,

This signal is emitted when a drag is started with the startDrag()
>  method or
> when it is started automatically using the dragType
> 
> property.
>

So according to those, what I do understand is,

Rectangle {
id: rect
width: 20; height: 20
color: "red"
Drag.active: mouseArea.drag.active
Drag.onDragStarted: console.log("dragStarted");

MouseArea {
id: mouseArea
anchors.fill: parent

drag.target: parent
onReleased: parent.Drag.drop();
}
}

the code above should write "dragStarted" on the console when I move the
rect, but this does not happen.

Does anyone know the right way?

Thank you,

Cavit Sina
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest