You are not logged in.

#1 2005-01-03 21:26:25

STiAT
Member
From: Vienna, Austria
Registered: 2004-12-23
Posts: 605

QT compiled with QT_NO_STL?

I'm posting here since it may fits better in this board than in "Arch Discussion", where the original thread is placed.

Any moderator, of course, i won't be sad if this or the other post gets deleted / edited / moved to hold the forum clean.

My problem is about compiling QT-Software depending not only on QT functions, so programs which need to interact with STL. What i've found out, this usually occurs of the packager used "QT_NO_STL" as compiling option. For further information read my post in "Arch Discussion".

http://bbs.archlinux.org/viewtopic.php?t=8998

Thank you,
STi


Ability is nothing without opportunity.

Offline

#2 2005-01-03 21:46:52

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: QT compiled with QT_NO_STL?

Two solution's here:
a) Is the Qt software your own? If so it may be better to mess with QString's instead of std::string's as they fit more closely into the Qt paradigm.  Also, you could always implicitly construct the QString...

std::string tmp = "hello";
QString str(tmp.c_str()); // explicit QString ctor

or

void somefunc(QString str);
...
std::string my_str = "abcdefg";
somefunc(my_str.c_str()); // implicit QString ctor

b) rebuild Qt yourself, but keep in mind your code is going to depend on the STL enabled Qt version....

to do this:
run "abs" once, to build the tree.
goto /var/abs/lib/qt
edit PKGBUILD and remove the "--no-stl" configure flag

-----

I do think it's odd that Qt is built w/o stl support... I'd look into this if I were you.... there's probably a reason... Judd, you're the maintainer of Qt... any word?

Offline

#3 2005-01-03 22:08:39

STiAT
Member
From: Vienna, Austria
Registered: 2004-12-23
Posts: 605

Re: QT compiled with QT_NO_STL?

Thank you for your fast reply.

This code was more than less of my own, a member of my company has written this piece of code (i'm not a GUI developer.. BMS is more interesting to me).

But how about the other way round? Getting a QString to a std::string?

I'll give it a shot. Thank you again,
STi


Ability is nothing without opportunity.

Offline

#4 2005-01-03 22:20:43

STiAT
Member
From: Vienna, Austria
Registered: 2004-12-23
Posts: 605

Re: QT compiled with QT_NO_STL?

QString::latin1() seems to work - is it common and can i use it, or do you suggest something else?

TIA
STi


Ability is nothing without opportunity.

Offline

#5 2005-01-03 22:38:43

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: QT compiled with QT_NO_STL?

I would use operator const char * just to make it look prettier....
also, read the warnings that the latin1() function has.... if you require heavy unicode support (std::wstring type stuff) then look into that codec junk

Offline

#6 2005-01-03 23:20:58

STiAT
Member
From: Vienna, Austria
Registered: 2004-12-23
Posts: 605

Re: QT compiled with QT_NO_STL?

Nah, its just for reading textboxes of a configuration interface and passing them to another piece of c++ code which is most likely "background client interface", using STL and no QT functions, since the sources are taken out of a specific part of the project (dont ask, quite complex...)

Anyway, i thank you very much, i've got the GUI(s) running pretty fine now here smile

STi


Ability is nothing without opportunity.

Offline

Board footer

Powered by FluxBB