title: PyQt5: Get list of all properties in an object (QPushButton)
body: <p>Using .setProperty I have assigned a few properties, dynamic properties if I'm not mistaken, to a QPushButton. I would like to be able to get a list of all the properties for that button, ideally I would just want the 'button' and 'test' properties that I have added. I tried 'QObject.dynamicPropertyNames' but it gives me an output that I do not understand nor am I sure if it is what I am looking for.</p>
  
  <pre><code>import sys
  from PyQt5 import QtCore, QtWidgets
  from PyQt5.QtWidgets import *
  from PyQt5.QtCore import *
  from PyQt5.QtGui import *
  
  
  class MainWindow(QMainWindow):
      def __init__(self):
          QMainWindow.__init__(self)
          self.setMinimumSize(QSize(400, 400))    
          texts= ['button1']
          self.pybutton = {}
  
          list_props = QPushButton('list_props', self)
          list_props.clicked.connect(self.list_props)
          list_props.resize(100,115)
  
  
          for x, (text, t) in enumerate(zip(texts, range(300,0,-100))):
              btn = QPushButton(text, self) 
              btn.setObjectName('btn{}'.format(x+1))
              btn.resize(100,100)
              btn.move(t,100)
              btn.setStyleSheet('QPushButton::menu-indicator { image: none; }')
  
              menu = QMenu()
              btn.setMenu(menu)
              args = ("button", btn)
              args2 = ("test", btn)
              menu.setProperty(*args)
              for act in ("item1", "item2", "item3"):
                  action = menu.addAction('item1',self.status)
                  action.setProperty(*args)
                  action.setProperty(*args2)
              menu2 = menu.addMenu('menu2')
              action = menu2.addAction('item4', self.status)
              action.setProperty(*args)
              action.setProperty(*args2)
              self.pybutton[str(x+1)] = btn
  
          self.statusBar()
  
      def status(self):
          action = self.sender()
          btn = action.property("button")
          self.statusBar().showMessage('{} was pressed with button: {}'.format(action.text(), btn.text()))
  
  
      def list_props(self):
          for i in self.pybutton:
              x = self.pybutton[str(i)]
              print(x.objectName(),x.text())
              p = QObject.dynamicPropertyNames(x)
              print(p)
  
  if __name__ == "__main__":
      app = QtWidgets.QApplication(sys.argv)
      mainWin = MainWindow()
      mainWin.show()
      sys.exit( app.exec_() )
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>[PyQt5.QtCore.QByteArray(b'_q_styleSheetWidgetFont'), 
  PyQt5.QtCore.QByteArray(b'_q_stylestate'), 
  PyQt5.QtCore.QByteArray(b'_q_stylerect'), 
  PyQt5.QtCore.QByteArray(b'_q_isdefault'), 
  PyQt5.QtCore.QByteArray(b'_q_no_animation')]
  </code></pre>