Re: [Interest] Shadow Mapping using QOpenGLFramebufferObject

2016-02-01 Thread Prashanth Udupa
Hello,

I figured out a solution to this. I thought I should post it here, because
it may be of some use to others.

Since using QOpenGLFrameBufferObject was out of question, I had to create
the buffer by myself using gl function calls as follows.

// Refer http://learnopengl.com/#!Advanced-Lighting/Shadows/Shadow-Mapping
if(m_shadowMapFBO != 0)
return;

// Create a texture for storing the depth map
glGenTextures(1, &m_shadowMapTex);
glBindTexture(GL_TEXTURE_2D, m_shadowMapTex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
 SHADOW_WIDTH, SHADOW_HEIGHT, 0, GL_DEPTH_COMPONENT, GL_FLOAT,
NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
GLfloat borderColor[] = { 1.0, 1.0, 1.0, 1.0 };
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);

// Create a frame-buffer and associate the texture with it.
glGenFramebuffers(1, &m_shadowMapFBO);
glBindFramebuffer(GL_FRAMEBUFFER, m_shadowMapFBO);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D,
m_shadowMapTex, 0);

// Let OpenGL know that we are not interested in colors for this buffer
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);

// Cleanup for now.
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glBindTexture(GL_TEXTURE_2D, 0);

Then I rendered the scene by binding the shadow texture. The fragment
shader code had to be updated a bit to determine whether a fragment lies
within a shadow or outside of it.

const float qt_ZNear=0.1;
const float qt_ZFar=1000.0;

float linearizeDepth(float depth)
{
float z = depth * 2.0 - 1.0; // Back to NDC
return (2.0 * qt_ZNear * qt_ZFar) / (qt_ZFar + qt_ZNear - z * (qt_ZFar
- qt_ZNear));
}
float evaluateShadow(in vec4 shadowPos)
{
vec3 shadowCoords = shadowPos.xyz / shadowPos.w;
shadowCoords = shadowCoords * c_half + c_half;

if(shadowCoords.z > c_one)
return c_one;

float closestDepth = linearizeDepth( texture2D(qt_ShadowMap,
shadowCoords.xy).r );
float currentDepth = shadowPos.z;
float shadow = (currentDepth < closestDepth) ? c_one : c_half;

return shadow;
}

With that done, I was now able to render the bike with shadows.
http://i.stack.imgur.com/Rek7c.png

The complete code can be downloaded from here. https://goo.gl/Cf1B3i

Thanks once again Guiseppe!

Best Regards,
Prashanth


On Mon, 1 Feb 2016 at 23:49 Prashanth Udupa 
wrote:

> Hi Guiseppe,
>
> The call "m_shadowFBO->texture();" will not return the depth texture
>> that you need for shadow mapping, but the (useless) color texture that
>> your QOpenGLFramebufferObject contains. There's currently no accessor
>> for the depth texture, nor a way to create a QOGLFBO without a color
>> texture. For this kind of usages it would be better if you roll out your
>> own FBO class :\
>>
>
> Ok. Got it. Thanks :-)
>
> Best Regards,
> Prashanth
>
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] x-platform way to pull app version?

2016-02-01 Thread Thiago Macieira
On Monday 01 February 2016 20:20:51 André Somers wrote:
> Easiest is to let your buildsystem generate some cpp code with the version
> numbers in each build. We compiled in version number, git id an time & date
> with a simple script called from qmake on every build.

Note that it's a bad idea to embed the time and date. A build from the exact 
same sources should produce the exact same binary.

-- 
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] 5.5.1 OSX BTLE compile error - UUID is deprecated

2016-02-01 Thread Thiago Macieira
On Tuesday 02 February 2016 00:26:08 Jason H wrote:
> Back to my original problem, how can I compile 5.5.1 with this UUID thing
> even though it is deprecated?
> 
> I need a working copy of Qt -- with my multimedia changes.

Apply the patch from the change that the bug report Alex linked to.

https://codereview.qt-project.org/126862
https://codereview.qt-project.org/gitweb?p=qt/qtconnectivity.git;a=commit;h=371818e71839280abafae858e9bb53c4ee6b9e5e

There's a diff link in the second.
-- 
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] 5.5.1 OSX BTLE compile error - UUID is deprecated

2016-02-01 Thread Jason H
Back to my original problem, how can I compile 5.5.1 with this UUID thing even 
though it is deprecated?

I need a working copy of Qt -- with my multimedia changes.


> Sent: Monday, February 01, 2016 at 2:53 AM
> From: "Blasche Alexander" 
> To: "interest@qt-project.org" 
> Subject: Re: [Interest] 5.5.1 OSX BTLE compile error - UUID is deprecated
>
> On Friday 29 January 2016 20:49:49 Jason H wrote:
> >> I don't know if this is fixed in 5.6?
> 
> >From: Interest  on behalf of Thiago 
> >Macieira 
> >Looks like it is.
> 
> https://bugreports.qt.io/browse/QTBUG-48518
> 
> --
> Alex
> ___
> 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] x-platform way to pull app version?

2016-02-01 Thread André Somers
Easiest is to let your buildsystem generate some cpp code with the version 
numbers in each build. We compiled in version number, git id an time & date 
with a simple script called from qmake on every build. 

André

Verstuurd vanaf mijn iPhone

> Op 1 feb. 2016 om 16:35 heeft "Jason H"  het volgende 
> geschreven:
> 
> Currently, I have a string that I have to manually maintain, is there a way I 
> can call some function and get my application version (that's in the plist or 
> manifest)?
> ___
> 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] Shadow Mapping using QOpenGLFramebufferObject

2016-02-01 Thread Prashanth Udupa
Hi Guiseppe,

The call "m_shadowFBO->texture();" will not return the depth texture
> that you need for shadow mapping, but the (useless) color texture that
> your QOpenGLFramebufferObject contains. There's currently no accessor
> for the depth texture, nor a way to create a QOGLFBO without a color
> texture. For this kind of usages it would be better if you roll out your
> own FBO class :\
>

Ok. Got it. Thanks :-)

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


Re: [Interest] Shadow Mapping using QOpenGLFramebufferObject

2016-02-01 Thread Giuseppe D'Angelo

Il 01/02/2016 16:09, Prashanth Udupa ha scritto:

Can someone please point to me where I am going wrong please?


The call "m_shadowFBO->texture();" will not return the depth texture 
that you need for shadow mapping, but the (useless) color texture that 
your QOpenGLFramebufferObject contains. There's currently no accessor 
for the depth texture, nor a way to create a QOGLFBO without a color 
texture. For this kind of usages it would be better if you roll out your 
own FBO class :\


(5.6 (finally!) introduces support for MRT in QOGLFBO, limited to color 
textures. In general, QOGLFBO is very limited and needs some love in 
terms of generalising its API to "modern" FBO usages. I've got a sketch 
of a QOGLFBOv2, but that's too long to write it in this small margin -- 
we ought start discussing how to properly develop the OpenGL helpers in 
QtGui in the post GL-ES2 world, possibly in a playground module.) 


Hope this helps,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
KDAB - The Qt Experts



smime.p7s
Description: Firma crittografica S/MIME
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] How to construct a cubemap texture using QOpenGLTexture?

2016-02-01 Thread Prashanth Udupa
Hello there!

I want to construct a cubemap texture using QOpenGLTexture using 6 images
and use it to map reflections on a torus.

I am using the following code to construct the cubemap

const QImage posx =
QImage(":/images/posx.jpg").mirrored().convertToFormat(QImage::Format_RGBA);const
QImage posy = 
QImage(":/images/posy.jpg").mirrored().convertToFormat(QImage::Format_RGBA);const
QImage posz = 
QImage(":/images/posz.jpg").mirrored().convertToFormat(QImage::Format_RGBA);const
QImage negx = 
QImage(":/images/negx.jpg").mirrored().convertToFormat(QImage::Format_RGBA);const
QImage negy = 
QImage(":/images/negy.jpg").mirrored().convertToFormat(QImage::Format_RGBA);const
QImage negz = 
QImage(":/images/negz.jpg").mirrored().convertToFormat(QImage::Format_RGBA);

d->environment = new QOpenGLTexture(QOpenGLTexture::TargetCubeMap);
d->environment->create();
d->environment->setSize(posx.width(), posx.height(), posx.depth());
d->environment->setFormat(QOpenGLTexture::RGBA8_UNorm);
d->environment->allocateStorage();
d->environment->setData(0, 0, QOpenGLTexture::CubeMapPositiveX,
QOpenGLTexture::RGBA, QOpenGLTexture::UInt8,
(const void*)posx.constBits(), 0);
d->environment->setData(0, 0, QOpenGLTexture::CubeMapPositiveY,
QOpenGLTexture::RGBA, QOpenGLTexture::UInt8,
(const void*)posy.constBits(), 0);
d->environment->setData(0, 0, QOpenGLTexture::CubeMapPositiveZ,
QOpenGLTexture::RGBA, QOpenGLTexture::UInt8,
(const void*)posz.constBits(), 0);
d->environment->setData(0, 0, QOpenGLTexture::CubeMapNegativeX,
QOpenGLTexture::RGBA, QOpenGLTexture::UInt8,
(const void*)negx.constBits(), 0);
d->environment->setData(0, 0, QOpenGLTexture::CubeMapNegativeY,
QOpenGLTexture::RGBA, QOpenGLTexture::UInt8,
(const void*)negy.constBits(), 0);
d->environment->setData(0, 0, QOpenGLTexture::CubeMapNegativeZ,
QOpenGLTexture::RGBA, QOpenGLTexture::UInt8,
(const void*)negz.constBits(), 0);
d->environment->setWrapMode(QOpenGLTexture::ClampToEdge);
d->environment->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear);
d->environment->setMagnificationFilter(QOpenGLTexture::LinearMipMapLinear);

I then bind the environment texture during paintGL() as follows

.
d->environment->bind(0);
d->shader->setUniformValue("qt_Environment", 0);
const int nrIndicies = d->torusResolution * d->tubeResolution * 6;
glDrawElements(GL_TRIANGLES, nrIndicies, GL_UNSIGNED_INT, (void*)0);.

Vertex shader snippet is as follows


varying vec3 v_TexCoord;
void main(void){

v_TexCoord = normalize(v_Normal + v_Position);
}

The fragment shader snippet is as follows

.
varying vec3 v_TexCoord;
uniform samplerCube qt_Environment;.

vec4 evaluateColor(in vec3 normal, in vec3 texCoord){
vec3 finalColor 
.
.
finalColor += textureCube(qt_Environment, texCoord).rgb;
return vec4( finalColor, c_one );}
void main(void){
gl_FragColor = evaluateColor(v_Normal, v_TexCoord);}

I also have another part of the code which renders the cubemap on a skybox.
While I am able to project the 6 images on the skybox and render it
properly, I am unable to render the reflection on a torus object in the
scene.

I am getting a well lit torus, with no reflection [
http://i.stack.imgur.com/qWRwN.png ].

You can download the complete code from here [ https://goo.gl/Wu8ccb ]

Can somebody help with this please?

Best Regards,

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


Re: [Interest] How to display custom data entry form on QLineEdit click ?

2016-02-01 Thread Andy
Edward:

"Is the “[=]()” a place holder?"

He's using C++11 lambdas.  There are a couple of good explanations here:


https://stackoverflow.com/questions/7627098/what-is-a-lambda-expression-in-c11


---
Andy Maloney  //  https://asmaloney.com
twitter ~ @asmaloney 


On Mon, Feb 1, 2016 at 12:12 PM, Edward Sutton 
wrote:

> Hi Prashanth,
>
> I do not understand how the connect syntax example or how the signal
> *filteredEvent* is raised?
>
> Could you please elaborate on implementation of the connect?
>
> On Feb 1, 2016, at 10:28 AM, Prashanth Udupa 
> wrote:
>
> Create a Event2Signal class as follows.
>
> #include 
> #include 
> #include 
> #include 
>
> class Event2Signal : public QObject
> {
> Q_OBJECT
>
> public:
> Event2Signal(QObject *parent=0) : QObject(parent) { }
> ~Event2Signal() { }
>
> void filterEvent(QObject *o, QEvent::Type type) {
> if(!o) return;
> if( m_objectEventsMap.contains(o) ) {
> QList &events = m_objectEventsMap[o];
> if(events.contains(type))
> return;
> events.append(type);
> } else {
> m_objectEventsMap[o].append(type);
> o->installEventFilter(this);
> }
> }
>
> signals:
> void filteredEvent(QObject *o, QEvent *e, bool *filtered);
>
> protected:
> bool eventFilter(QObject *obj, QEvent *e) {
> bool filtered = false;
> emit filteredEvent(obj, e, &filtered);
> return filtered;
> }
>
> private:
> QMap > m_objectEventsMap;
> };
>
> Now, lets say you want to take some action when user mouse-presses on a
> lineEdit. You can do this
>
> Event2Signal *e2s = new Event2Signal(lineEdit);
> e2s->filterEvent(lineEdit, QEvent::MouseButtonPress);
> connect(e2s, &Event2Signal::filteredEvent, [=]() {
> // Activate your form and do other things here..
> });
>
>
> I do not understand how the connect syntax example or how the signal
> *filteredEvent* is raised?
>
> Is the “[=]()” a place holder?
>
> If I had:
>
> FormInputData::FormInputData(QWidget *parent) :
>
> QDialog(parent)
>
>   ,ui(new Ui::FormSoftwareUpdateCheck)
>
> {
>
> ui->setupUi(this);
>
>
> //  What does the connect code look like ?
> connect(e2s, &Event2Signal::filteredEvent,
>   this, SLOT(mouseButtonPressHandler)));
> }
>
>
> void FormInputData::mouseButtonPressHandler()
> {
> // Show custom calculator entry form
> }
>
> Thanks,
>
> -Ed
>
>
>
> You can reuse this method for handling other kinds of events in
> signal-slot style.
>
> Hope this helps.
>
> / Prashanth
>
> On Mon, 1 Feb 2016 at 21:41 Edward Sutton 
> wrote:
>
>> I want to display a form with a numeric touch key pad plus a decimal
>> point when user clicks on a QLIneEdit field.
>>
>> I did not see any signal such as editingStarted.
>>
>> What are approaches to implementing a custom data entry?
>>
>> I am targeting Android and iOS with a QWidget app.
>>
>> -Ed
>>
>
>>
> This email and any files transmitted with it from The Charles Machine
> Works, Inc. are confidential and intended solely for the use of the
> individual or entity to which they are addressed. If you have received this
> email in error please notify the sender. Our company accepts no liability
> for the contents of this email, or for the consequences of any actions
> taken on the basis of the information provided, unless that information is
> subsequently confirmed in writing. Please note that any views or opinions
> presented in this email are solely those of the author and do not
> necessarily represent those of the company. Finally, the recipient should
> check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> ___
> 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] How to display custom data entry form on QLineEdit click ?

2016-02-01 Thread Prashanth Udupa
Hi Ed,


> Is the “[=]()” a place holder?
>
>
With Qt 5, you can now use functors and lambda functions for slots:
http://doc.qt.io/qt-5/qobject.html#connect-4.

If you are using a recent compiler which support C++11 standard, then you
should be able to use lambda functions.

Event2Signal *e2s = new Event2Signal(lineEdit);
e2s->filterEvent(lineEdit, QEvent::MouseButtonPress);
connect(e2s, &Event2Signal::filteredEvent,
[=](QObject *o, QEvent *e, bool *filtered) {
// Activate your form and do other things here..
});

Lambda functions have look like this [...]() {  }.

   - The square brackets allow you to capture one or more (or all)
   variables in the current stack. Typically we see usage of =. So when we use
   [=], we are saying that within the lambda function we would like to be able
   to access all variables accessible from the current stack. You could
   specify a list of variables also for example.
   - Within the round brackets, you will need to declare all parameters in
   the signal function.
   - Within the curly braces, you can write your slot code.

You can read up the StackOverflow question that Andy has posted for more
information about this.

Connecting to signals this way frees you from having to write slots in
QObject subclasses all the time.

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


Re: [Interest] x-platform way to pull app version?

2016-02-01 Thread Thiago Macieira
On Monday 01 February 2016 16:35:37 Jason H wrote:
> Currently, I have a string that I have to manually maintain, is there a way
> I can call some function and get my application version (that's in the
> plist or manifest)? 

Please search the Cocoa and Win32 API. That's not a Qt question.

If you want to automate your version number, you can set a macro with it and 
then save:

VERSION = 1.0.1
DEFINES += VERSION=\\\"$$VERSION\\\"

in .cpp:

const char *appversion()
{
return VERSION;
}

-- 
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] How to display custom data entry form on QLineEdit click ?

2016-02-01 Thread Edward Sutton
Hi Prashanth,

I do not understand how the connect syntax example or how the signal 
filteredEvent is raised?

Could you please elaborate on implementation of the connect?

On Feb 1, 2016, at 10:28 AM, Prashanth Udupa 
mailto:prashanth.ud...@gmail.com>> wrote:

Create a Event2Signal class as follows.

#include 
#include 
#include 
#include 

class Event2Signal : public QObject
{
Q_OBJECT

public:
Event2Signal(QObject *parent=0) : QObject(parent) { }
~Event2Signal() { }

void filterEvent(QObject *o, QEvent::Type type) {
if(!o) return;
if( m_objectEventsMap.contains(o) ) {
QList &events = m_objectEventsMap[o];
if(events.contains(type))
return;
events.append(type);
} else {
m_objectEventsMap[o].append(type);
o->installEventFilter(this);
}
}

signals:
void filteredEvent(QObject *o, QEvent *e, bool *filtered);

protected:
bool eventFilter(QObject *obj, QEvent *e) {
bool filtered = false;
emit filteredEvent(obj, e, &filtered);
return filtered;
}

private:
QMap > m_objectEventsMap;
};

Now, lets say you want to take some action when user mouse-presses on a 
lineEdit. You can do this

Event2Signal *e2s = new Event2Signal(lineEdit);
e2s->filterEvent(lineEdit, QEvent::MouseButtonPress);
connect(e2s, &Event2Signal::filteredEvent, [=]() {
// Activate your form and do other things here..
});


I do not understand how the connect syntax example or how the signal 
filteredEvent is raised?

Is the “[=]()” a place holder?

If I had:


FormInputData::FormInputData(QWidget *parent) :

QDialog(parent)

  ,ui(new Ui::FormSoftwareUpdateCheck)

{

ui->setupUi(this);


//  What does the connect code look like ?
connect(e2s, &Event2Signal::filteredEvent,
  this, SLOT(mouseButtonPressHandler)));
}

void FormInputData::mouseButtonPressHandler()
{
// Show custom calculator entry form
}

Thanks,

-Ed



You can reuse this method for handling other kinds of events in signal-slot 
style.

Hope this helps.

/ Prashanth

On Mon, 1 Feb 2016 at 21:41 Edward Sutton 
mailto:edward.sut...@subsite.com>> wrote:
I want to display a form with a numeric touch key pad plus a decimal point when 
user clicks on a QLIneEdit field.

I did not see any signal such as editingStarted.

What are approaches to implementing a custom data entry?

I am targeting Android and iOS with a QWidget app.

-Ed


This email and any files transmitted with it from The Charles Machine Works, 
Inc. are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you have received this email in error 
please notify the sender. Our company accepts no liability for the contents of 
this email, or for the consequences of any actions taken on the basis of the 
information provided, unless that information is subsequently confirmed in 
writing. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to display custom data entry form on QLineEdit click ?

2016-02-01 Thread Edward Sutton
Thank you Prashanth.

Your approach could be useful in *many* situations.

Thank you!

-Ed


On Feb 1, 2016, at 10:28 AM, Prashanth Udupa 
mailto:prashanth.ud...@gmail.com>> wrote:

Create a Event2Signal class as follows.

#include 
#include 
#include 
#include 

class Event2Signal : public QObject
{
Q_OBJECT

public:
Event2Signal(QObject *parent=0) : QObject(parent) { }
~Event2Signal() { }

void filterEvent(QObject *o, QEvent::Type type) {
if(!o) return;
if( m_objectEventsMap.contains(o) ) {
QList &events = m_objectEventsMap[o];
if(events.contains(type))
return;
events.append(type);
} else {
m_objectEventsMap[o].append(type);
o->installEventFilter(this);
}
}

signals:
void filteredEvent(QObject *o, QEvent *e, bool *filtered);

protected:
bool eventFilter(QObject *obj, QEvent *e) {
bool filtered = false;
emit filteredEvent(obj, e, &filtered);
return filtered;
}

private:
QMap > m_objectEventsMap;
};

Now, lets say you want to take some action when user mouse-presses on a 
lineEdit. You can do this

Event2Signal *e2s = new Event2Signal(lineEdit);
e2s->filterEvent(lineEdit, QEvent::MouseButtonPress);
connect(e2s, &Event2Signal::filteredEvent, [=]() {
// Activate your form and do other things here..
});

You can reuse this method for handling other kinds of events in signal-slot 
style.

Hope this helps.

/ Prashanth

On Mon, 1 Feb 2016 at 21:41 Edward Sutton 
mailto:edward.sut...@subsite.com>> wrote:
I want to display a form with a numeric touch key pad plus a decimal point when 
user clicks on a QLIneEdit field.

I did not see any signal such as editingStarted.

What are approaches to implementing a custom data entry?

I am targeting Android and iOS with a QWidget app.

-Ed


This email and any files transmitted with it from The Charles Machine Works, 
Inc. are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you have received this email in error 
please notify the sender. Our company accepts no liability for the contents of 
this email, or for the consequences of any actions taken on the basis of the 
information provided, unless that information is subsequently confirmed in 
writing. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to display custom data entry form on QLineEdit click ?

2016-02-01 Thread Edward Sutton
Thank you Igor.

On Feb 1, 2016, at 10:18 AM, Igor Mironchik 
mailto:igor.mironc...@gmail.com>> wrote:

Hi,

On 01.02.2016 19:11, Edward Sutton wrote:
I want to display a form with a numeric touch key pad plus a decimal point when 
user clicks on a QLIneEdit field.

I did not see any signal such as editingStarted.

What are approaches to implementing a custom data entry?

I am targeting Android and iOS with a QWidget app.

You can derive from QLineEdit and override mousePressEvent() or 
mouseReleaseEvent() and pop-up of your key pad…

That sounds straight forward enough.  Thank you!

-Ed

This email and any files transmitted with it from The Charles Machine Works, 
Inc. are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you have received this email in error 
please notify the sender. Our company accepts no liability for the contents of 
this email, or for the consequences of any actions taken on the basis of the 
information provided, unless that information is subsequently confirmed in 
writing. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] [Qt3D] Several Problems w/Examples

2016-02-01 Thread Andy
I am having problems with several of the examples included in Qt3D.

   • deferred-renderer-cpp (black screen)
   • deferred-renderer-qml (black screen)
   • enabled-qml (maybe - just flashes a bunch of random shapes?)
   • gltf (crash on quit)
   • instanced-arrays-qml (crash on quit)
   • planets-qml (fails to quit)
   • playground-qml (black screen)
   • scene3d-loader (crash clicking between the two buttons)
   • simple-qml (fails to quit)
   • torus-qml (crash on quit)

I'm using the latest Qt3D built from the 5.6 branch.

Mac OS X 10.10.5 on an iMac w/NVIDIA GeForce GTX.

I reported one:

   https://bugreports.qt.io/browse/QTBUG-50692

But I haven't been told what other info is needed, so it seems to be stuck
in "Need More Info".

Is anyone else having similar problems with any of these examples?

Thanks!

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


Re: [Interest] How to display custom data entry form on QLineEdit click ?

2016-02-01 Thread Prashanth Udupa
Create a Event2Signal class as follows.

#include 
#include 
#include 
#include 

class Event2Signal : public QObject
{
Q_OBJECT

public:
Event2Signal(QObject *parent=0) : QObject(parent) { }
~Event2Signal() { }

void filterEvent(QObject *o, QEvent::Type type) {
if(!o) return;
if( m_objectEventsMap.contains(o) ) {
QList &events = m_objectEventsMap[o];
if(events.contains(type))
return;
events.append(type);
} else {
m_objectEventsMap[o].append(type);
o->installEventFilter(this);
}
}

signals:
void filteredEvent(QObject *o, QEvent *e, bool *filtered);

protected:
bool eventFilter(QObject *obj, QEvent *e) {
bool filtered = false;
emit filteredEvent(obj, e, &filtered);
return filtered;
}

private:
QMap > m_objectEventsMap;
};

Now, lets say you want to take some action when user mouse-presses on a
lineEdit. You can do this

Event2Signal *e2s = new Event2Signal(lineEdit);
e2s->filterEvent(lineEdit, QEvent::MouseButtonPress);
connect(e2s, &Event2Signal::filteredEvent, [=]() {
// Activate your form and do other things here..
});

You can reuse this method for handling other kinds of events in signal-slot
style.

Hope this helps.

/ Prashanth

On Mon, 1 Feb 2016 at 21:41 Edward Sutton  wrote:

> I want to display a form with a numeric touch key pad plus a decimal point
> when user clicks on a QLIneEdit field.
>
> I did not see any signal such as editingStarted.
>
> What are approaches to implementing a custom data entry?
>
> I am targeting Android and iOS with a QWidget app.
>
> -Ed
>

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


Re: [Interest] How to display custom data entry form on QLineEdit click ?

2016-02-01 Thread Igor Mironchik

Hi,

On 01.02.2016 19:11, Edward Sutton wrote:

I want to display a form with a numeric touch key pad plus a decimal point when 
user clicks on a QLIneEdit field.

I did not see any signal such as editingStarted.

What are approaches to implementing a custom data entry?

I am targeting Android and iOS with a QWidget app.


You can derive from QLineEdit and override mousePressEvent() or 
mouseReleaseEvent() and pop-up of your key pad...




-Ed
This email and any files transmitted with it from The Charles Machine Works, 
Inc. are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you have received this email in error 
please notify the sender. Our company accepts no liability for the contents of 
this email, or for the consequences of any actions taken on the basis of the 
information provided, unless that information is subsequently confirmed in 
writing. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
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 display custom data entry form on QLineEdit click ?

2016-02-01 Thread Edward Sutton
I want to display a form with a numeric touch key pad plus a decimal point when 
user clicks on a QLIneEdit field.

I did not see any signal such as editingStarted.

What are approaches to implementing a custom data entry?

I am targeting Android and iOS with a QWidget app.

-Ed
This email and any files transmitted with it from The Charles Machine Works, 
Inc. are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you have received this email in error 
please notify the sender. Our company accepts no liability for the contents of 
this email, or for the consequences of any actions taken on the basis of the 
information provided, unless that information is subsequently confirmed in 
writing. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] x-platform way to pull app version?

2016-02-01 Thread Jason H
Currently, I have a string that I have to manually maintain, is there a way I 
can call some function and get my application version (that's in the plist or 
manifest)?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] qtandroidextras notification example question

2016-02-01 Thread aj

Hi,
im trying to compile and run the Qt Notifier [1] example on my android 
5 device.


Unfortunately it doesnt work for me as there are no notifications, 
instead it throws a NullPointerException. When debugging the java part 
of it in Android Studio it seems because the m_instance from the class 
never got initialized, thus the exception when calling a function on it.


Do i have to take care of something special to get this to work?

My understanding of java is that the static instance variable should be 
initialized at the time im calling the static notify function from the 
qml part of the code, or am im missing something?


Im using qt 5.5.1 on mac with jdk 1.7.0_79 ndk r10e sdk 21

Regards,
Adrian Jäkel

[1] http://doc.qt.io/qt-5/qtandroidextras-notification-example.html
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] show qt application on hdmi video output

2016-02-01 Thread Stefano Gurrieri
Hi,
on my system (based on iMx6) I've two video output; specifically:
on /dev/fb0 I've linked a display lvds (800x600)
on /dev/fb2 I/ve linked a display hdmi (1920x1080)

Normally, my qml app runs on /dev/fb0. But now, I've the necessity to run
this application on /dev/fb2 (hdmi output).

So I set the variable QT_QPA_EGLFS_FB=/dev/fb2 but I don't see the app runs
on hdmi.

Someone could you help me?

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