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

List:       kde-devel
Subject:    Re: strings and QStrings
From:       Scott Manson <Maniac () Alltel ! net>
Date:       2000-12-08 0:16:53
[Download RAW message or body]

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()?
> QString defdrive=get_default_drive().c_str();
> deviceedit->setText(defdrive);

-- 
Maniac@alltel.net  40.619302 N, 96.956676 W
A single tasking guy in multi tasking world

 
>> 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