Menu

#17 puic bug when using database

closed-fixed
None
5
2003-03-03
2003-02-23
No

Hello Germain,

again a small, but annoying bug in puic and I think
formerly also
in uic (that's the reason it is in puic).
The problem:
When using Database objects like QDataTables puic
always produces statements like:

dbTier->{_strlist} = ['praxis_con', 'Tier'];
dbTier->setProperty("database",Qt::Variant(dbTier->{_strlist}));

These statements are unnecessary and result in a
warning during runtime:
QDataBrowser::setProperty( "database", value ) failed:
property invalid, read-only or does not exist

By comparing object.cpp in PerlQt3.006 and the Qt3.1.1
object.cpp
I found one very "enlightening" statement in the
"original":

object.cpp

146 if ( prop == "database" )
147 continue;

And thats what I put to line 180 of your object.cpp
which removes the
"dbTier->setProperty("database",
Qt::Variant(dbTier->{_strlist}));" line.
The "dbTier->{_strlist} = ['praxis_con', 'Tier'];"
remains, but does not result
in error messages.

Thanks,

Michael

Discussion

  • germain garand

    germain garand - 2003-03-03

    Logged In: YES
    user_id=145773

    Hello Michael :)
    Good one, thanks!
    We can even skip the useless stringlist by putting the statement before the
    setObjectProperty call.

     
  • germain garand

    germain garand - 2003-03-03
    • assigned_to: nobody --> germaingarand
    • status: open --> closed-fixed
     

Log in to post a comment.