summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp b/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp
index 329df09..5553166 100644
--- a/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp
+++ b/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp
@@ -85,6 +85,8 @@ TestMainWindow::TestMainWindow( QWidget* parent, const char* slot, WFlags fl )
m_manager->addKeyConfig( Opie::Ui::OKeyConfigItem( tr( "Delete Action" ), "delete_key", QPixmap(),
- 10, Opie::Ui::OKeyPair( Qt::Key_D, 0 ), this,
+ 10, Opie::Ui::OKeyPair( Qt::Key_D, Qt::ShiftButton ), this,
SLOT(slotDelete(QWidget*,QKeyEvent*)) ) );
+ m_manager->addKeyConfig( Opie::Ui::OKeyConfigItem( tr( "Show Action" ), "show_key", QPixmap(),
+ 11, Opie::Ui::OKeyPair( Qt::Key_S, Qt::AltButton ) ) );
connect(m_manager, SIGNAL(actionActivated(QWidget*,QKeyEvent*,const Opie::Ui::OKeyConfigItem&)),
@@ -97,4 +99,5 @@ TestMainWindow::TestMainWindow( QWidget* parent, const char* slot, WFlags fl )
TestMainWindow::~TestMainWindow() {
m_manager->save();
+ delete m_config;
}
@@ -109,5 +112,6 @@ Opie::Ui::OKeyConfigManager* TestMainWindow::manager() {
void TestMainWindow::keyPressEvent( QKeyEvent* ev ) {
qWarning( "String is "+ m_manager->handleKeyEvent( ev ).text() );
- qWarning( "Id was %d", m_manager->handleKeyEventId( ev ) );
+ qWarning( "Id was %d %d %d %d", m_manager->handleKeyEventId( ev ),ev->key(),ev->state(), ev->ascii() );
+ ev->ignore();
}