setting flags Qt::Popup and Qt::FramelessWindowHint to QWidget make it paint only once.
after calling show() or exec() for second time you get only border with invisible inside, meaning content does not paint.
this affect menu as well.
bellow is example of the bug, after clicking on buttons "widget test" and "button test" the widget and the menu show it contents, the second time we try, the content does not draw (see screen shoot bellow)
note that this occure using xcode 9.4.1 with sdk 10.13