title: Easiest way to subclass a widget in Python for use with Qt Designer
body: <p>I'm building an app using PyQt5, with (most of) the GUI being built using Qt Designer.  I have a few UI elements that do mostly the same thing and it seems sensible to move their code into classes that inherit from a base class (which in turn inherits from QTableWidget).</p>
  
  <p>This seems really straightforward except that I'm not sure how to get Qt Designer to use these classes when generating its UI files.  I've found <a href="https://wiki.python.org/moin/PyQt/Using_Python_Custom_Widgets_in_Qt_Designer" rel="noreferrer">a guide for doing this in PyQt4</a> and <a href="https://doc.qt.io/qt-5/designer-using-custom-widgets.html" rel="noreferrer">another one that's for Qt 5 but with native C++ code</a> and <a href="http://zetcode.com/gui/pyqt5/customwidgets/" rel="noreferrer">yet another one</a> that's for PyQt5 but doesn't deal with the (most complicated) aspect of making the subclasses available in Qt Designer.</p>
  
  <p>How do I make a subclass of a widget created using PyQt5 available for use in Qt Designer?</p>
  
  <p>Alternatively, is there an easier way to do this?  I don't need to change the appearance or functionality of the widgets—I'm mostly just looking for an organized place to store some code that makes their data easier to set and access.</p>