Qt-interest Archive, October 2001
QT_KDE_I18N in QT3
Message 1 in thread
I have a set of designer .ui files that were originally created under QT2. I
am now migrating this project to QT3, and have run into a problem with the
files that uic is generating. When compiling them I get a bunch of errors
that say: `QT_KDE_I18N' undeclared'. This occurs in all of the files
generated by uic. Can someone help?
Thanks,
Larry
Message 2 in thread
On Tue, Oct 02, 2001 at 06:39:08AM -0500, Larry Wright wrote:
> I have a set of designer .ui files that were originally created under QT2. I
> am now migrating this project to QT3, and have run into a problem with the
> files that uic is generating. When compiling them I get a bunch of errors
> that say: `QT_KDE_I18N' undeclared'. This occurs in all of the files
> generated by uic. Can someone help?
Apparently you're using the KDE build system :-) . So this is not a uic
bug but it's the result of the following:
The KDE build system calls uic automatically (when having blah.ui in the
_SOURCES) with -tr i18n, to allow the use of KDE's i18n function
(there are various reasons why KDE uses i18n instead of tr) . With
qt2 tr() and i18n() were source compatible, so the simple -tr i18n did
the trick, along with an additional '#include <klocale.h>' (which is
where the i18n function is defined) .
With qt3 uic generates tr calls in a different manner, like
tr( "comment", "message" ) . There is also an i18n() function in
klocale which takes two arguments, but it behaves different.
So for qt3 we changed the build system (in particular am_edit.pl) to
call uic with -tr QT_KDE_I18N . QT_KDE_I18N however is just a macro:
#define QT_KDE_I18N( comment, message ) i18n( message ) .
As we do not use gettext extract the messages into po files for .ui files
(instead the xml is inspected directly) no messages are lost this way.
There are two possible solutions to your problem:
1) update your copy of kdelibs to get the latest klocale.h (which contains
this macro)
2) do not use kdelibs at all but still use the KDE build system for a pure
Qt application. For that just specify KDE_OPTIONS = qtonly in the Makefile.am
and am_edit will be clever enough to not call uic with the -tr magic (while
still allowing you to comfortably specify .ui files in _SOURCES)
Hope this helps
Simon
Message 3 in thread
hai,
Iam facing some problem in getting the field data from the form then iam
trying to assign it to a character array in this it is giving some error.
the fields are returning Qstring, how can I type cast it to a char array.
please help me in this.
Thanks for your support,
ramesh k
Message 4 in thread
Hi
QString::latin1() returns a const char*
At 15:19 05/10/2001 +0530, serveen1 wrote:
>hai,
>
>Iam facing some problem in getting the field data from the form then iam
>trying to assign it to a character array in this it is giving some error.
>the fields are returning Qstring, how can I type cast it to a char array.
>
>please help me in this.
>
>Thanks for your support,
>
>ramesh k
>
>--
>List archive and information: http://qt-interest.trolltech.com