but = QtWidgets.QToolButton(Dialog2) but.setText(‘**‘) but.setAutoRaise(True) layout.addWidget(but) Dialog2.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool) Dialog2.setWindowOpacity(1) Dialog2.setAttribute(QtCore.Qt.WA_TranslucentBackground)
Qt.Popup Window Indicates that the widget is a pop-up top-level window, i.e. that it is modal, but has a window system frame appropriate for pop-up menus.
Qt.Tool Indicates that the widget is a tool window. A tool window is often a small window with a smaller than usual title bar and decoration, typically used for collections of tool buttons. If there is a parent, the tool window will always be kept on top of it. If there isn‘t a parent, you may consider using Qt::WindowStaysOnTopHint as well. If the window system supports it, a tool window can be decorated with a somewhat lighter frame. It can also be combined with Qt::FramelessWindowHint. On OS X, tool windows correspond to the Floating class of windows. This means that the window lives on a level above normal windows; it impossible to put a normal window on top of it. By default, tool windows will disappear when the application is inactive. This can be controlled by the Qt::WA_MacAlwaysShowToolWindow attribute.