::CoInitializeEx(0, COINIT_MULTITHREADED); ::CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL); QApplication a(argc, argv); QCoreApplication::setApplicationName(""); MainForm mainWin; mainWin.show(); int r = a.exec(); ::CoUninitialize(); return r;
void MainForm::open(){ QString fileName = QFileDialog::getOpenFileName(this, Resource::OPEN_FILE, QDir::currentPath(), Resource::STATISTIC_SET); if (fileName == NULL) //////
::CoInitializeEx(0, COINIT_APARTMENTTHREADED);
C++ (Qt)CoUninitialize()CoInitializeEx(0, COINIT_APARTMENTTHREADED);QString fileName = QFileDialog::getOpenFileName(this, Resource::OPEN_FILE, QDir::currentPath(), Resource::STATISTIC_SET);CoUninitialize();CoInitializeEx(0, COINIT_MULTITHREADED);
C++ (Qt)QTranslator qtTrans; //загружаем из места где установлен Qtif(qtTrans.load(QLocale(), QLatin1String("qt"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))//или из ресурсов//if(qtTrans.load(QLocale(), QLatin1String("qt"), QLatin1String("_"), QLatin1String(":/translations"))) app.installTranslator(&qtTrans);
XML<?xml version="1.0" encoding="utf-8"?><!DOCTYPE TS><TS version="2.1" language="ru"><dependencies><dependency catalog="qtbase_ru"/><dependency catalog="qtscript_ru"/><dependency catalog="qtquick1_ru"/><dependency catalog="qtmultimedia_ru"/><dependency catalog="qtxmlpatterns_ru"/></dependencies></TS>
int main(int argc, char *argv[]){ ::CoInitializeEx(0, COINIT_MULTITHREADED); ::CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL); QApplication a(argc, argv); ////////
MainForm::MainForm() : . . .{ ::CoInitializeEx(0, COINIT_MULTITHREADED); ::CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL); ///////////////