Important: Please read the Qt Code of Conduct -

[SOLVED] Is there any way to use other standard pixmaps other than in QStyle class

  • I want to add zoom in and zoom out icons in the tool bar and i want my app to use system icons, but there are no standard pixmaps for zooming in QStyle. Plz help!

    @QIcon zoomIn_icon= ui->mainToolBar->style()->standardIcon(QStyle::SP_"what to use");@

  • If the images are not available through QStyle, I don't think they are available in another way as standard pixmaps, at least not via Qt. What OS are you targeting? On the Linux desktop, there are open desktop standards I believe that may help you find a standard icon.

  • Thanks for replying.
    I use Ubuntu. Actually, Qt Assistant can replace almost all its icons with the system theme icons. Even icons for zooming get changed by changing icon theme. It is obvious Qt Assistant is written in Qt, so if Qt Assistant can do it , then most probably Qt should also. And if it doesn't plz throw some light on open desktop standards. How can these standards be integrated into Qt app.

  • Well, you have the source code for Assistant, so if you say Assistant can do it, then perhaps you have a place to start to find out how it does it...

  • Where from can i get the source of Qt Assistant, can you plz post the link:

  • At the top of this site, you see a big header called "Downloads". You might be able to find, well, downloads there. There is a download there for the sources, and those sources include Assistant.

    So, I guess the link would be:

  • I couldn't find source code of Qt Assistant. But Qt Creator also uses some non-standard pixmaps. I checked the code but it seems it has been developed using Qt Quick. So I couldn't figure out much. Can you throw some light on open desktop standards

  • I got it.

    @QIcon rotate_c_icon = QIcon::fromTheme("object-rotate-right");@

    The string name for icon should be used as mentioned in the following site:

Log in to reply