Results 1 to 5 of 5

Thread: Can i add Actions to QDockWidget

  1. #1
    Join Date
    Aug 2010
    Location
    Chennai
    Posts
    21
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Can i add Actions to QDockWidget

    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 :
    Qt Code:
    1. self.optionslist_1.addAction(conv_main)
    2. rightdock.setWidget(self.optionslist_1)
    To copy to clipboard, switch view to plain text mode 
    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......

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Can i add Actions to QDockWidget

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    ladiesfinger (30th January 2011)

  4. #3
    Join Date
    Aug 2010
    Location
    Chennai
    Posts
    21
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can i add Actions to QDockWidget

    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 .

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Can i add Actions to QDockWidget

    See QMainWindow::addToolbar() variant that takes two arguments.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    ladiesfinger (30th January 2011)

  7. #5
    Join Date
    Aug 2010
    Location
    Chennai
    Posts
    21
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can i add Actions to QDockWidget

    Thank u . Going for Toolbars......

Similar Threads

  1. Replies: 1
    Last Post: 7th December 2010, 21:46
  2. How to add right click actions?
    By hakermania in forum Newbie
    Replies: 2
    Last Post: 17th November 2010, 06:31
  3. Menu Actions
    By GrahamLabdon in forum Newbie
    Replies: 9
    Last Post: 16th June 2010, 00:41
  4. What's wrong with my actions???
    By fullmetalcoder in forum Qt Programming
    Replies: 6
    Last Post: 4th March 2007, 18:49
  5. Actions and what to do with them?
    By krsmichael in forum Qt Tools
    Replies: 2
    Last Post: 20th January 2006, 22:08

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.