Article View: es.comp.os.linux.programacion
Article #8262Re: Perdido en KDE
From: rvm
Date: Thu, 05 Dec 2002 17:20
Date: Thu, 05 Dec 2002 17:20
56 lines
2500 bytes
2500 bytes
El Mi� 04 Dic 2002 19:29, alguien que se hace llamar "juan" escribi� las
siguientes palabras:
> #include <qtextview.h>
> #include <kapp.h>
> #include <qhbox.h>
>
>
> #include <qpushbutton.h>
> #include <qcombobox.h>
> #include <qspinbox.h>
> #include <qlabel.h>
> #include "pru2.h"
>
> Pru2::Pru2(QWidget *parent, const char *name) : QWidget(parent, name)
> {
> QHBox *vcaja=new QHBox(this);
> QLabel *texto1=new QLabel (vcaja);
> texto1->setText(QString("hola"));
> QPushButton *salir=new QPushButton(vcaja,"ok");
> salir->setText("SALIR");
> connect(salir,SIGNAL(clicked()),this,SLOT(boton_cancelar()));
> }
>
> Pru2::~Pru2()
> {
> }
>
> void Pru2::boton_cancelar()
> {
> texto1->setText(QString("hola"));
>
> }
Esta me la s�. El widget texto1 se crea en el constructor y s�lo existe dentro
del constructor. Una vez ejecutado ya no existe. Seguramente no te da error de
compilaci�n porque tambi�n habr�s puesto un QLabel *texto1 en el fichero
pru2.h, y por tanto tienes dos punteros "texto1" y el que tu tratas de usar en
Pru2::boton_cancelar no es inicializado nunca.
Simplemente en el constructor reemplaza la l�nea
QLabel *texto1=new QLabel (vcaja);
por
texto1=new QLabel(vcaja);
--
Ricardo Villalba
rvmsoft at jazzfree.com
http://www.escomposlinux.org/rvm/
Bienaventurados los que se rien de si mismos porque nunca se
les acabar� el cachondeo -- dicho popular --
Technical Details
Message-ID:
<1513242.XAFRqVoOGU@localhost.localdomain>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.mailgate.org!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!62-37-15-144.dialup.uni2.ES!not-for-mailReferences:
<aslhgl$rm8s0$1@ID-142383.news.dfncis.de>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,843253a356f42382 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2002-12-05 09:37:55 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.mailgate.org!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!62-37-15-144.dialup.uni2.ES!not-for-mail From: rvm <rvm@linuxfan.com> Newsgroups: es.comp.os.linux.programacion Subject: Re: Perdido en KDE Date: Thu, 05 Dec 2002 18:20:58 +0100 Lines: 57 Message-ID: <1513242.XAFRqVoOGU@localhost.localdomain> References: <aslhgl$rm8s0$1@ID-142383.news.dfncis.de> NNTP-Posting-Host: 62-37-15-144.dialup.uni2.es (62.37.15.144) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit X-Trace: fu-berlin.de 1039109873 29758505 62.37.15.144 (16 [67005]) X-Orig-Path: 127.0.0.1!nobody User-Agent: KNode/0.6.1