QString fields[fieldsCount][2] = { {QObject::tr("Номер"), "num"}, {QObject::tr("Тип"), "mem_kind"}, {QObject::tr("Дата"), "dt"}, ...};
ui->cbFields->clear(); for (int i = 0; i < nmsFilter::fieldsCount; i++) ui->cbFields->addItem(nmsFilter::fields[i][0], nmsFilter::fields[i][1]);
CODECFORTR = UTF-8
ui->cbOperations->clear(); ui->cbOperations->addItem(tr("больше"), "GREATER"); ui->cbOperations->addItem(tr("меньше"), "LESS");
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
C++ (Qt)class SetCodec{ SetCodec() { QTextCodec::setCodeForCStrings( ... ); QTextCodec::setCodeForTr( ... ); }}; SetCodec __attribute__ ((init_priority (101))) setCodec; int main(...){ }
C++ (Qt)SetCodec __attribute__ ((init_priority (101))) setCodec;
QString fields[fieldsCount][2] = { {QObject::trUtf8("Номер"), "num"}, {QObject::trUtf8("Тип"), "mem_kind"}, {QObject::trUtf8("Дата"), "dt"}, ...};