
Originally Posted by
Lykurg
Come on Franco! How long are you dealing with Qt now? I am sure you noticed the assistant, please use it:
http://doc.trolltech.com/4.6/resources.html. And your prefix question will solve, when you read that. About the toolbar one can hardly say something if you don't show the code you are using. And there is no direct connection between images and toolbars...
Which code do you need? I exactly copied from the mainwindow example.
I get the icon in the menu but the toolbar is not created
void MainWindow::createToolBar()
{
exitToolBar = addToolBar(tr("Exit"));
exitToolBar->addAction(exitAct);
}
void MainWindow::createToolBar()
{
exitToolBar = addToolBar(tr("Exit"));
exitToolBar->addAction(exitAct);
}
To copy to clipboard, switch view to plain text mode
and the action
/* Exit action */
exitAct
= new QAction(QIcon(":/images/exit.png"), tr
("E&xit"),
this);
exitAct->setShortcut( tr("Ctrl+Q") );
exitAct->setStatusTip(tr("Exit the application"));
connect( exitAct, SIGNAL( triggered() ), this, SLOT( close() ) );
/* Exit action */
exitAct = new QAction(QIcon(":/images/exit.png"), tr("E&xit"), this);
exitAct->setShortcut( tr("Ctrl+Q") );
exitAct->setStatusTip(tr("Exit the application"));
connect( exitAct, SIGNAL( triggered() ), this, SLOT( close() ) );
To copy to clipboard, switch view to plain text mode
the qrc file:
<RCC>
<qresource>
<file>images/exit.png</file>
</qresource>
</RCC>
<RCC>
<qresource>
<file>images/exit.png</file>
</qresource>
</RCC>
To copy to clipboard, switch view to plain text mode
I don't understand why the toolbar is not created.
Bookmarks