Important: Please read the Qt Code of Conduct -

Using standard icons appropriate for the current platform

  • I am new to Qt and I am extremely impressed by it. I thought I'd write a little text editor with a proper UI, menus, toolbars, docking, tabbed documents, undo, redo, macros, etc., to get used to Qt development, as it covers most of what you implement when making a professional UI.

    I ran into an issue with QStyle::standardIcon. I want to use standard icons that are appropriate for the target platform.

    I figured that QStyle::FP_* would have all the standard icons but I find it to be severely lacking.

    I need icons for (at least) New, Open, Save, Print, Cut, Copy, Paste, Find, Help, Undo, Redo. I would expect all of those to be the definition of "standard" icons.

    Here's what I've come up with so far:

    New: SP_FileIcon
    Open: SP_DialogOpenButton
    Save: SP_DialogSaveButton

    I can't find any that would be appropriate for Print, Cut, Copy, Paste, Undo, Redo, Find, Help.

    Is it not possible to make a UI that has a native feel for multiple platforms? If I use my own images, it will not have a native feel at all.


  • Hi,

    probably there are missing icons because them are not standard on some platform.

  • Ok, I suppose using my own icons is fine. The resource system is great anyway. This brings up another issue though: how to deal with icon sizes. A small icon might be needed (for a list), while a larger icon might be needed at other times (a toolbar button).

    Windows deals with this by having ico files contain several different sized representations of icons. It's not clear how to accomplish the same thing in Qt.

    I'll use fixed sized icons for now, but any suggestions on dealing with different sized icons (in a context sensitive manner) would be appreciated.

  • Hi,

    QIcon allow to store pixmap in de├Čifferent size and for different states

Log in to reply