使工具栏融入标题栏

Making the toolbar blend into the title bar

我有一些用于生成工具栏的简单代码,我得到的结果如下所示:

工具栏和标题栏不同。有没有办法让工具栏像这样融入标题栏:

到目前为止,这是我的代码

def initToolbar(self):

  self.toolbar = self.addToolBar("Options")

  # Makes the next toolbar appear underneath this one
  self.addToolBarBreak()

def initMenubar(self):

  menubar = self.menuBar()

  file = menubar.addMenu("File")
  edit = menubar.addMenu("Edit")
  view = menubar.addMenu("View")

def initUI(self):

    self.text = QtGui.QTextEdit(self)
    self.setCentralWidget(self.text)

    self.initToolbar()
    self.initMenubar()

    ...

谢谢

好了QMainWindow::setUnifiedTitleAndToolBarOnMac(bool)