[Qt-interest] qlineedit setText crash

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Tue May 18 02:20:06 CEST 2010


Have you debugged this? 
 
What did you find so far? 
 
Are the pointers unmodified? 
 
Do the objects still exist? 
 
 

-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of caius ligarius
Sent: Tuesday, 18 May 2010 07:06
To: qt-interest at trolltech.com
Subject: [Qt-interest] qlineedit setText crash


Hi,

I have added a QLineEdit widget to QMainWindow. I want to update the text in
QLineEdit widget everytime a certain function gets called.
(updatePixelValue). When I try to do setText in that function the code
crashes. See code below-

void Viewer:: updatePixelValue(QPointF p)
{
    int x = p.x();
    int y = p.y();
    QString s;
    s.sprintf("x=%d y=%d",x,y);
    ui.lineEdit->setText(s);
}

Viewer: is QMainWindow
ui: is created using Qt Designer
updatePixelValue(QPointF p): x,y values here are correctly being set to some
integer numbers from "p"

The above code crashes at the last line (setText)??


Thanks,
Caius




No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.819 / Virus Database: 271.1.1/2878 - Release Date: 05/17/10
04:26:00




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100518/0d74ad53/attachment.html 


More information about the Qt-interest-old mailing list