Thanks to Dmitry Sazonov for giving me an idea. As I'm programming on java, not c++, its code is difficult to apply on my application. But I understood the idea. What I've done its storing the icon names on an String array and resetting the icons of the elements every time i switch the theme.
private String[] nombreiconoseditar = {"copiar.png", "cortar.png", "pegar.png", "", "deshacer.png", "rehacer.png", "", "buscar.png", "buscareemplazar.png"};
And I change the route to the icon folder and set the icon one by one in the element I want, in this example, I change all the icons on the QMenu editar.
inir="classpath:/ico/claro/";
List ed = editar.actions();
for(int i=0; i<ed.size(); i++)
{
QAction tmp = (QAction) ed.get(i);
tmp.setIcon(new QPixmap(inir+nombreiconoseditar[i]));
}
Hope this can help someone with the same problem!