DiscussionsIssue archiveDraw Harness and Samples

Archived discussion

SAmple project qt Tutorial is not posssible to deploy in release mode. App's icons are not loaded

Draw Harness and SamplesFri, 06/17/2022 - 06:201 reply

Browse this forum
QuestionAuthor

I am trying to deploy the qt Tutorial, I compiled in release mode and put all necessary dlls to deploy more or less all done. But when clicking the exe, it is not loading the icons on tools. They are written in .ts file which is compiled wit qt's translator using -qm and .qm files generated.

icons being loaded from within Visual studio IDE but when trying to run app from standalone folder, app is being loaded but icons are not mapped only textual menus are loaded.

If anyone can help to solve it will appreciate it. Thanks in advance,.

Discussion

1 archived reply

Posts are displayed in their archived order.

01Commenter-1

According to the code (samples/qt/Common/src/ApplicationCommon.cxx):

QString ApplicationCommonWindow::getResourceDir()
{
  static QString aResourceDir =
    QString (OSD_Environment ("CSF_ResourcesDefaults").Value().ToCString());
  if (aResourceDir.isEmpty())
    aResourceDir = QString (OSD_Environment ("CSF_OCCTResourcePath").Value().ToCString()) + "/samples";

  return aResourceDir;
}
rem samples/qt/IESample/env.bat
set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res"
set "CSF_ResourcesDefaults=%RES_DIR%"
set "CSF_IEResourcesDefaults=%RES_DIR%"

these resource files (images, translation files Common-string.qm, Interface-string.qm, etc.) are loaded from the directory specified by environment variables like CSF_ResourcesDefaults  / CSF_IEResourcesDefaults.