I've got the following problem: a gui i created is started by a c++-thread. now i want to assign own icons to certain menu entries, but the icons aren't shown in the application, but their functionality works fine.
I created another application with a main.cpp that has the following line included:
Qt Code:
  1. Q_INIT_RESOURCE(resource_file);
To copy to clipboard, switch view to plain text mode 

with that line, the icons are shown. both applications have the same ressource file and the same icon folder. so i think i need the q_init_resource in the thread-driven application too.

here's the code of the thread which starts the gui:
Qt Code:
  1. void S::run(){
  2. int argc = 0;
  3. char** argv = 0;
  4. m_Application = new QApplication(argc, argv);
  5. m_MainWidget = new MainWindow(this);
  6.  
  7. if(m_MainWidget){
  8. m_MainWidget->show();
  9. m_Application->exec();
  10.  
  11. }else{
  12. cout << "GUIThread::run: Could not start Qt-application." << endl;
  13. }
  14. }
To copy to clipboard, switch view to plain text mode 

neither Q_INIT_RESOURCE(resource_file); nor m_MainWidget->Q_INIT_RESOURCE(resource_file); nor m_Application->Q_INIT_RESOURCE(resource_file); worked, so how can i include the line Q_INIT_RESOURCE(resource_file); to my application so that the icons are displayed correctely? or is there another way(even better?) to add icons to a QAction?

thanks in advance for your help