On Friday 04 June 2004 17:09, Preston wrote:
If your line edit is named lineEdit1:
lineEdit1->text() returns a QString;
lineEdit1->text().ascii() returns a const char* (if you like using stl strings instead of QStrings).
Watch out for locales and encodings! This will fail miserably for people living outside the U.S. (not using 7-bit ASCII code). QString::ascii() should only be used for debugging, not for anything the user ever sees. If you need to support only simple (8 bit) encodings, you can use QString::local8Bit() which will pick encoding based on the current locale settings. In general, it is a better idea to use Unicode (easy character access, but uses 16 bit per character) or UTF-8 (multi-byte characters, saves memory, but no trivial single character access). This is why Qt uses QString which uses Unicode internally. Plus, IMHO QString is much more powerful and much easier to use than STL strings. CU -- Stefan Hundhammer <sh@suse.de> Penguin by conviction. YaST2 Development SuSE Linux AG Nuernberg, Germany