PDA

View Full Version : QToolBar



coderbob
17th December 2007, 03:04
I know I have seen this before but could not find it with a search.

QMainWindow has addtoolBar for adding toolbars to it.

Is there any way to add a toolbar to a QDialog or any other widget?

Bob

jpn
17th December 2007, 07:43
QToolBar is a QWidget so basically you can put it anywhere you want. But QMainWindow is the only class capable of handling it like one (with moving functionality and such). Notice that against common misbelief, QMainWindow is not limited to one instance per application.

coderbob
18th December 2007, 04:27
Thanks jpn,

I was pondering the use of just using multiple QMainWindows but was not sure if it was exactly "allowed".

After testing I noticed I cannot dock and move toolbars between the mainwindows which is a good thing for my purpose. My question at this point is multiple QMianWindows just a quirk or is using QMainWindow in this way going to remain valid?

Bob