One way to resolve the issue described is to introduce a listener for dark mode change, and then change the icon accordingly in your QToolBar. As I see from QToolBar documentation, the straightforward way to do so would be call QToolBar::clear(), and then add all your actions together again.
Now the part about detecting dark mode changes. This part might be a bit tricky, but it is doable. Basically, you should introduce native code in Objective C++ (so, you would be able to use namespaces, headers, and so on, i.e. stuff from C++), and then add Objective C code that adds listener for dark mode changes. The name of the parameter you might want to add listener to is "AppleInterfaceThemeChangedNotification".
Finally, more direct thoughts to your problem which are not guaranteed to work (approach with detecting dark mode changes would definitely work, I think), but might be worth to try:
- Have you tried adding the pixmap of your PNG icon to QIcon in all states? You can see it here: https://doc.qt.io/qt-5/qicon.html#addPixmap
- Not sure if this would work, but maybe setting flag of being a mask would do something? https://doc.qt.io/qt-5/qicon.html#setIsMask
- Have you tried adding widgets to QToolBar instead of actions: https://doc.qt.io/qt-5/qtoolbar.html#addWidget? Maybe adding custom widget would not make your icons looks horrible despite the mode they are showing? of course, keep in mind that in this specific case you might have to create your own widgets.