Debugging Label Engine

Hi guys,

I’m working on debugging the Label render engine this morning. Here’s
the root cause:

GLWidget *gl = qobject_cast<GLWidget *>(parent());
if(!gl) {
return false;
}

We always return false from this. From a little debugging, it seems
like parent() returns a value, but the cast fails(!)

This isn’t limited to the Label engine, the same thing happens in
bsengine.cpp – we never set the normal vector.

Any suggestions here? Does this work for other people?

Thanks,
-Geoff

I am able to get the parent widget. I’ll run some tests.

The only thing I can imagine that is happening is that for some reason
at runtime you are linking to an old version of the GLWidget which
didn’t set the parent. What’s ‘ldd’ say? It was just recently that I
implemented so that the engines actually had their parent set. I hope
it’s not a Mac issue but i can’t believe something like this would be.


I just ran some tests and confirmed i’m not having any problems with
this statement.

-Donald

(Mon, Apr 09, 2007 at 11:18:13AM -0400) Geoffrey Hutchison geoff.hutchison@gmail.com:

Hi guys,

I’m working on debugging the Label render engine this morning. Here’s
the root cause:

GLWidget *gl = qobject_cast<GLWidget *>(parent());
if(!gl) {
return false;
}

We always return false from this. From a little debugging, it seems
like parent() returns a value, but the cast fails(!)

This isn’t limited to the Label engine, the same thing happens in
bsengine.cpp – we never set the normal vector.

Any suggestions here? Does this work for other people?

Thanks,
-Geoff


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
avogadro-devel List Signup and Options

On Apr 9, 2007, at 12:22 PM, Donald Ephraim Curtis wrote:

implemented so that the engines actually had their parent set. I hope
it’s not a Mac issue but i can’t believe something like this would be.

Well, are you seeing labels?

I don’t know, maybe it’s a 4.3-beta issue. Unfortunately, I’m not
sure if I can go back easily.

I’ll try downgrading to 4.2.3 and see if that works.

Thanks,
-Geoff

On Apr 9, 2007, at 3:34 PM, Donald Ephraim Curtis wrote:

Yeah, i see labels. It’s possible it’s a 4.3 issue as i’m using 4.2.
But is gl getting set to NULL? That’s a problem that needs to be
fixed.

As I said, it looks like it has a parent() that is non-NULL. But the
qobject_cast gives me NULL.

Here’s where it looks like a Qt/Mac issue somehow. I switched to
4.2.3. I looked up how to find out the type of parent().

cerr << " meta obj " << parent()->metaObject()->className() << endl;

Yes, that’s right. I get:
" meta obj Avogadro::GLWidget"

So I do in fact have a legal GLWidget that qobject_cast flunks. I’ll
file a bug.

Cheers,
-Geoff

I’m not sure how qobject_cast works when you specify a type but it
could also be somehow related to linking to a library with a different
header than the one you compiled with. Maybe, just another guess.

(Mon, Apr 09, 2007 at 03:26:25PM -0400) Geoffrey Hutchison geoff.hutchison@gmail.com:

On Apr 9, 2007, at 3:34 PM, Donald Ephraim Curtis wrote:

Yeah, i see labels. It’s possible it’s a 4.3 issue as i’m using 4.2.
But is gl getting set to NULL? That’s a problem that needs to be
fixed.

As I said, it looks like it has a parent() that is non-NULL. But the
qobject_cast gives me NULL.

Here’s where it looks like a Qt/Mac issue somehow. I switched to
4.2.3. I looked up how to find out the type of parent().

cerr << " meta obj " << parent()->metaObject()->className() << endl;

Yes, that’s right. I get:
" meta obj Avogadro::GLWidget"

So I do in fact have a legal GLWidget that qobject_cast flunks. I’ll
file a bug.

Cheers,
-Geoff

Yeah, i see labels. It’s possible it’s a 4.3 issue as i’m using 4.2.
But is gl getting set to NULL? That’s a problem that needs to be fixed.

(Mon, Apr 09, 2007 at 02:17:07PM -0400) Geoffrey Hutchison geoff.hutchison@gmail.com:

On Apr 9, 2007, at 12:22 PM, Donald Ephraim Curtis wrote:

implemented so that the engines actually had their parent set. I hope
it’s not a Mac issue but i can’t believe something like this would be.

Well, are you seeing labels?

I don’t know, maybe it’s a 4.3-beta issue. Unfortunately, I’m not
sure if I can go back easily.

I’ll try downgrading to 4.2.3 and see if that works.

Thanks,
-Geoff