qt5和pyqt中如何设置控件在窗口上的位置

 

  
   
    toolBar
   
   
    TopToolBarArea
   
   
    true
   
  

 

PandarView::PandarView() {
  Ui.setupUi(this);

  this->addToolBar(Qt::LeftToolBarArea, this->findChild("SettingToolbar"));

 

 

def findQObjectByName(widgets, name):
    for w in widgets:
        if w.objectName == name:
            return w

def getMainWindow():
    return findQObjectByName(QtGui.QApplication.topLevelWidgets(), 'PandarView')

def getSettingToolbar():
    return findQObjectByName(getMainWindow().children(), 'SettingToolbar')


getMainWindow().addToolBar(QtCore.Qt.LeftToolBarArea, getSettingToolbar())

 

 

你可能感兴趣的:(qt5和pyqt中如何设置控件在窗口上的位置)