summaryrefslogtreecommitdiff
path: root/development/keyview/keyboardimpl.cpp
authorzecke <zecke>2004-08-14 17:15:44 (UTC)
committer zecke <zecke>2004-08-14 17:15:44 (UTC)
commit74363a9e1d5688d65286e7fea156227b68a28002 (patch) (side-by-side diff)
tree3926a1a3bd42bebb2f67b3334735bc3b3931f796 /development/keyview/keyboardimpl.cpp
parent7657b6986a600ec1b3626c83e8f19036bf69e493 (diff)
downloadopie-74363a9e1d5688d65286e7fea156227b68a28002.zip
opie-74363a9e1d5688d65286e7fea156227b68a28002.tar.gz
opie-74363a9e1d5688d65286e7fea156227b68a28002.tar.bz2
-Remove the KeyFilter on destruction
Alwin could we either add a 'QObject' as a owner so that we could use QGuardedPtr or look for the deleteEvent ourselves. Or let us create a KeyFilter ourselves that auto registers (maybe) but cleans up itself in any case?
Diffstat (limited to 'development/keyview/keyboardimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--development/keyview/keyboardimpl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/development/keyview/keyboardimpl.cpp b/development/keyview/keyboardimpl.cpp
index 673eaa5..0216110 100644
--- a/development/keyview/keyboardimpl.cpp
+++ b/development/keyview/keyboardimpl.cpp
@@ -119,71 +119,75 @@ static const char * kb_xpm[] = {
"i|56c|56c|56.@#.--pqrstuvwxy",
"i169c169c16.@#.--zAqrBCDEFGH",
"82700ccc0cj...--IzAqrJKLMNOP"};
KeyboardImpl::KeyboardImpl()
: input(0), icn(0), ref(0)
{
}
KeyboardImpl::~KeyboardImpl()
{
delete input;
delete icn;
}
QWidget *KeyboardImpl::inputMethod( QWidget *parent, Qt::WFlags f )
{
if ( !input )
input = new Keyview( parent, "Keyview", f );
return input;
}
void KeyboardImpl::resetState()
{
/*
if ( input )
input->resetState();
*/
}
QPixmap *KeyboardImpl::icon()
{
if ( !icn )
icn = new QPixmap( (const char **)kb_xpm );
return icn;
}
QString KeyboardImpl::name()
{
// return qApp->translate( "InputMethods", "Keyboard" );
return "Keyview";
}
void KeyboardImpl::onKeyPress( QObject *receiver, const char *slot )
{
+ Q_UNUSED( receiver );
+ Q_CONST_UNUSED( slot );
//if ( input )
//QObject::connect( input, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot );
}
#ifndef QT_NO_COMPONENT
QRESULT KeyboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
{
*iface = 0;
if ( uuid == IID_QUnknown )
*iface = this;
else if ( uuid == IID_InputMethod )
*iface = this;
+ else
+ return QS_FALSE;
if ( *iface )
(*iface)->addRef();
return QS_OK;
}
Q_EXPORT_INTERFACE()
{
Q_CREATE_INSTANCE( KeyboardImpl )
}
#endif