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

Qt-interest Archive, July 2007
Qt-4.3.0: QWizard / QWizardPage registerField and field() with QComboBox


Message 1 in thread

Hello !

Can anybody tell me, what I make wrong ?

I try to register a Field with registerField( "test", combo ); on the  
first QWizardPage and try to get the value on the second
with if( field( "test" ).toBool() ) qDebug( "Yes, ComboBox was  
checked" );

But it  doesn't work (it never prints the Debugmsg, checked or  
unchecked)

Does anyone can give me a tip ?

Thanks for helping !

Best regards,

Heiko

--
 [ signature omitted ] 

Message 2 in thread

combo is (I guess) a pointer to a QComboBox -- so toBool() will always
return false.

Maybe you need a QCheckBox?

Sam Dutton




 





SAM DUTTON
SENIOR SITE DEVELOPER

200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4496
F 
E SAM.DUTTON@xxxxxxxxx
WWW.ITN.CO.UK

-----Original Message-----

From: Heiko Steindl [mailto:heiko@xxxxxx] 
Sent: Wednesday 25 July 2007 17:47
To: qt-interest@xxxxxxxxxxxxx
Subject: Qt-4.3.0: QWizard / QWizardPage registerField and field() with
QComboBox

Hello !

Can anybody tell me, what I make wrong ?

I try to register a Field with registerField( "test", combo ); on the
first QWizardPage and try to get the value on the second with if( field(
"test" ).toBool() ) qDebug( "Yes, ComboBox was checked" );

But it  doesn't work (it never prints the Debugmsg, checked or
unchecked)

Does anyone can give me a tip ?

Thanks for helping !

Best regards,

Heiko

--
 [ signature omitted ] 

Message 3 in thread

sorry, my fault !

I have already a QCheckBox, but I missnamed it in the example before.  
(instead of combo, its name is checkbox)

Thanks a lot !


> I try to register a Field with registerField( "test", checkBox );  
> on the
> first QWizardPage and try to get the value on the second with if 
> ( field(
> "test" ).toBool() ) qDebug( "Yes, checkBox was checked" );


Heiko


Am 25.07.2007 um 19:11 schrieb Dutton, Sam:

> combo is (I guess) a pointer to a QComboBox -- so toBool() will always
> return false.
>
> Maybe you need a QCheckBox?
>
> Sam Dutton
>
>
>
>
>
>
>
>
>
>
> SAM DUTTON
> SENIOR SITE DEVELOPER
>
> 200 GRAY'S INN ROAD
> LONDON
> WC1X 8XZ
> UNITED KINGDOM
> T +44 (0)20 7430 4496
> F
> E SAM.DUTTON@xxxxxxxxx
> WWW.ITN.CO.UK
>
> -----Original Message-----
>
> From: Heiko Steindl [mailto:heiko@xxxxxx]
> Sent: Wednesday 25 July 2007 17:47
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Qt-4.3.0: QWizard / QWizardPage registerField and field()  
> with
> QComboBox
>
> Hello !
>
> Can anybody tell me, what I make wrong ?
>
> I try to register a Field with registerField( "test", combo ); on the
> first QWizardPage and try to get the value on the second with if 
> ( field(
> "test" ).toBool() ) qDebug( "Yes, ComboBox was checked" );
>
> But it  doesn't work (it never prints the Debugmsg, checked or
> unchecked)
>
> Does anyone can give me a tip ?
>
> Thanks for helping !
>
> Best regards,
>
> Heiko
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> Please Note:
>
>
>
> Any views or opinions are solely those of the author and do not  
> necessarily represent
> those of Independent Television News Limited unless specifically  
> stated.
> This email and any files attached 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  
> postmaster@xxxxxxxxx
>
> Please note that to ensure regulatory compliance and for the  
> protection of our clients and business,
> we may monitor and read messages sent to and from our systems.
>
> Thank You.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ] 

Message 4 in thread

If it still doesn't work:
- make sure that the checkbox pointer is valid (in both places)
- check that both bits of code are being called.

Sam

-----Original Message-----
From: Heiko Steindl [mailto:heiko@xxxxxx] 
Sent: Wednesday 25 July 2007 18:51
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Qt-4.3.0: QWizard / QWizardPage registerField and field()
with QComboBox

sorry, my fault !

I have already a QCheckBox, but I missnamed it in the example before.  
(instead of combo, its name is checkbox)

Thanks a lot !


> I try to register a Field with registerField( "test", checkBox ); on 
> the first QWizardPage and try to get the value on the second with if (

> field( "test" ).toBool() ) qDebug( "Yes, checkBox was checked" );


Heiko


Am 25.07.2007 um 19:11 schrieb Dutton, Sam:

> combo is (I guess) a pointer to a QComboBox -- so toBool() will always

> return false.
>
> Maybe you need a QCheckBox?
>
> Sam Dutton
>
>
>
>
>
>
>
>
>
>
> SAM DUTTON
> SENIOR SITE DEVELOPER
>
> 200 GRAY'S INN ROAD
> LONDON
> WC1X 8XZ
> UNITED KINGDOM
> T +44 (0)20 7430 4496
> F
> E SAM.DUTTON@xxxxxxxxx
> WWW.ITN.CO.UK
>
> -----Original Message-----
>
> From: Heiko Steindl [mailto:heiko@xxxxxx]
> Sent: Wednesday 25 July 2007 17:47
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Qt-4.3.0: QWizard / QWizardPage registerField and field() 
> with QComboBox
>
> Hello !
>
> Can anybody tell me, what I make wrong ?
>
> I try to register a Field with registerField( "test", combo ); on the 
> first QWizardPage and try to get the value on the second with if ( 
> field( "test" ).toBool() ) qDebug( "Yes, ComboBox was checked" );
>
> But it  doesn't work (it never prints the Debugmsg, checked or
> unchecked)
>
> Does anyone can give me a tip ?
>
> Thanks for helping !
>
> Best regards,
>
> Heiko
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with

> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> Please Note:
>
>
>
> Any views or opinions are solely those of the author and do not 
> necessarily represent those of Independent Television News Limited 
> unless specifically stated.
> This email and any files attached 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 
> postmaster@xxxxxxxxx
>
> Please note that to ensure regulatory compliance and for the 
> protection of our clients and business, we may monitor and read 
> messages sent to and from our systems.
>
> Thank You.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with

> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ] 

Message 5 in thread

Hello !

thanks, but I do not find the failure ;-(

Here is the test code, I hope it helps :

.h File
=====

class DownloadPage : public QWizardPage
{
    Q_OBJECT

    public:
        DownloadPage( QWidget *parent = 0 );
        int nextId() const;

    private:
        QLabel *topLabel;
        QCheckBox *checkBox;
};

.cpp File
======
DownloadPage::DownloadPage( QWidget *parent ) : QWizardPage( parent )
{
topLabel = new QLabel( "Some Text" );

topLabel->setWordWrap( true );

QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget( topLabel );   

checkBox = new QCheckBox( "TEST" );
layout->addWidget( checkBox );
registerField( "test", checkBox );
setLayout( layout );
}


And so I try to find out, if the checkbox was clicked:

Dutton, Sam schrieb:
> If it still doesn't work:
> - make sure that the checkbox pointer is valid (in both places)
> - check that both bits of code are being called.
>
> Sam
>
> -----Original Message-----
> From: Heiko Steindl [mailto:heiko@xxxxxx] 
> Sent: Wednesday 25 July 2007 18:51
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: Qt-4.3.0: QWizard / QWizardPage registerField and field()
> with QComboBox
>
> sorry, my fault !
>
> I have already a QCheckBox, but I missnamed it in the example before.  
> (instead of combo, its name is checkbox)
>
> Thanks a lot !
>
>
>   
>> I try to register a Field with registerField( "test", checkBox ); on 
>> the first QWizardPage and try to get the value on the second with if (
>>     
>
>   
>> field( "test" ).toBool() ) qDebug( "Yes, checkBox was checked" );
>>     
>
>
> Heiko
>
>
> Am 25.07.2007 um 19:11 schrieb Dutton, Sam:
>
>   
>> combo is (I guess) a pointer to a QComboBox -- so toBool() will always
>>     
>
>   
>> return false.
>>
>> Maybe you need a QCheckBox?
>>
>> Sam Dutton
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> SAM DUTTON
>> SENIOR SITE DEVELOPER
>>
>> 200 GRAY'S INN ROAD
>> LONDON
>> WC1X 8XZ
>> UNITED KINGDOM
>> T +44 (0)20 7430 4496
>> F
>> E SAM.DUTTON@xxxxxxxxx
>> WWW.ITN.CO.UK
>>
>> -----Original Message-----
>>
>> From: Heiko Steindl [mailto:heiko@xxxxxx]
>> Sent: Wednesday 25 July 2007 17:47
>> To: qt-interest@xxxxxxxxxxxxx
>> Subject: Qt-4.3.0: QWizard / QWizardPage registerField and field() 
>> with QComboBox
>>
>> Hello !
>>
>> Can anybody tell me, what I make wrong ?
>>
>> I try to register a Field with registerField( "test", combo ); on the 
>> first QWizardPage and try to get the value on the second with if ( 
>> field( "test" ).toBool() ) qDebug( "Yes, ComboBox was checked" );
>>
>> But it  doesn't work (it never prints the Debugmsg, checked or
>> unchecked)
>>
>> Does anyone can give me a tip ?
>>
>> Thanks for helping !
>>
>> Best regards,
>>
>> Heiko
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>>     
>
>   
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>> Please Note:
>>
>>
>>
>> Any views or opinions are solely those of the author and do not 
>> necessarily represent those of Independent Television News Limited 
>> unless specifically stated.
>> This email and any files attached 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 
>> postmaster@xxxxxxxxx
>>
>> Please note that to ensure regulatory compliance and for the 
>> protection of our clients and business, we may monitor and read 
>> messages sent to and from our systems.
>>
>> Thank You.
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>>     
>
>   
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>
>>     
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> Please Note:
>
>  
>
> Any views or opinions are solely those of the author and do not necessarily represent 
> those of Independent Television News Limited unless specifically stated. 
> This email and any files attached 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 postmaster@xxxxxxxxx 
>
> Please note that to ensure regulatory compliance and for the protection of our clients and business,
> we may monitor and read messages sent to and from our systems.
>
> Thank You.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
>   


Message 6 in thread

Hello !

thanks, but I do not find the failure ;-(

Here is the test code, I hope it helps :

.h File
=====

class DownloadPage : public QWizardPage
{
    Q_OBJECT

    public:
        DownloadPage( QWidget *parent = 0 );
        int nextId() const;

    private:
        QLabel *topLabel;
        QCheckBox *checkBox;
};

.cpp File
======
DownloadPage::DownloadPage( QWidget *parent ) : QWizardPage( parent )
{
topLabel = new QLabel( "Some Text" );

topLabel->setWordWrap( true );

QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget( topLabel );   

checkBox = new QCheckBox( "TEST" );
layout->addWidget( checkBox );
registerField( "test", checkBox );
setLayout( layout );
}


And so I try to find out, if the checkbox was clicked:

NextPage::NextPage( QWidget *parent ) : QWizardPage( parent )
{
if( field( "test" ).toBool() )
        qDebug( "Box is clicked" );
}

Thanks a lot for helping !

Heiko

Dutton, Sam schrieb:
> If it still doesn't work:
> - make sure that the checkbox pointer is valid (in both places)
> - check that both bits of code are being called.
>
> Sam
>
> -----Original Message-----
> From: Heiko Steindl [mailto:heiko@xxxxxx] 
> Sent: Wednesday 25 July 2007 18:51
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: Qt-4.3.0: QWizard / QWizardPage registerField and field()
> with QComboBox
>
> sorry, my fault !
>
> I have already a QCheckBox, but I missnamed it in the example before.  
> (instead of combo, its name is checkbox)
>
> Thanks a lot !
>
>
>   
>> I try to register a Field with registerField( "test", checkBox ); on 
>> the first QWizardPage and try to get the value on the second with if (
>>     
>
>   
>> field( "test" ).toBool() ) qDebug( "Yes, checkBox was checked" );
>>     
>
>
> Heiko
>
>
> Am 25.07.2007 um 19:11 schrieb Dutton, Sam:
>
>   
>> combo is (I guess) a pointer to a QComboBox -- so toBool() will always
>>     
>
>   
>> return false.
>>
>> Maybe you need a QCheckBox?
>>
>> Sam Dutton
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> SAM DUTTON
>> SENIOR SITE DEVELOPER
>>
>> 200 GRAY'S INN ROAD
>> LONDON
>> WC1X 8XZ
>> UNITED KINGDOM
>> T +44 (0)20 7430 4496
>> F
>> E SAM.DUTTON@xxxxxxxxx
>> WWW.ITN.CO.UK
>>
>> -----Original Message-----
>>
>> From: Heiko Steindl [mailto:heiko@xxxxxx]
>> Sent: Wednesday 25 July 2007 17:47
>> To: qt-interest@xxxxxxxxxxxxx
>> Subject: Qt-4.3.0: QWizard / QWizardPage registerField and field() 
>> with QComboBox
>>
>> Hello !
>>
>> Can anybody tell me, what I make wrong ?
>>
>> I try to register a Field with registerField( "test", combo ); on the 
>> first QWizardPage and try to get the value on the second with if ( 
>> field( "test" ).toBool() ) qDebug( "Yes, ComboBox was checked" );
>>
>> But it  doesn't work (it never prints the Debugmsg, checked or
>> unchecked)
>>
>> Does anyone can give me a tip ?
>>
>> Thanks for helping !
>>
>> Best regards,
>>
>> Heiko
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>>     
>
>   
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>> Please Note:
>>
>>
>>
>> Any views or opinions are solely those of the author and do not 
>> necessarily represent those of Independent Television News Limited 
>> unless specifically stated.
>> This email and any files attached 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 
>> postmaster@xxxxxxxxx
>>
>> Please note that to ensure regulatory compliance and for the 
>> protection of our clients and business, we may monitor and read 
>> messages sent to and from our systems.
>>
>> Thank You.
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>>     
>
>   
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>
>>     
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> Please Note:
>
>  
>
> Any views or opinions are solely those of the author and do not necessarily represent 
> those of Independent Television News Limited unless specifically stated. 
> This email and any files attached 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 postmaster@xxxxxxxxx 
>
> Please note that to ensure regulatory compliance and for the protection of our clients and business,
> we may monitor and read messages sent to and from our systems.
>
> Thank You.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
>   


Message 7 in thread

Can't see anything wrong. 
 
I'm just guessing now, but...
 
Maybe you need to make checkbox a child of the DownloadPage instance,
i.e. checkBox = new QCheckBox( "TEST", this )?
 
You could try adding a different widget (e.g. a lineedit) and call a
different QVariant function (e.g. toString()) to see what happens.
 
For sanity checking, instead of 
 
    if( field( "test" ).toBool() ) 
        qDebug( "Box is clicked" );
 
try 
 
    if (true)
        qDebug( "Box is clicked" );
 
or try
 
    bool b =  field( "test" ).toBool() ;
    if(b) 
        qDebug( "Box is clicked" );
 
 
Maybe field() won't work in the NextPage *constructor*?
 
Sam
 
 

________________________________

From: Heiko Steindl [mailto:heiko@xxxxxx] 
Sent: Thursday 26 July 2007 08:17
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Qt-4.3.0: QWizard / QWizardPage registerField and field()
with QComboBox


Hello !

thanks, but I do not find the failure ;-(

Here is the test code, I hope it helps :

.h File
=====

class DownloadPage : public QWizardPage
{
    Q_OBJECT

    public:
        DownloadPage( QWidget *parent = 0 );
        int nextId() const;

    private:
        QLabel *topLabel;
        QCheckBox *checkBox;
};

.cpp File
======
DownloadPage::DownloadPage( QWidget *parent ) : QWizardPage( parent )
{
topLabel = new QLabel( "Some Text" );

topLabel->setWordWrap( true );

QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget( topLabel );    

checkBox = new QCheckBox( "TEST" );
layout->addWidget( checkBox );
registerField( "test", checkBox );
setLayout( layout );
}


And so I try to find out, if the checkbox was clicked:

NextPage::NextPage( QWidget *parent ) : QWizardPage( parent )
{
if( field( "test" ).toBool() ) 
        qDebug( "Box is clicked" );
}

Thanks a lot for helping ! 

Heiko

Dutton, Sam schrieb: 

	If it still doesn't work:
	- make sure that the checkbox pointer is valid (in both places)
	- check that both bits of code are being called.
	
	Sam
	
	-----Original Message-----
	From: Heiko Steindl [mailto:heiko@xxxxxx] 
	Sent: Wednesday 25 July 2007 18:51
	To: qt-interest@xxxxxxxxxxxxx
	Subject: Re: Qt-4.3.0: QWizard / QWizardPage registerField and
field()
	with QComboBox
	
	sorry, my fault !
	
	I have already a QCheckBox, but I missnamed it in the example
before.  
	(instead of combo, its name is checkbox)
	
	Thanks a lot !
	
	
	  

		I try to register a Field with registerField( "test",
checkBox ); on 
		the first QWizardPage and try to get the value on the
second with if (
		    

	
	  

		field( "test" ).toBool() ) qDebug( "Yes, checkBox was
checked" );
		    

	
	
	Heiko
	
	
	Am 25.07.2007 um 19:11 schrieb Dutton, Sam:
	
	  

		combo is (I guess) a pointer to a QComboBox -- so
toBool() will always
		    

	
	  

		return false.
		
		Maybe you need a QCheckBox?
		
		Sam Dutton
		
		
		
		
		
		
		
		
		
		
		SAM DUTTON
		SENIOR SITE DEVELOPER
		
		200 GRAY'S INN ROAD
		LONDON
		WC1X 8XZ
		UNITED KINGDOM
		T +44 (0)20 7430 4496
		F
		E SAM.DUTTON@xxxxxxxxx
		WWW.ITN.CO.UK
		
		-----Original Message-----
		
		From: Heiko Steindl [mailto:heiko@xxxxxx]
		Sent: Wednesday 25 July 2007 17:47
		To: qt-interest@xxxxxxxxxxxxx
		Subject: Qt-4.3.0: QWizard / QWizardPage registerField
and field() 
		with QComboBox
		
		Hello !
		
		Can anybody tell me, what I make wrong ?
		
		I try to register a Field with registerField( "test",
combo ); on the 
		first QWizardPage and try to get the value on the second
with if ( 
		field( "test" ).toBool() ) qDebug( "Yes, ComboBox was
checked" );
		
		But it  doesn't work (it never prints the Debugmsg,
checked or
		unchecked)
		
		Does anyone can give me a tip ?
		
		Thanks for helping !
		
		Best regards,
		
		Heiko
		
		--
		To unsubscribe - send a mail to
qt-interest-request@xxxxxxxxxxxxx with
		    

	
	  

		"unsubscribe" in the subject or the body.
		List archive and information:
http://lists.trolltech.com/qt-interest/
		Please Note:
		
		
		
		Any views or opinions are solely those of the author and
do not 
		necessarily represent those of Independent Television
News Limited 
		unless specifically stated.
		This email and any files attached 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 
		postmaster@xxxxxxxxx
		
		Please note that to ensure regulatory compliance and for
the 
		protection of our clients and business, we may monitor
and read 
		messages sent to and from our systems.
		
		Thank You.
		
		--
		To unsubscribe - send a mail to
qt-interest-request@xxxxxxxxxxxxx with
		    

	
	  

		"unsubscribe" in the subject or the body.
		List archive and information:
http://lists.trolltech.com/qt-interest/
		
		
		    

	
	--
	To unsubscribe - send a mail to
qt-interest-request@xxxxxxxxxxxxx with
	"unsubscribe" in the subject or the body.
	List archive and information:
http://lists.trolltech.com/qt-interest/
	Please Note:
	
	 
	
	Any views or opinions are solely those of the author and do not
necessarily represent 
	those of Independent Television News Limited unless specifically
stated. 
	This email and any files attached 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
postmaster@xxxxxxxxx 
	
	Please note that to ensure regulatory compliance and for the
protection of our clients and business,
	we may monitor and read messages sent to and from our systems.
	
	Thank You.
	
	--
	To unsubscribe - send a mail to
qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or
the body.
	List archive and information:
http://lists.trolltech.com/qt-interest/
	
	
	  

Please Note:

 

Any views or opinions are solely those of the author and do not necessarily represent 
those of Independent Television News Limited unless specifically stated. 
This email and any files attached 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 postmaster@xxxxxxxxx 

Please note that to ensure regulatory compliance and for the protection of our clients and business,
we may monitor and read messages sent to and from our systems.

Thank You.

--
 [ signature omitted ] 

Message 8 in thread

First of all:

THANK YOU !!

The Solution is, that field won't work in the ctor.

So I putted the code in the initializePage() function  
(reimplementation of initializePage() ) and now it works as I want ;-)

Thanks a lot for helping and for opening my eyes ! ;-)

Have a nice weekend !

Heiko

Am 27.07.2007 um 15:44 schrieb Dutton, Sam:

> Can't see anything wrong.
>
> I'm just guessing now, but...
>
> Maybe you need to make checkbox a child of the DownloadPage instance,
> i.e. checkBox = new QCheckBox( "TEST", this )?
>
> You could try adding a different widget (e.g. a lineedit) and call a
> different QVariant function (e.g. toString()) to see what happens.
>
> For sanity checking, instead of
>
>     if( field( "test" ).toBool() )
>         qDebug( "Box is clicked" );
>
> try
>
>     if (true)
>         qDebug( "Box is clicked" );
>
> or try
>
>     bool b =  field( "test" ).toBool() ;
>     if(b)
>         qDebug( "Box is clicked" );
>
>
> Maybe field() won't work in the NextPage *constructor*?
>
> Sam
>
>
>
> ________________________________
>
> From: Heiko Steindl [mailto:heiko@xxxxxx]
> Sent: Thursday 26 July 2007 08:17
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: Qt-4.3.0: QWizard / QWizardPage registerField and field()
> with QComboBox
>
>
> Hello !
>
> thanks, but I do not find the failure ;-(
>
> Here is the test code, I hope it helps :
>
> .h File
> =====
>
> class DownloadPage : public QWizardPage
> {
>     Q_OBJECT
>
>     public:
>         DownloadPage( QWidget *parent = 0 );
>         int nextId() const;
>
>     private:
>         QLabel *topLabel;
>         QCheckBox *checkBox;
> };
>
> .cpp File
> ======
> DownloadPage::DownloadPage( QWidget *parent ) : QWizardPage( parent )
> {
> topLabel = new QLabel( "Some Text" );
>
> topLabel->setWordWrap( true );
>
> QVBoxLayout *layout = new QVBoxLayout;
> layout->addWidget( topLabel );
>
> checkBox = new QCheckBox( "TEST" );
> layout->addWidget( checkBox );
> registerField( "test", checkBox );
> setLayout( layout );
> }
>
>
> And so I try to find out, if the checkbox was clicked:
>
> NextPage::NextPage( QWidget *parent ) : QWizardPage( parent )
> {
> if( field( "test" ).toBool() )
>         qDebug( "Box is clicked" );
> }
>
> Thanks a lot for helping !
>
> Heiko
>
> Dutton, Sam schrieb:
>
> 	If it still doesn't work:
> 	- make sure that the checkbox pointer is valid (in both places)
> 	- check that both bits of code are being called.
> 	
> 	Sam
> 	
> 	-----Original Message-----
> 	From: Heiko Steindl [mailto:heiko@xxxxxx]
> 	Sent: Wednesday 25 July 2007 18:51
> 	To: qt-interest@xxxxxxxxxxxxx
> 	Subject: Re: Qt-4.3.0: QWizard / QWizardPage registerField and
> field()
> 	with QComboBox
> 	
> 	sorry, my fault !
> 	
> 	I have already a QCheckBox, but I missnamed it in the example
> before.
> 	(instead of combo, its name is checkbox)
> 	
> 	Thanks a lot !
> 	
> 	
> 	
>
> 		I try to register a Field with registerField( "test",
> checkBox ); on
> 		the first QWizardPage and try to get the value on the
> second with if (
> 		
>
> 	
> 	
>
> 		field( "test" ).toBool() ) qDebug( "Yes, checkBox was
> checked" );
> 		
>
> 	
> 	
> 	Heiko
> 	
> 	
> 	Am 25.07.2007 um 19:11 schrieb Dutton, Sam:
> 	
> 	
>
> 		combo is (I guess) a pointer to a QComboBox -- so
> toBool() will always
> 		
>
> 	
> 	
>
> 		return false.
> 		
> 		Maybe you need a QCheckBox?
> 		
> 		Sam Dutton
> 		
> 		
> 		
> 		
> 		
> 		
> 		
> 		
> 		
> 		
> 		SAM DUTTON
> 		SENIOR SITE DEVELOPER
> 		
> 		200 GRAY'S INN ROAD
> 		LONDON
> 		WC1X 8XZ
> 		UNITED KINGDOM
> 		T +44 (0)20 7430 4496
> 		F
> 		E SAM.DUTTON@xxxxxxxxx
> 		WWW.ITN.CO.UK
> 		
> 		-----Original Message-----
> 		
> 		From: Heiko Steindl [mailto:heiko@xxxxxx]
> 		Sent: Wednesday 25 July 2007 17:47
> 		To: qt-interest@xxxxxxxxxxxxx
> 		Subject: Qt-4.3.0: QWizard / QWizardPage registerField
> and field()
> 		with QComboBox
> 		
> 		Hello !
> 		
> 		Can anybody tell me, what I make wrong ?
> 		
> 		I try to register a Field with registerField( "test",
> combo ); on the
> 		first QWizardPage and try to get the value on the second
> with if (
> 		field( "test" ).toBool() ) qDebug( "Yes, ComboBox was
> checked" );
> 		
> 		But it  doesn't work (it never prints the Debugmsg,
> checked or
> 		unchecked)
> 		
> 		Does anyone can give me a tip ?
> 		
> 		Thanks for helping !
> 		
> 		Best regards,
> 		
> 		Heiko
> 		
> 		--
> 		To unsubscribe - send a mail to
> qt-interest-request@xxxxxxxxxxxxx with
> 		
>
> 	
> 	
>
> 		"unsubscribe" in the subject or the body.
> 		List archive and information:
> http://lists.trolltech.com/qt-interest/
> 		Please Note:
> 		
> 		
> 		
> 		Any views or opinions are solely those of the author and
> do not
> 		necessarily represent those of Independent Television
> News Limited
> 		unless specifically stated.
> 		This email and any files attached 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
> 		postmaster@xxxxxxxxx
> 		
> 		Please note that to ensure regulatory compliance and for
> the
> 		protection of our clients and business, we may monitor
> and read
> 		messages sent to and from our systems.
> 		
> 		Thank You.
> 		
> 		--
> 		To unsubscribe - send a mail to
> qt-interest-request@xxxxxxxxxxxxx with
> 		
>
> 	
> 	
>
> 		"unsubscribe" in the subject or the body.
> 		List archive and information:
> http://lists.trolltech.com/qt-interest/
> 		
> 		
> 		
>
> 	
> 	--
> 	To unsubscribe - send a mail to
> qt-interest-request@xxxxxxxxxxxxx with
> 	"unsubscribe" in the subject or the body.
> 	List archive and information:
> http://lists.trolltech.com/qt-interest/
> 	Please Note:
> 	
> 	
> 	
> 	Any views or opinions are solely those of the author and do not
> necessarily represent
> 	those of Independent Television News Limited unless specifically
> stated.
> 	This email and any files attached 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
> postmaster@xxxxxxxxx
> 	
> 	Please note that to ensure regulatory compliance and for the
> protection of our clients and business,
> 	we may monitor and read messages sent to and from our systems.
> 	
> 	Thank You.
> 	
> 	--
> 	To unsubscribe - send a mail to
> qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or
> the body.
> 	List archive and information:
> http://lists.trolltech.com/qt-interest/
> 	
> 	
> 	
>
> Please Note:
>
>
>
> Any views or opinions are solely those of the author and do not  
> necessarily represent
> those of Independent Television News Limited unless specifically  
> stated.
> This email and any files attached 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  
> postmaster@xxxxxxxxx
>
> Please note that to ensure regulatory compliance and for the  
> protection of our clients and business,
> we may monitor and read messages sent to and from our systems.
>
> Thank You.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ]