shortcuts.cpp
author insilmaril
Tue, 09 Mar 2010 08:28:49 +0000
changeset 830 b5537d245165
parent 824 36eb4b8f409e
child 842 bec082472471
permissions -rw-r--r--
Minor bugfix: editSortBack is no toggle action
     1 #include <QDebug>
     2 #include <QMultiMap>
     3 
     4 #include <iostream>
     5 using namespace std;
     6 
     7 #include "shortcuts.h"
     8 
     9 /////////////////////////////////////////////////////////////////
    10 // Shortcut
    11 /////////////////////////////////////////////////////////////////
    12 Shortcut::Shortcut(QWidget *parent) :QShortcut (parent)
    13 {
    14 }
    15 
    16 /////////////////////////////////////////////////////////////////
    17 // Switchboard
    18 /////////////////////////////////////////////////////////////////
    19 Switchboard::Switchboard ()
    20 {
    21 }
    22 
    23 void Switchboard::addConnection (QAction *a, const QString &group)
    24 {	
    25 	actions.insert(group,a);
    26 }
    27 
    28 void Switchboard::print ()
    29 {
    30 	QString g;
    31 	foreach (g,actions.uniqueKeys())
    32 	{
    33 		cout <<"Group: "<<g.toStdString()<<endl;
    34 		QList <QAction*> values=actions.values(g);
    35 		for (int i=0;i<values.size();++i)
    36 		{
    37 			cout<<QString ("  %1: %2") 
    38 				.arg(values.at(i)->text().left(30),30)
    39 				.arg(values.at(i)->shortcut().toString()).toStdString()<<endl;
    40 		}
    41 		cout <<endl;
    42 	}
    43 }