Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. conflict between QWidget (window) and mainWindow
Qt 6.11 is out! See what's new in the release blog

conflict between QWidget (window) and mainWindow

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 625 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gazzerpiece
    wrote on last edited by
    #1

    Hi, i'am new of Pyqt4.

    In my project when the window lose the focus and i try to click a MenuButton in mainWindow, the project crash!!! Why? Please help me!!
    this is my mainWindow code:
    @
    help = QAction(self.getIcon(QStyle.SP_MessageBoxQuestion), 'Help', self)
    self.connect(help, QtCore.SIGNAL('triggered()'), self.helpAction)

    def helpAction(self):
    a = Help()
    a.init()
    @

    and this is my Widget code:

    @
    class Help(QtGui.QWidget):
    def init(self):
    QtGui.QWidget.init(self)
    self.setWindowTitle(' Help')
    self.setWindowIcon(QtGui.QIcon('icons/help.png'))
    ok = QtGui.QPushButton("Close", self)
    self.connect(ok, QtCore.SIGNAL('clicked()'), QtCore.SLOT('hide()'))
    about = QtGui.QTextBrowser(self)
    about.setMinimumSize(400, 400)
    about.setSource(QtCore.QUrl('help.html'))
    grid = QtGui.QGridLayout(self)
    grid.setSpacing(7)
    grid.addWidget(about, 2, 0, 5, 3)
    grid.addWidget(ok, 7, 1)
    self.show()
    @

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alex_malyu
      wrote on last edited by
      #2

      You might find more help in Pyqt4 but code you shown is not complete to give any advice.
      Something wrong probably happens in slot called.
      If it is helpAction you may try to comment lines started with a.init() and up and see what causes failure.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved