[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: strings and QStrings
From:       Olivier Nenert <onenert () condumex ! com ! mx>
Date:       2000-12-08 0:34:52
[Download RAW message or body]

On Thursday 07 December 2000 18:16, Scott Manson wrote:
> On Thursday 07 December 2000 05:39 pm, robbie wrote:
> > Hi
> >
> > im writing a program and im trying to use this bit of code:
> > deviceedit->setText(get_default_drive());
> > All the code is fine but when i compile the app this error comes up:
> >
> > ghdparm-kde.cpp:123: no matching function for call to
> > `QLineEdit::setText (string)'
> > /usr/lib/qt2/include/qlineedit.h:135: candidates are: void
> > QLineEdit::setText(const QString &)
> >
> > I can see its wanting a QString rather than a string so i added this
> > into the code:
>
> My STL experience leaves something to be desired
> IIRC there is a function to get a char * pointer out of a string
> not sure what it is
> is it c_str()?
Dunno, but the compiler said it wanted the oposite I think...
which would lead us to
deviceedit->setText(QString(get_default_drive));
if QString has a constructor for char * which is almost sure...
>
> > QString defdrive=3Dget_default_drive().c_str();
> > deviceedit->setText(defdrive);


cheerz..

Olivier.
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic