00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "mousetoolaction.h"
00020
00021 #include <ktoolbar.h>
00022 #include <ktoolbarbutton.h>
00023 #include <kdebug.h>
00024
00025 namespace Kivio {
00026
00027 MouseToolAction::MouseToolAction(const QString& text, const KShortcut& cut,
00028 QObject* parent, const char* name)
00029 : KRadioAction(text, cut, parent, name)
00030 {
00031 }
00032
00033 MouseToolAction::MouseToolAction(const QString& text, const KShortcut& cut,
00034 const QObject* receiver, const char* slot,
00035 QObject* parent, const char* name)
00036 : KRadioAction(text, cut, receiver, slot, parent, name)
00037 {
00038 }
00039
00040 MouseToolAction::MouseToolAction(const QString& text, const QIconSet& pix,
00041 const KShortcut& cut,
00042 QObject* parent, const char* name)
00043 : KRadioAction(text, pix, cut, parent, name)
00044 {
00045 }
00046
00047 MouseToolAction::MouseToolAction(const QString& text, const QString& pix,
00048 const KShortcut& cut,
00049 QObject* parent, const char* name)
00050 : KRadioAction(text, pix, cut, parent, name)
00051 {
00052 }
00053
00054 MouseToolAction::MouseToolAction(const QString& text, const QIconSet& pix,
00055 const KShortcut& cut,
00056 const QObject* receiver, const char* slot,
00057 QObject* parent, const char* name)
00058 : KRadioAction(text, pix, cut, receiver, slot, parent, name)
00059 {
00060 }
00061
00062 MouseToolAction::MouseToolAction(const QString& text, const QString& pix,
00063 const KShortcut& cut,
00064 const QObject* receiver, const char* slot,
00065 QObject* parent, const char* name)
00066 : KRadioAction(text, pix, cut, receiver, slot, parent, name)
00067 {
00068 }
00069
00070 MouseToolAction::MouseToolAction(QObject* parent, const char* name)
00071 : KRadioAction(parent, name)
00072 {
00073 }
00074
00075 MouseToolAction::~MouseToolAction()
00076 {
00077 }
00078
00079 int MouseToolAction::plug(QWidget* widget, int index)
00080 {
00081 int usedIndex = KRadioAction::plug(widget, index);
00082
00083 if(usedIndex == -1) {
00084 return usedIndex;
00085 }
00086
00087 if(::qt_cast<KToolBar*>(widget)) {
00088 KToolBar* toolBar = static_cast<KToolBar*>(widget);
00089 KToolBarButton* button = toolBar->getButton(itemId(usedIndex));
00090 connect(button, SIGNAL(doubleClicked(int)), this, SIGNAL(doubleClicked()));
00091 }
00092
00093 return usedIndex;
00094 }
00095
00096 }
00097
00098 #include "mousetoolaction.moc"