Results 1 to 3 of 3

Thread: Assign shortcut only

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2011
    Posts
    19
    Thanks
    9
    Qt products
    Qt4

    Default Assign shortcut only

    Hi,

    BrushColorAction is a QAction assigned a shortcut (Ctrl + C) and is added in a menu.

    brushColorAction = new QAction(tr("&Brush Color..."), this);
    brushColorAction->setShortcut(tr("Ctrl+C"));
    connect(brushColorAction, SIGNAL(triggered()),
    this, SLOT(brushColorAct()));

    void brushColorAct() { .. QColorDialog * dlg = new QColorDialog; .... }

    If I want to remove the menu but keep the shortcut (Ctrl + C) to invoke the color dialog,
    how to do it ? Thank your replay.
    Last edited by chiaminhsu; 8th February 2013 at 15:18.

Similar Threads

  1. How to Assign a Variable into LineEdit
    By mcht_z in forum Newbie
    Replies: 2
    Last Post: 18th February 2011, 19:55
  2. How to assign IP address to eth0 in QT
    By csw00700 in forum Qt Programming
    Replies: 4
    Last Post: 7th February 2011, 13:31
  3. Assign shortcut keys to buttons
    By mecrazycoder in forum Newbie
    Replies: 0
    Last Post: 7th January 2011, 22:42
  4. How to correctly re-assign a pointer?
    By homerun4711 in forum Newbie
    Replies: 26
    Last Post: 4th January 2011, 16:39
  5. boost::assign
    By Sivert in forum General Programming
    Replies: 0
    Last Post: 2nd May 2007, 00:23

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.