shortcuts.cpp
author insilmaril
Thu, 25 Feb 2010 11:03:52 +0000
changeset 824 36eb4b8f409e
parent 806 2a33304714ba
child 842 bec082472471
permissions -rw-r--r--
Added dialog for HTML export. Grouping in Switchboard shortcuts
     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 }