Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, November 2006
problem with application


Message 1 in thread

Hello,
first, I'm sorry by my english.

I am creating an application with a lot of CheckBox in the screen. But, 
as long as I'm adding checkbox and I'm performing the screen, the 
kernel is showing me the next messenger:

*** glibc detected *** ./principal: double free or corruption (out): 
0x091b10e8 ***

When I finish to add all checkbox, I can't to show the screen because 
the kernel show the next messenger:

violacion de segmento

I'm using Qt 3.3.4. The file's name is coordformbase.cpp and those are 
the checkbox's code I'm adding to file .cpp:

QWidget* privateLayoutWidget_6 = new QWidget( frameinf, "layout23" );
    privateLayoutWidget_6->setGeometry( QRect( 125, 90, 82, 22 ) );
    layout23 = new QHBoxLayout( privateLayoutWidget_6, 0, 0, 
"layout23");       q6checkBox_2 = new QCheckBox( privateLayoutWidget_6, 
"q6checkBox_2" );
    q6checkBox_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, 
(QSizePolicy::SizeType)4, 0, 0, 
q6checkBox_2->sizePolicy().hasHeightForWidth() ) );
    q6checkBox_2->setMaximumSize( QSize( 44, 20 ) );
    layout23->addWidget( q6checkBox_2 );
       q7checkBox_2 = new QCheckBox( privateLayoutWidget_6, "q7checkBox_2" );
    q7checkBox_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, 
(QSizePolicy::SizeType)4, 0, 0, 
q7checkBox_2->sizePolicy().hasHeightForWidth() ) );
    q7checkBox_2->setMaximumSize( QSize( 44, 20 ) );
    layout23->addWidget( q7checkBox_2 );

Could anyone help me?
Thanks you
Regards
-- 
 [ signature omitted ] 

Message 2 in thread

Hi Carlos,

GONZALEZ DE LA VEGA, CARLOS escribió:
> I am creating an application with a lot of CheckBox in the screen. 
> But, as long as I'm adding checkbox and I'm performing the screen, the 
> kernel is showing me the next messenger:
>
> *** glibc detected *** ./principal: double free or corruption (out): 
> 0x091b10e8 ***
I see. Sometimes I receive this kind of messages, then I recompile my 
program and everything goes right! :)
> When I finish to add all checkbox, I can't to show the screen because 
> the kernel show the next messenger:
>
> violacion de segmento
For non spanish-speakers: "violación de segmento" is the same as 
"segmentation fault" ;)
When you say you finish adding checkboxes, are you talking about adding 
on designer, code, etc or you have a way to dinamically add checkboxes 
to your app?

>
> I'm using Qt 3.3.4. The file's name is coordformbase.cpp and those are 
> the checkbox's code I'm adding to file .cpp:
>
> QWidget* privateLayoutWidget_6 = new QWidget( frameinf, "layout23" );
>    privateLayoutWidget_6->setGeometry( QRect( 125, 90, 82, 22 ) );
>    layout23 = new QHBoxLayout( privateLayoutWidget_6, 0, 0, 
> "layout23");       q6checkBox_2 = new QCheckBox( 
> privateLayoutWidget_6, "q6checkBox_2" );
>    q6checkBox_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, 
> (QSizePolicy::SizeType)4, 0, 0, 
> q6checkBox_2->sizePolicy().hasHeightForWidth() ) );
>    q6checkBox_2->setMaximumSize( QSize( 44, 20 ) );
>    layout23->addWidget( q6checkBox_2 );
>       q7checkBox_2 = new QCheckBox( privateLayoutWidget_6, 
> "q7checkBox_2" );
>    q7checkBox_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, 
> (QSizePolicy::SizeType)4, 0, 0, 
> q7checkBox_2->sizePolicy().hasHeightForWidth() ) );
>    q7checkBox_2->setMaximumSize( QSize( 44, 20 ) );
>    layout23->addWidget( q7checkBox_2 );
Mmm, at first sight, can't see anything bad on your code. Are you sure 
this part of code is to blame?

Regards, Saludos,
Javier.

--
 [ signature omitted ] 

Message 3 in thread

Hi

> For non spanish-speakers: "violación de segmento" is the same as
> "segmentation fault" ;)

Thanks you, I have to learn

> When you say you finish adding checkboxes, are you talking about
> adding on designer, code, etc or you have a way to dinamically add
> checkboxes to your app?

I add checkboxes in my code

> Mmm, at first sight, can't see anything bad on your code. Are you
> sure this part of code is to blame?

I think that is the problem,because I have been adding gradually the
checkbox's code and then I was checking whether the screen worked,
until I got the stranger problem that I have now.

Regards and thank you.

--
 [ signature omitted ]