Using QMainWindow change default position of toolbar. PYQT4
Hello guys.
I was wondering if anyone can help me with some syntax/expression. i am using QMainWindow
The GUI i am working on has a tool bar , now i want to change the default position of it to the left of the CenterWidget. i am having problem saying put the toolbar to the left ..
http://img833.imageshack.us/img833/2669/picsq.png
Here is the code i have at the moment
Code:
toolbar = self.addToolBar('toolbar')
toolbar.addAction(NewDoc)
toolbar.addAction(Map)
toolbar.addAction(Change)
toolbar.addAction(exit)
Here things i tried without luck.
Code:
toolbar = self.addToolBar(Qt.LeftToolBarArea)
toolbar.addAction(NewDoc)
toolbar.addAction(Map)
toolbar.addAction(Change)
toolbar.addAction(exit)
Code:
toolbar = self.addToolBar('toolabr')
toolbar.LeftToolbarArea()
toolbar.addAction(NewDoc)
toolbar.addAction(Map)
toolbar.addAction(Change)
toolbar.addAction(exit)
Code:
toolbar = self.addToolBar(Qt.BottomToolBarArea,'Toolbar')
toolbar.LeftToolbarArea()
toolbar.addAction(NewDoc)
toolbar.addAction(Map)
toolbar.addAction(Change)
toolbar.addAction(exit)
i would appreciate any help. Thank you
ps: sorry for the indent..
Re: Using QMainWindow change default position of toolbar. PYQT4
31 views and people have no idea? any python people in this forum?
Re: Using QMainWindow change default position of toolbar. PYQT4
check http://www.riverbankcomputing.co.uk/...ainwindow.html
you are looking for:
addToolBar (self, Qt.ToolBarArea area, QToolBar toolbar)
What you are doing is storing the result of adding a toolbar to your MainWindow as a variable named toolbar.
You need to first create the toolbar and only then add it to the main window with a position.
example:
Code:
from PyQt4.QtGui import *
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.addToolBar( Qt.LeftToolBarArea , myToolbar )