Results 1 to 5 of 5

Thread: QToolBar double click

  1. #1
    Join Date
    Feb 2007
    Posts
    27
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QToolBar double click

    I'd like to detect a double click in a QToolBar. Basically, I'm using a QToolBar/QActionGroup/QAction combination to create graphical tabs in my application. I'd like to perform an action when one of these "tabs" is double clicked.

    Any ideas?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBar double click

    Why not use tool buttons instead of actions?
    That way you can easily detect when they are double clicked.

    But if you really want to use QActions then you can intercept double clicks on the toolbar and see if a QAction is at that position, by connecting to its triggered signal.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QToolBar double click

    Toolbar actions are tool buttons. To me it sounds weird to have double clickable buttons. Isn't it a bit unintuitive?
    J-P Nurmi

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QToolBar double click

    I suggested a tool button because, being a QAbstractButton, he could easily reimplement mouse events for it and detect double clicks.

    To me it sounds weird to have double clickable buttons. Isn't it a bit unintuitive?
    Who knows...?
    Maybe he paints them differently so they don't have a "pushed" state and give the impression of a tab.

    Maybe plain, old widgets are better.

  5. #5
    Join Date
    Feb 2007
    Posts
    27
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QToolBar double click

    Quote Originally Posted by marcel View Post
    I suggested a tool button because, being a QAbstractButton, he could easily reimplement mouse events for it and detect double clicks.


    Who knows...?
    Maybe he paints them differently so they don't have a "pushed" state and give the impression of a tab.

    Maybe plain, old widgets are better.
    I don't actually paint them differently. There's a particular combination (I forget exactly what it is) that looks almost like Firefox's icon tabs (well, a few versions ago, I've lost track of what it looks like on every platform now).
    Last edited by sdfisher; 8th October 2007 at 06:27.

Similar Threads

  1. Double Click Capturing
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2011, 14:12
  2. QGraphicsScene Click / Double Click
    By philentropist in forum Qt Programming
    Replies: 1
    Last Post: 9th February 2007, 04:32
  3. QTreeWidget double click signal
    By Pinco Pallino in forum Newbie
    Replies: 2
    Last Post: 18th November 2006, 16:37
  4. Push button double click
    By curtisw in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2006, 16:40
  5. Replies: 5
    Last Post: 12th January 2006, 15:40

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.