Hi Pritpal

Obviously we need Qstring implementation (not nedded for begining).
Instead of using char* we have to use QString and its methods.
By default Qstring uses "fromAscii()" method on char* assignement.

You should change in hbqt.h (for begining)

#define hbqt_par_QString( n )                ( ( QString ) hb_parcx( n ) )
to
#define hbqt_par_QString( n )               (QString::fromLocal8Bit(
hb_parcx( n )))

I have tried it with demoqt, and it works.

Of course we need more sofisticated system.
For example  I intend to use utf-8 encoding for all UI 
so there should be ::fromUtf8 method instead of ::fromLocal8bit.
It would be very simple to write universal function that depends
on some  "SET QT_CP   xxxx " seting.


Here is naive example in cpp how to use local encoding .
We should use it by default.

#include <QApplication>
#include <QFont>
#include <QPushButton>

int main(int argc, char* argv[])
{
    QApplication app(argc, argv);
    //-----   wrong -------------
    //char * cBtnCapt= "Qu čšž";
    //---------------------------   
    QString cBtnCapt= QString::fromLocal8Bit( "Qu čšž");
    QPushButton quit(cBtnCapt);

    quit.resize(75, 30);
    quit.setFont(QFont("Times", 18, QFont::Bold));

    QObject::connect(&quit, SIGNAL(clicked()), &app, SLOT(quit()));

    quit.show();

    return app.exec();
}





Pritpal Bedi wrote:
> 
> Hi
> 
> 
> Franček Prijatelj wrote:
>> 
>> Is there a function equivalent of  HB_SetCodePage("SLWIN") in HbQt.
>> I would like to use  cp1250 tekst on buttons:
>> 
>>     oBtn := QPushButton():new( QT_PTROF( oWnd ) )
>>     oBtn:setText( "Push Button čČšŠžŽ" )
>> 
> 
> This is still a gray area for me.
> Infact I have not looked into it deeply yet.
> Documentation suggests that they have all classes in place 
> but I am unable to figure-out how those classes can be 
> made functional with HB_SetCodePage("SLWIN")  call.
> 
> Anyone to suggest something on the subject?
> 
> Regards
> Pritpal Bedi
> 
> 

-- 
View this message in context: 
http://www.nabble.com/HOWTO-about-codepage-in-HbQt-tp25334628p25340944.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to