[Qt-interest] [SOLVED] Problems with QDropEvent , got SIGSEGV

Aaron Lewis aaron.lewis1989 at gmail.com
Thu Feb 25 10:36:55 CET 2010


Yeah , I should use QString here .
Sorry  i've just got to know it's inherited from QObject.


      QString <qstring.html> QObject::tr ( const char * /sourceText/,
      const char * /disambiguation/ = 0, int /n/ = -1 )   [static]

Returns a translated version of /sourceText/, optionally based on 
a /disambiguation/ string and value of /n/ for strings containing 
plurals; otherwise returns /sourceText/ itself if no appropriate 
translated string is available.


Thanks Jaco.

Jaco Naude wrote:
> Should it be
>
> updateStatusBar(QString(tr("Analyse of %1 complete")).arg(fName));
>
> Jaco
>
> On Thu, Feb 25, 2010 at 8:57 AM, Aaron Lewis <aaron.lewis1989 at gmail.com> wrote:
>   
>> Class qbestway inherits QMainWindow (public)
>>
>> Here's some sample code:
>>
>> --snip--
>>
>> void qbestway::dropEvent(QDropEvent *event)
>> {
>>    --snip--
>>        updateStatusBar(tr("Analyse of %1 complete").arg(fName));
>> //everything works fine , when this line is commented out
>> }
>>
>> void qbestway::updateStatusBar(const QString newStr)
>> {
>>   if(newStr.isEmpty())
>>       return;
>>   ui->label->setText(newStr);      /// Problems is here , that i can't
>> set a label .. got SegmentFault , is there some limits ?
>> }
>>
>> --snip--
>>
>> Any ideas to make it work ?
>>
>> Thanks in advance.
>>
>> --
>> Best Regards,
>> Aaron Lewis - PGP: 0xA476D2E9
>> irc: A4r0n on freenode
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>     


-- 
Best Regards,
Aaron Lewis - PGP: 0xA476D2E9
irc: A4r0n on freenode

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100225/3691bda2/attachment.html 


More information about the Qt-interest-old mailing list