problem
AttributeError: 'QWidget' object has no attribute 'setCentralWidget'
reason
We can see setcentralwidget in QT help document that it belongs to the method of qmainwindow class and is defined separately in its class, so it cannot be called directly for its parent class QWidget.
void QMainWindow::setCentralWidget(QWidget *widget)
decided
Write QtWidgets.QWidget() converts QtWidgets.QMainWindow().
Read More:
- [Solved] AttributeError: ‘depthai.node.ObjectTracker‘ object has no attribute ‘setTrackerIdAssigmentPolicy‘
- [Solved] redis Error: AttributeError: ‘list‘ object has no attribute ‘decode‘
- PySpark error: AttributeError: ‘NoneType‘ object has no attribute ‘_jvm‘
- [Solved] AttributeError : ‘GridSearchCV‘ object has no attribute ‘grid_scores_‘
- [Solved] AttributeError: ‘openvino.inference_engine.ie_api.IENetwork‘ object has no attribute ‘input_info‘
- ROS package executes rosrun error: attributeerror: ‘thread’ object has no attribute ‘isalive‘
- [Solved] AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
- Yolox_s.pth Convert to tensorRT Error: AttributeError: ‘tensorrt.tensorrt.Builder‘ object has no attribute ‘max_workspace_size‘
- [Jeston Xavier NX Compile librealsense Error] AttributeError: module ‘pyrealsense2‘ has no attribute ‘pipeline‘
- [Solved] OpenCV Error: AttributeError: module ‘cv2‘ has no attribute ‘data‘
- [Solved] AttributeError: module ‘keras.preprocessing.image‘ has no attribute ‘load_img‘
- Numpy.exp Function Error ‘Float’ object has no attribute ‘exp’
- Peewee insert data error:’buffer’ object has no attribute’translate’
- TensorFlow error: AttributeError: module ‘tensorflow_core._api.v2.train’ has no attribute ‘Optimizer‘
- [Solved] Raspberry Pi Error: AttributeError: module ‘serial‘ has no attribute ‘Serial‘
- Attributeerror encountered when using ceilometer and gnocchi to execute commands related to gnocchi metric list: _Environ instance has no attribute ‘
- Tensorflow error: attributeerror: module ‘tensorflow_ API. V1. Train ‘has no attribute’ summarywriter ‘
- [How to Solve] Tesorflow: module ‘pandas.core.computation’ has no attribute ‘expressions’
- module ‘networkx’ has no attribute ‘from_pandas_dataframe’
- [Solved] Module ‘scipy.misc‘ has no attribute ‘imread‘