Re: [Interest] Compiling Qt from source 64 bit on Windows

2016-03-14 Thread Thiago Macieira
On terça-feira, 15 de março de 2016 00:04:25 PDT Gunnar Roth wrote:
> Hi Thiago, you probably missed the -static configure option, so Nunos is
> making a static qt build. He really should mention that in the subject
> line. Ordinary 64 bit windows qt 5.6rc builds worked for me without a
> problem with vs2012 an 2015.
> 
> libcpmt.lib is the c++ multithread static lib of visual studio.

I didn't miss them.

The -static option does not make Qt link to the static runtime. It simply 
creates a static library that links to the dynamic runtime. That is known to 
work.

So, like I said, the problem would be the OpenSSL libraries.
-- 
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] bug with # in URL when using setUrl?

2016-03-14 Thread Thiago Macieira
On segunda-feira, 14 de março de 2016 18:30:13 PDT Larry Martell wrote:
> We have an app that emits a URL with a hashtag in it (#) and that is
> processed by some Angular JS code we have
> (https://docs.angularjs.org/guide/$location). That URL is emitted with
> setUrl. It works fine on a Mac, but on Windows it acts as if the #
> were not there. Googling I found this:
> 
> https://bugreports.qt.io/browse/QTWEBKIT-56
> 
> Does anyone know if this bug could be the issue I am facing?

"Emits a URL" isn't enough information, so I'm going to make some assumptions. 
I'm assuming that you're emitting a signal that has a QUrl parameter and the 
URL it carries contains a fragment (that is, it has a #). In the slot, you 
process the URL.

There are no known problems with QUrl. Therefore, the problem is in your code 
that processes the URL.

-- 
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] Rendering simple QPainterPath with Qt3D

2016-03-14 Thread Ch'Gans
On 14 March 2016 at 22:03, Sean Harmer  wrote:
> On Monday 14 Mar 2016 16:50:32 Ch'Gans wrote:
>> Hi there,
>>
>> I have an application that use heavily the Qt graphics view framework,
>> where each item represent a flat, solid object on a layer of material.
>> They all have a "simple" shape, that is they only use line and arcs
>> and have no windings/overlaps. Items represents a deposit of material
>> or a material cut-off.
>> The application uses several QGraphicsScene to manage items on a set
>> of "material layers", that are (in the real physical world) stacked on
>> top of each other to form a sort of sandwich.
>>
>> I would like to have a 3D view of my "stack of 2D layers" world by
>> simply extruding vertically all my items by the thickness of the layer
>> they belong to, and displaying all the stacked layers in 3D.
>>
>> I had a look at Qt 3D source code, especially the classes derived from
>> QMesh and QGeometry (Cuboid, Cylinder, Sphere, ...). And of course had
>> a look at all the Qt3D example.
>>
>> By the look of it, it seems to me that I should create a custom
>> QMesh/QGeometry to render in 3D all my 2D items. I haven't try to code
>> anything, I'm just trying to see what could be done and what would be
>> the right approach.
>>
>> Could anyone shed some light on how I could achieve this, like is the
>> custom QMEsh/Geometry the right approach for this kind of problems?
>
> If you want to extrude, then yes you need actual geometry so investigating
> QGeometry is the way to go. Basically, you provide a QBuffer containing your
> per-vertex data (positions, but maybe also normal vectors if you want
> lighting, texture coordinates if you want to apply a texture, vertex colors if
> you want to use the per-vertex colour material etc).
>
> You then define one or more QAttributes that correspond to these per-vertex
> attributes. The QAttributes describe the layout of the data in the QBuffer.
>
> You can then specify the QGeometry that contains the attributes in a
> QGeometryRenderer component.


Wow!!!
Thanks for this explanation, it sounds so easy said this way! ;)

I saw this QAttribute thing, but didn't bother digging further. But
now I have a better picture on how all this works.
Again, thanks a lot for your enlightening comments.

Maybe it would be nice to have a cpp example that show this. That was
my blocker as I went through all the examples, there's the case where
you load your model from a file, there's an example where you use
built-in geometry (Cuboid, Sphere, ...), and that was it, nothing
about custom geometry. (Don't get me wrong I'm not ranting, what you
guys are doing is awesome, as it has always been.)

> The tricky part is converting your QPainterPaths into geometry and extruding
> it and storing it in the buffer. This is something we'd like to add a helper
> for at some point but we don't have anything for it yet. There is however,
> some private API in QtGui. Take a look at:
>
> QTriangleSet Q_GUI_EXPORT qTriangulate(const QPainterPath &path, const
> QTransform &matrix = QTransform(), qreal lod = 1);
>
> in src/gui/opengl/qtriangulator_p.h
>
> You may need to copy/paste this into your own project and adjust it as the
> implementation relies upon having a current OpenGL context iirc. Shoudl give
> you most of what you need though.

Will have a look, thanks for pointing me that.

>
>> Note: I've never used the Qt 3D framegraph, and I'm not very familiar
>> with OpenGL
>
> You shouldn't need to worry about the framegraph, just use the ForwardRenderer
> one. Hopefully you shouldn't need to care about OpenGL either other than
> preparing the vertex data as described above.

And thanks again for this tip, will have a deeper look at this ForwardRenderer.

Chris

>
> Cheers,
>
> Sean
>
>
>>
>> Thanks,
>> Chris
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>
> --
> Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
> KDAB (UK) Ltd, a KDAB Group company
> Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
> Mobile: +44 (0)7545 140604
> KDAB - Qt Experts
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Compiling Qt from source 64 bit on Windows

2016-03-14 Thread Nuno Santos
Gunnar,

Thanks for your keen eye. 

So, maybe libcpmt.lib is not being specified to the linker by default? Need to 
check tomorrow at the office.

Regards,

Nuno
 
> On 14 Mar 2016, at 23:04, Gunnar Roth  wrote:
> 
> Hi Thiago, you probably missed the -static configure option, so Nunos is 
> making a static qt build. He really should mention that in the subject line.
> Ordinary 64 bit windows qt 5.6rc builds worked for me without a problem with 
> vs2012 an 2015.
> 
> libcpmt.lib is the c++ multithread static lib of visual studio. 
> 
> 
> 
> Regards,
> Gunnar Roth
> 
> 
>> Am 14.03.2016 um 21:45 schrieb Thiago Macieira :
>> 
>> On segunda-feira, 14 de março de 2016 18:11:46 PDT Nuno Santos wrote:
>>> Hi,
>>> 
>>> Is there any special difference in compiling Qt from source in Windows
>>> in 64 bit?
>> 
>> No. It's been working just fine for the last 3 or 4 years for me.
>> 
>>> libcpmt.lib(locale.obj) : error LNK2001: unresolved external symbol
>>> _purecall
>> 
>>> libcpmt.lib(xthrow.obj) : error LNK2019: unresolved external symbol
>>> _purecall referenced in function "public: __cdecl
>>> std::basic_string,class
>>> std::allocator >::basic_string>> std::char_traits,class std::allocator >(char const *)"
>>> (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD@Z
>>> )
>> 
>> Looks like your environment wasn't set up properly. This library 
>> (libcpmt.lib) 
>> is requiring functions that aren't present.
>> 
>> I've never heard of libcpmt, so I have no idea what it's supposed to be 
>> doing 
>> or how you got linking to it. My guess is that the OpenSSL libraries are 
>> causing it, somehow. I suggest you go back to dynamic loading of the OpenSSL 
>> libraries, instead of -openssl-linked.
>> 
>> -- 
>> 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

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


Re: [Interest] Compiling Qt from source 64 bit on Windows

2016-03-14 Thread Gunnar Roth
Hi Thiago, you probably missed the -static configure option, so Nunos is making 
a static qt build. He really should mention that in the subject line.
Ordinary 64 bit windows qt 5.6rc builds worked for me without a problem with 
vs2012 an 2015.

libcpmt.lib is the c++ multithread static lib of visual studio. 


 
Regards,
Gunnar Roth


> Am 14.03.2016 um 21:45 schrieb Thiago Macieira :
> 
> On segunda-feira, 14 de março de 2016 18:11:46 PDT Nuno Santos wrote:
>> Hi,
>> 
>> Is there any special difference in compiling Qt from source in Windows
>> in 64 bit?
> 
> No. It's been working just fine for the last 3 or 4 years for me.
> 
>> libcpmt.lib(locale.obj) : error LNK2001: unresolved external symbol
>> _purecall
> 
>> libcpmt.lib(xthrow.obj) : error LNK2019: unresolved external symbol
>> _purecall referenced in function "public: __cdecl
>> std::basic_string,class
>> std::allocator >::basic_string> std::char_traits,class std::allocator >(char const *)"
>> (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD@Z
>> )
> 
> Looks like your environment wasn't set up properly. This library 
> (libcpmt.lib) 
> is requiring functions that aren't present.
> 
> I've never heard of libcpmt, so I have no idea what it's supposed to be doing 
> or how you got linking to it. My guess is that the OpenSSL libraries are 
> causing it, somehow. I suggest you go back to dynamic loading of the OpenSSL 
> libraries, instead of -openssl-linked.
> 
> -- 
> 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] Compiling Qt from source 64 bit on Windows

2016-03-14 Thread Nuno Santos
Thiago,

Thanks for the clarification. I will investigate further.

Thanks,

Regards,

Nuno

> On 14 Mar 2016, at 20:45, Thiago Macieira  wrote:
> 
> On segunda-feira, 14 de março de 2016 18:11:46 PDT Nuno Santos wrote:
>> Hi,
>> 
>> Is there any special difference in compiling Qt from source in Windows
>> in 64 bit?
> 
> No. It's been working just fine for the last 3 or 4 years for me.
> 
>> libcpmt.lib(locale.obj) : error LNK2001: unresolved external symbol
>> _purecall
> 
>> libcpmt.lib(xthrow.obj) : error LNK2019: unresolved external symbol
>> _purecall referenced in function "public: __cdecl
>> std::basic_string,class
>> std::allocator >::basic_string> std::char_traits,class std::allocator >(char const *)"
>> (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD@Z
>> )
> 
> Looks like your environment wasn't set up properly. This library 
> (libcpmt.lib) 
> is requiring functions that aren't present.
> 
> I've never heard of libcpmt, so I have no idea what it's supposed to be doing 
> or how you got linking to it. My guess is that the OpenSSL libraries are 
> causing it, somehow. I suggest you go back to dynamic loading of the OpenSSL 
> libraries, instead of -openssl-linked.
> 
> -- 
> 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


[Interest] bug with # in URL when using setUrl?

2016-03-14 Thread Larry Martell
We have an app that emits a URL with a hashtag in it (#) and that is
processed by some Angular JS code we have
(https://docs.angularjs.org/guide/$location). That URL is emitted with
setUrl. It works fine on a Mac, but on Windows it acts as if the #
were not there. Googling I found this:

https://bugreports.qt.io/browse/QTWEBKIT-56

Does anyone know if this bug could be the issue I am facing?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Upcoming mobile Qt features?

2016-03-14 Thread Jason H

I'm not waiting, but these are barriers to adoption for new users, and 
frustrations for current users.



> Sent: Monday, March 14, 2016 at 3:48 PM
> From: "rpzrpz...@gmail.com" 
> To: interest@qt-project.org
> Subject: Re: [Interest] Upcoming mobile Qt features?
>
> Don't wait for anything.
> 
> Native code for Android and IOS.
> 
> md
> 
> On 3/14/2016 1:26 PM, Jason H wrote:
> > I'm being asked for more modern features, I don't know where these are on 
> > the Qt roadmap?
> >
> > - TouchID/FingerprintManager:
> >Now that both mobile platforms have platform-level APIs for 
> > fingerprints, is Qt going to support them in some way?
> >
> > - Streaming video:
> >Capture, send, receive "live" video to enable real-time video chat, yes, 
> > like skype/google hangouts/facetime.
> >
> > Meanwhile, I'm still looking for Qt to abstract these mobile 
> > old-but-goodies:
> > - Push notifications
> > - Background operations
> > - Screen wake-locking
> > (I have a platform shim for those, but would just prefer to use a standard 
> > x-platform interface)
> >
> > Anyone know the 5.7/5.8 roadmap? The only mobile thing listed on the wiki 
> > is:
> > - Android: Qt can now be used to easily create Android Services*
> >
> > * This seems to be an either-or. Not an app with services?
> >
> > ___
> > 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] Compiling Qt from source 64 bit on Windows

2016-03-14 Thread Thiago Macieira
On segunda-feira, 14 de março de 2016 18:11:46 PDT Nuno Santos wrote:
> Hi,
> 
> Is there any special difference in compiling Qt from source in Windows
> in 64 bit?

No. It's been working just fine for the last 3 or 4 years for me.

> libcpmt.lib(locale.obj) : error LNK2001: unresolved external symbol
> _purecall

> libcpmt.lib(xthrow.obj) : error LNK2019: unresolved external symbol
> _purecall referenced in function "public: __cdecl
> std::basic_string,class
> std::allocator >::basic_string std::char_traits,class std::allocator >(char const *)"
> (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD@Z
> )

Looks like your environment wasn't set up properly. This library (libcpmt.lib) 
is requiring functions that aren't present.

I've never heard of libcpmt, so I have no idea what it's supposed to be doing 
or how you got linking to it. My guess is that the OpenSSL libraries are 
causing it, somehow. I suggest you go back to dynamic loading of the OpenSSL 
libraries, instead of -openssl-linked.

-- 
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] PeekMessage, DispatchMessage and Qt events dispatching

2016-03-14 Thread Thiago Macieira
On segunda-feira, 14 de março de 2016 18:39:25 PDT Benjamin TERRIER wrote:
> So here is my question is there a bug in Qt or does DispatchMessage
> shouldn't be called ?

Don't call it. Qt integrates with the Windows event loop, so this behaviour is 
expected. Ditto for Cocoa event loops and for glib: if you cause them to 
dispatch, Qt event processing will be woken up and deliver pending events.

-- 
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] Upcoming mobile Qt features?

2016-03-14 Thread rpzrpz...@gmail.com

Don't wait for anything.

Native code for Android and IOS.

md

On 3/14/2016 1:26 PM, Jason H wrote:

I'm being asked for more modern features, I don't know where these are on the 
Qt roadmap?

- TouchID/FingerprintManager:
   Now that both mobile platforms have platform-level APIs for fingerprints, is 
Qt going to support them in some way?

- Streaming video:
   Capture, send, receive "live" video to enable real-time video chat, yes, 
like skype/google hangouts/facetime.

Meanwhile, I'm still looking for Qt to abstract these mobile old-but-goodies:
- Push notifications
- Background operations
- Screen wake-locking
(I have a platform shim for those, but would just prefer to use a standard 
x-platform interface)

Anyone know the 5.7/5.8 roadmap? The only mobile thing listed on the wiki is:
- Android: Qt can now be used to easily create Android Services*

* This seems to be an either-or. Not an app with services?

___
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] Upcoming mobile Qt features?

2016-03-14 Thread Jason H
I'm being asked for more modern features, I don't know where these are on the 
Qt roadmap?

- TouchID/FingerprintManager: 
  Now that both mobile platforms have platform-level APIs for fingerprints, is 
Qt going to support them in some way? 

- Streaming video: 
  Capture, send, receive "live" video to enable real-time video chat, yes, like 
skype/google hangouts/facetime. 

Meanwhile, I'm still looking for Qt to abstract these mobile old-but-goodies:
- Push notifications
- Background operations
- Screen wake-locking
(I have a platform shim for those, but would just prefer to use a standard 
x-platform interface)

Anyone know the 5.7/5.8 roadmap? The only mobile thing listed on the wiki is:
- Android: Qt can now be used to easily create Android Services*

* This seems to be an either-or. Not an app with services?

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


[Interest] Compiling Qt from source 64 bit on Windows

2016-03-14 Thread Nuno Santos

Hi,

Is there any special difference in compiling Qt from source in Windows 
in 64 bit?


This is my configure linke
configure -prefix c:\qt\5.6\msvc2013_opengl_5_6_rc_64_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\lib64 
OPENSSL_LIBS_DEBUG="ssleay32MTd.lib libeay32MTd.lib" 
OPENSSL_LIBS_RELEASE="ssleay32MT.lib libeay32MT.lib"


Qt compiled just fine.

The projecto also compiles fine until it gets to the linking phase:

libcpmt.lib(locale.obj) : error LNK2001: unresolved external symbol 
_purecall


libcpmt.lib(wlocale.obj) : error LNK2001: unresolved external symbol 
_purecall


libcpmt.lib(xlocale.obj) : error LNK2001: unresolved external symbol 
_purecall


libcpmt.lib(xdateord.obj) : error LNK2001: unresolved external symbol 
_purecall


libcpmt.lib(locale0.obj) : error LNK2001: unresolved external symbol 
_purecall


libcpmt.lib(ios.obj) : error LNK2001: unresolved external symbol _purecall

libcpmt.lib(cerr.obj) : error LNK2001: unresolved external symbol _purecall

libcpmt.lib(iosptrs.obj) : error LNK2001: unresolved external symbol 
_purecall


Qt5Core.lib(qanimationgroup.obj) : error LNK2001: unresolved external 
symbol _purecall


Qt5Core.lib(qfilesystemwatcher_polling.obj) : error LNK2001: unresolved 
external symbol _purecall


libcpmt.lib(xthrow.obj) : error LNK2019: unresolved external symbol 
_purecall referenced in function "public: __cdecl 
std::basic_string,class 
std::allocator >::basic_stringstd::char_traits,class std::allocator >(char const *)" 
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD@Z)


libcpmt.lib(syserror.obj) : error LNK2001: unresolved external symbol 
_purecall


Qt5Core.lib(qabstractfileengine.obj) : error LNK2001: unresolved 
external symbol _purecall


Qt5Core.lib(qmimeprovider.obj) : error LNK2001: unresolved external 
symbol _purecall


Qt5Core.lib(qabstractstate.obj) : error LNK2001: unresolved external 
symbol _purecall


Qt5Core.lib(qabstracttransition.obj) : error LNK2001: unresolved 
external symbol _purecall



What am I missing?


Thanks,

Regards,


Nuno


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


Re: [Interest] [Development] Qt 5.6.0 (final) packages available

2016-03-14 Thread Konstantin Podsvirov
Hello everyone and thank you for the good work!

I have a related question. According to this post and the comments:

http://blog.qt.io/blog/2016/01/18/qt-charts-2-1-0-release

It says that Qt 5.6 gives an open community QtCharts 2.1 and it is wonderful!
But... looking at the git tags on code.qt.io I don't find the 2.1 release 
(2.0.1 only).
If I'm wrong, correct me.
Else tell me who can push the correct tag?

14.03.2016, 19:59, "Jan Kundrát" :
> On Monday, 14 March 2016 14:22:42 CET, Heikkinen Jani wrote:
>> So please inform me
>> immediately if there is something new which is preventing us to
>> do the release.
>
> Do you consider "Plasma5 deadlocks during startup" as a blocker? If so,
> https://bugreports.qt.io/browse/QTBUG-51676 . It's a regression in the 5.6
> branch ("5.5 works fine. oldish 5.6 works fine, too"), and Thiago is
> currently AFK when it comes to Gerrit reviews.
>
> Cheers,
> Jan

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


[Interest] PeekMessage, DispatchMessage and Qt events dispatching

2016-03-14 Thread Benjamin TERRIER
Hi everyone,

I have encountered the following problem on Windows:

I have 2 QThreads and 2 QObjects (each one living on one thread). One
QObject ,the sender, periodically calls a slot on the other QObject
,the receiver, with the following code:

QMetaObject::invokeMethod(m_receiver, "work", Qt::QueuedConnection);

The work() slot on the receiver looks like this:

void Receiver::work()
{
static int count = 0;
qDebug("", count);
count += 1;

doSomethingThatTakesTime();

count -= 1;
qDebug("", count);
}

The doSomethingThatTakesTime() function is long enough that during its
execution the sender has the time to make another call to the work()
slot.

The expected output would be something like:






...

However for some reason deep within the doSomethingThatTakesTime()
function there is this code (don't ask me why, it's an old piece of
code):
if(PeekMessage(&msg, 0,0,0,PM_REMOVE))
{
 DispatchMessage(&msg);
}
Which changes the output as:












It seems that when DispatchMessage is called the Qt event dispatcher
is forced to process the next event in queue even if the current event
is still being processed. Moreover the execution stack is never
unstacked i.e DispatchMessage doesn't return.

So here is my question is there a bug in Qt or does DispatchMessage
shouldn't be called ?

Regards,

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


Re: [Interest] Rendering simple QPainterPath with Qt3D

2016-03-14 Thread Sean Harmer
On Monday 14 Mar 2016 16:50:32 Ch'Gans wrote:
> Hi there,
> 
> I have an application that use heavily the Qt graphics view framework,
> where each item represent a flat, solid object on a layer of material.
> They all have a "simple" shape, that is they only use line and arcs
> and have no windings/overlaps. Items represents a deposit of material
> or a material cut-off.
> The application uses several QGraphicsScene to manage items on a set
> of "material layers", that are (in the real physical world) stacked on
> top of each other to form a sort of sandwich.
> 
> I would like to have a 3D view of my "stack of 2D layers" world by
> simply extruding vertically all my items by the thickness of the layer
> they belong to, and displaying all the stacked layers in 3D.
> 
> I had a look at Qt 3D source code, especially the classes derived from
> QMesh and QGeometry (Cuboid, Cylinder, Sphere, ...). And of course had
> a look at all the Qt3D example.
> 
> By the look of it, it seems to me that I should create a custom
> QMesh/QGeometry to render in 3D all my 2D items. I haven't try to code
> anything, I'm just trying to see what could be done and what would be
> the right approach.
> 
> Could anyone shed some light on how I could achieve this, like is the
> custom QMEsh/Geometry the right approach for this kind of problems?

If you want to extrude, then yes you need actual geometry so investigating 
QGeometry is the way to go. Basically, you provide a QBuffer containing your 
per-vertex data (positions, but maybe also normal vectors if you want 
lighting, texture coordinates if you want to apply a texture, vertex colors if 
you want to use the per-vertex colour material etc).

You then define one or more QAttributes that correspond to these per-vertex 
attributes. The QAttributes describe the layout of the data in the QBuffer.

You can then specify the QGeometry that contains the attributes in a 
QGeometryRenderer component.

The tricky part is converting your QPainterPaths into geometry and extruding 
it and storing it in the buffer. This is something we'd like to add a helper 
for at some point but we don't have anything for it yet. There is however, 
some private API in QtGui. Take a look at:

QTriangleSet Q_GUI_EXPORT qTriangulate(const QPainterPath &path, const 
QTransform &matrix = QTransform(), qreal lod = 1);

in src/gui/opengl/qtriangulator_p.h

You may need to copy/paste this into your own project and adjust it as the 
implementation relies upon having a current OpenGL context iirc. Shoudl give 
you most of what you need though.
 
> Note: I've never used the Qt 3D framegraph, and I'm not very familiar
> with OpenGL

You shouldn't need to worry about the framegraph, just use the ForwardRenderer 
one. Hopefully you shouldn't need to care about OpenGL either other than 
preparing the vertex data as described above.

Cheers,

Sean


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

-- 
Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
KDAB (UK) Ltd, a KDAB Group company
Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
Mobile: +44 (0)7545 140604
KDAB - Qt Experts
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest