[Qt-interest] A error about QLabel::setText(const QString &) ?
Kermit Mei
kermit.mei at gmail.com
Fri Feb 27 16:16:44 CET 2009
Hello! In my widget I defined the following method, and all the label_** in
it is the type of QLabel.
void ResultWidget::setInfo(const QString &str11,const QString &str12,
const QString &str21,const QString &str22,
const QString &str31,const QString &str32) {
label_11->setText(str11);
label_12->setText(str12);
label_21->setText(str21);
label_22->setText(str22);
label_31->setText(str31);
label_32->setText(str32);
}
After make the project, everything goes well, but when I run it, the program
broke down here. The gdb output is:
Program received signal SIGSEGV, Segmentation fault.
QLabel::setText (this=0x0, text=@0xbfc70874) at widgets/qlabel.h:155
155 widgets/qlabel.h: No such file or directory.
in widgets/qlabel.h
And the stack of the program are:
(gdb) bt
#0 QLabel::setText (this=0x0, text=@0xbfc70874) at widgets/qlabel.h:155
#1 0xb7f28e7f in ResultWidget::setInfo (this=0x80c7368, str11=@0xbfc70874,
str12=@0xbfc70870, str21=@0xbfc7086c, str22=@0xbfc70868,
str31=@0xbfc70864, str32=@0xbfc70860)
at /home/kermit/Project/QFreeRecite/src/gui/ResultWidget.cpp:20
... ...
I don't know why this takes errors. All the arguments I put into the arglist
is standard QString type.
What may cause it?
Thanks.
Kermit Mei
More information about the Qt-interest-old
mailing list