Home > other >  Python3.7 pyqt5: the mouse across the menu bar when the content of the status bar will disappear
Python3.7 pyqt5: the mouse across the menu bar when the content of the status bar will disappear

Time:11-25

You got talent, I met a strange problem: python3.7 + pyqt5, content of the mouse across the status bar when the menu bar will disappear
See below:


The code is as follows:
Qt Designer automatically generated code:
 the from PyQt5 import QtCore QtGui, QtWidgets 

The class Ui_MainWindow (object) :
Def setupUi (self, the MainWindow) :
MainWindow. SetObjectName (" MainWindow ")
MainWindow. Resize (600, 400)
Icon=QtGui. QIcon ()
Icon. AddPixmap (QtGui. QPixmap (" :/PNG/Resource/Python. PNG "), QtGui. QIcon. Normal, QtGui. QIcon. Off)
MainWindow. SetWindowIcon (icon)
MainWindow. SetToolTipDuration (1)
Self. Centralwidget=QtWidgets. QWidget (MainWindow)
Self. Centralwidget. SetObjectName (" centralwidget ")
Self. Pb_open=QtWidgets. QPushButton (self centralwidget)
Self. Pb_open. SetGeometry (QtCore QRect (180, 140, 81, 41))
Self. Pb_open. SetObjectName (" pb_open ")
Self. Pb_close=QtWidgets. QPushButton (self centralwidget)
Self. Pb_close. SetGeometry (QtCore QRect (310, 140, 81, 41))
Self. Pb_close. SetObjectName (" pb_close ")
MainWindow. SetCentralWidget (self. Centralwidget)
The self. The menubar=QtWidgets. QMenuBar (MainWindow)
The self. The menubar. SetGeometry (QtCore QRect (0, 0, 600, 23))
The self. The menubar. SetObjectName (" menubar ")
Self. Menu_F=QtWidgets. QMenu (self. The menubar)
Self. Menu_F. SetObjectName (" menu_F ")
Self. Menu_O=QtWidgets. QMenu (self. The menubar)
Self. Menu_O. SetObjectName (" menu_O ")
Self. Menu_A=QtWidgets. QMenu (self. The menubar)
Self. Menu_A. SetObjectName (" menu_A ")
MainWindow. SetMenuBar (self. Menubar)
The self. The statusbar=QtWidgets. QStatusBar (MainWindow)
The self. The statusbar. SetObjectName (" statusbar ")
MainWindow. SetStatusBar (self. The statusbar)
The self. The toolBar=QtWidgets. QToolBar (MainWindow)
The self. The toolBar. SetObjectName (" toolBar ")
MainWindow. AddToolBar (QtCore. Qt. TopToolBarArea, the self. The toolBar)
Self. Action_open=QtWidgets. QAction (MainWindow)
Icon1=QtGui. QIcon ()
Icon1. AddPixmap (QtGui. QPixmap (" :/PNG/Resource/open. Ico "), QtGui. QIcon. Normal, QtGui. QIcon. Off)
Self. Action_open. SetIcon (icon1)
Self. Action_open. SetObjectName (" action_open ")
Self. Action_about=QtWidgets. QAction (MainWindow)
Icon2=QtGui. QIcon ()
Icon2. AddPixmap (QtGui. QPixmap (" :/PNG/Resource/about ico "), QtGui. QIcon. Normal, QtGui. QIcon. Off)
Self. Action_about. SetIcon (icon2)
Self. Action_about. SetObjectName (" action_about ")
Self. Action_save=QtWidgets. QAction (MainWindow)
Icon3=QtGui. QIcon ()
Icon3. AddPixmap (QtGui. QPixmap (" :/PNG/Resource/save. Ico "), QtGui. QIcon. Normal, QtGui. QIcon. Off)
Self. Action_save. SetIcon (icon3)
Self. Action_save. SetObjectName (" action_save ")
Self. Action_exit=QtWidgets. QAction (MainWindow)
Icon4=QtGui. QIcon ()
Icon4. AddPixmap (QtGui. QPixmap (" :/PNG/Resource/exit. Ico "), QtGui. QIcon. Normal, QtGui. QIcon. Off)
Self. Action_exit. SetIcon (icon4)
Self. Action_exit. SetObjectName (" action_exit ")
Self. Action_option=QtWidgets. QAction (MainWindow)
Icon5=QtGui. QIcon ()
Icon5. AddPixmap (QtGui. QPixmap (" :/PNG/Resource/option. The ico "), QtGui. QIcon. Normal, QtGui. QIcon. Off)
Self. Action_option. SetIcon (icon5)
Self. Action_option. SetObjectName (" action_option ")
Self. Menu_F. AddAction (self action_open)
Self. Menu_F. AddAction (self action_save)
Self. Menu_F. AddSeparator ()
Self. Menu_F. AddAction (self action_exit)
Self. Menu_O. AddAction (self action_option)
Self. Menu_A. AddAction (self action_about)
The self. The menubar. AddAction (self) menu_F) menuAction ())
The self. The menubar. AddAction (self) menu_O) menuAction ())
The self. The menubar. AddAction (self) menu_A) menuAction ())
The self. The toolBar. AddAction (self action_open)
The self. The toolBar. AddAction (self action_save)
The self. The toolBar. AddSeparator ()
The self. The toolBar. AddAction (self action_option)
The self. The toolBar. AddAction (self action_about)
The self. The toolBar. AddSeparator ()
The self. The toolBar. AddAction (self action_exit)

Self. RetranslateUi (MainWindow)
Self. Pb_close. Clicked. Connect (MainWindow. Close)
Self. Action_exit. Triggered. Connect (MainWindow. Close)
QtCore. QMetaObject. ConnectSlotsByName (MainWindow)

Def retranslateUi (self, the MainWindow) :
_translate=QtCore. QCoreApplication. Translate
MainWindow. SetWindowTitle (_translate (" MainWindow ", "MainWindow"))
MainWindow. SetToolTip (_translate (" MainWindow, "" & lt; Html>

" ))
Self. Pb_open. SetText (_translate (" MainWindow ", "open file"))
Self. Pb_close. SetText (_translate (" MainWindow ", "close window"))
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related