PDA

View Full Version : Can i add Actions to QDockWidget



ladiesfinger
30th January 2011, 13:47
I want to implement a lot of actions in my app( a lot . say some 50 )
( i'm coding in PyQt )
I wanted these actions be added to 2 or 3 QDockWidgets (right,left and bottom ) as icons . I created an action and added to a QListWidget and set the dockwidget . But nothing appears .

Here's the code :


self.optionslist_1.addAction(conv_main)
rightdock.setWidget(self.optionslist_1)

where
optionslist_1 is a QListWidget
rightdock whose declarations are implemented previously .
conv_main is an action that i've created earlier .

So actions can't be added to a Dock ?
Should i go for Toolbar ? And is Toolbars added only at Top ?

Any suggestions welcome......

wysota
30th January 2011, 14:15
An "action" is nothing that is "displayed" so if you expected some icons to appear, that's not how it works. Add a toolbar or a bunch of tool buttons and add actions to those.

ladiesfinger
30th January 2011, 14:24
Thank u .
( Actually i wanted the way actions are added in Toolbars -> via icons. In Docks .)

Can i implement toolbars to the right or left just like docks ? . Because if i add 50 actions all at the top , it'll be ugly .

wysota
30th January 2011, 15:04
See QMainWindow::addToolbar() variant that takes two arguments.

ladiesfinger
30th January 2011, 15:11
Thank u . Going for Toolbars......