Changeset 2981 for vidalia/trunk

Show
Ignore:
Timestamp:
08/17/08 01:49:08 (3 months ago)
Author:
edmanm
Message:

The slot called when a shortcut is pressed doesn't have to belong to a widget;
it could just be a QObject. Also add a convenience method that takes the
shortcut as a QString, instead of a QKeySequence.

Location:
vidalia/trunk/src/vidalia
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vidalia/trunk/src/vidalia/vidalia.cpp

    r2362 r2981  
    341341void 
    342342Vidalia::createShortcut(const QKeySequence &key, QWidget *sender, 
    343                         QWidget *receiver, const char *slot) 
     343                        QObject *receiver, const char *slot) 
    344344{ 
    345345  QShortcut *s = new QShortcut(key, sender); 
     
    347347} 
    348348 
     349/** Creates and binds a shortcut such that when <b>key</b> is pressed in 
     350 * <b>sender</b>'s context, <b>receiver</b>'s <b>slot</b> will be called. */ 
     351void 
     352Vidalia::createShortcut(const QString &key, QWidget *sender, 
     353                        QObject *receiver, const char *slot) 
     354{ 
     355  createShortcut(QKeySequence(key), sender, receiver, slot); 
     356} 
  • vidalia/trunk/src/vidalia/vidalia.h

    r2445 r2981  
    9696   * <b>sender</b>'s context, <b>receiver</b>'s <b>slot</b> will be called. */ 
    9797  static void createShortcut(const QKeySequence &key, QWidget *sender, 
    98                              QWidget *receiver, const char *slot); 
     98                             QObject *receiver, const char *slot); 
     99 
     100  /** Creates and binds a shortcut such that when <b>key</b> is pressed in 
     101   * <b>sender</b>'s context, <b>receiver</b>'s <b>slot</b> will be called. */ 
     102  static void createShortcut(const QString &key, QWidget *sender, 
     103                             QObject *receiver, const char *slot); 
    99104 
    100105signals: