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