I've developed a text editor using Java and the QtJambi (Qt 4.6.3) library. The application has a QToolBar with some QActions with icons. My text editor can switch between two themes (dark and light). If i use black icons, the dark theme looks terrible, and if I use white icons, the light theme looks terrible too. I want to change the icons when I press the switch theme button.
The icons are declared like this:
private String inir = "classpath:/ico/";
private QIcon iconodeshacer = new QIcon(inir+"deshacer.png");
And I set them to the QActions this way:
private QToolBar herramientas = new QToolBar();
herramientas.addAction(iconodeshacer, "Deshacer", this, "deshacer()");
I've tried to change the inir String and apply:
herramientas.update();
herramientas.repaint();
I can't find a solution for QtJambi or regular Qt (from which I can translate).
I would like to declare both icon themes and apply them without having to declare each QAction outside the configuration and manually change the icon with setIcon();