Note that there are some explanatory texts on larger screens.

plurals
  1. POQt application doesn't display images
    primarykey
    data
    text
    <p>I have developed an application (using Qt Creator) that employs some pictures for background and icons. Now I am trying to deploy it, the application is successfully installed with:</p> <pre><code>$ make $ sudo make install </code></pre> <p>The installation directory is <code>/usr/local/ctimer/</code>, the binary is located in <code>/usr/local/ctimer/ctimer</code>. The problem is that when I execute the program, for example, with the Alt + F2 <code>/usr/local/ctimer/ctimer</code> the images aren't displayed.</p> <p>I have noticed that if I execute the program from its folder all works fine:</p> <pre><code>$ cd /usr/local/ctimer/ $ ./ctimer </code></pre> <p>It's possible to work around the problem with a bash script with the above commands in it and put it in <code>/usr/local/bin/</code> for example but I want to know why this behavior.</p> <p>Any idea?</p> <p><strong>EDIT:</strong></p> <p>Here is the code:</p> <pre><code>void Stopwatch::createMenu() { startAction = new QAction(QIcon("pictures/start.png"), tr("&amp;Start/Continue"), this); startAction-&gt;setToolTip("Start/Continue stopwatch"); startAction-&gt;setShortcut(Qt::CTRL + Qt::Key_S); connect(startAction, SIGNAL(triggered()), this, SLOT(start())); pauseAction = new QAction(QIcon("pictures/pause.png"), tr("&amp;Pause"), this); pauseAction-&gt;setToolTip("Pause stopwatch"); pauseAction-&gt;setShortcut(Qt::CTRL + Qt::Key_P); connect(pauseAction, SIGNAL(triggered()), this, SLOT(pause())); resetAction = new QAction(QIcon("pictures/reset.png"), tr("&amp;Reset"), this); resetAction-&gt;setToolTip("Reset stopwatch"); resetAction-&gt;setShortcut(Qt::CTRL + Qt::Key_C); connect(resetAction, SIGNAL(triggered()), this, SLOT(reset())); countDownAction = new QAction(QIcon("pictures/down.png"), tr("&amp;Countdown"), this); countDownAction-&gt;setToolTip("Create a custom count down"); countDownAction-&gt;setShortcut(Qt::CTRL + Qt::Key_D); connect(countDownAction, SIGNAL(triggered()), countDownDialog, SLOT(show())); aboutAction = new QAction(QIcon("pictures/about.png"), tr("&amp;About"), this); aboutAction-&gt;setToolTip("About this timer!"); aboutAction-&gt;setShortcut(Qt::CTRL + Qt::Key_H); connect(aboutAction, SIGNAL(triggered()), aboutDialog, SLOT(show())); quitAction = new QAction(QIcon("pictures/quit.png"), tr("&amp;Quit"), this); quitAction-&gt;setToolTip("Quit timer!"); quitAction-&gt;setShortcut(Qt::CTRL + Qt::Key_Q); connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); contextMenu = new QMenu(this); contextMenu-&gt;addAction(startAction); contextMenu-&gt;addAction(pauseAction); contextMenu-&gt;addAction(resetAction); contextMenu-&gt;addAction(countDownAction); contextMenu-&gt;addAction(aboutAction); contextMenu-&gt;addAction(quitAction); this-&gt;addAction(startAction); this-&gt;addAction(pauseAction); this-&gt;addAction(resetAction); this-&gt;addAction(countDownAction); this-&gt;addAction(aboutAction); this-&gt;addAction(quitAction); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload