-rw-r--r-- | libopie2/examples/opiecore/okeyconfigmanager/README | 1 | ||||
-rw-r--r-- | libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp | 30 | ||||
-rw-r--r-- | libopie2/examples/opieui/okeyconfigwidget/testwidget.h | 10 |
3 files changed, 21 insertions, 20 deletions
diff --git a/libopie2/examples/opiecore/okeyconfigmanager/README b/libopie2/examples/opiecore/okeyconfigmanager/README new file mode 100644 index 0000000..327b7c2 --- a/dev/null +++ b/libopie2/examples/opiecore/okeyconfigmanager/README @@ -0,0 +1 @@ +See opieui/okeyconfigwidget for an example of possible usage
\ No newline at end of file diff --git a/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp b/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp index 10b52f9..5c7bac2 100644 --- a/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp +++ b/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp @@ -29,7 +29,7 @@ public: private slots: void slotClicked(); private: - Opie::Ui::OKeyConfigManager *m_manager; + Opie::Core::OKeyConfigManager *m_manager; }; @@ -76,23 +76,23 @@ TestMainWindow::TestMainWindow( QWidget* parent, const char* slot, WFlags fl ) m_config = new Opie::Core::OConfig( "test_config_foo" ); /* generate the black list */ - Opie::Ui::OKeyPair::List blackList; - blackList.append( Opie::Ui::OKeyPair::leftArrowKey() ); - blackList.append( Opie::Ui::OKeyPair::rightArrowKey() ); - blackList.append( Opie::Ui::OKeyPair::downArrowKey() ); - blackList.append( Opie::Ui::OKeyPair::upArrowKey() ); + Opie::Core::OKeyPair::List blackList; + blackList.append( Opie::Core::OKeyPair::leftArrowKey() ); + blackList.append( Opie::Core::OKeyPair::rightArrowKey() ); + blackList.append( Opie::Core::OKeyPair::downArrowKey() ); + blackList.append( Opie::Core::OKeyPair::upArrowKey() ); - m_manager = new Opie::Ui::OKeyConfigManager( m_config, "Key Group", + m_manager = new Opie::Core::OKeyConfigManager( m_config, "Key Group", blackList, false, this, "Key Manager" ); - m_manager->addKeyConfig( Opie::Ui::OKeyConfigItem( tr( "Delete Action" ), "delete_key", QPixmap(), - 10, Opie::Ui::OKeyPair( Qt::Key_D, Qt::ShiftButton ), this, + m_manager->addKeyConfig( Opie::Core::OKeyConfigItem( tr( "Delete Action" ), "delete_key", QPixmap(), + 10, Opie::Core::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 ) ) ); + m_manager->addKeyConfig( Opie::Core::OKeyConfigItem( tr( "Show Action" ), "show_key", QPixmap(), + 11, Opie::Core::OKeyPair( Qt::Key_S, Qt::AltButton ) ) ); - connect(m_manager, SIGNAL(actionActivated(QWidget*,QKeyEvent*,const Opie::Ui::OKeyConfigItem&)), - this, SLOT(slotAction(QWidget*, QKeyEvent*, const Opie::Ui::OKeyConfigItem&)) ); + connect(m_manager, SIGNAL(actionActivated(QWidget*,QKeyEvent*,const Opie::Core::OKeyConfigItem&)), + this, SLOT(slotAction(QWidget*, QKeyEvent*, const Opie::Core::OKeyConfigItem&)) ); // when commenting the line below out the keyPressEvent will work m_manager->handleWidget( this ); m_manager->load(); @@ -103,7 +103,7 @@ TestMainWindow::~TestMainWindow() { delete m_config; } -Opie::Ui::OKeyConfigManager* TestMainWindow::manager() { +Opie::Core::OKeyConfigManager* TestMainWindow::manager() { return m_manager; } @@ -121,7 +121,7 @@ void TestMainWindow::slotDelete( QWidget* wid, QKeyEvent* ev ) { qWarning( "Slot Delete %d %d %d", wid, ev->key(), ev->state() ); } -void TestMainWindow::slotAction( QWidget* wid, QKeyEvent* ev, const Opie::Ui::OKeyConfigItem& item) { +void TestMainWindow::slotAction( QWidget* wid, QKeyEvent* ev, const Opie::Core::OKeyConfigItem& item) { qWarning( "Slot Action %d %d %d %s %d", wid, ev->key(), ev->state(), item.text().latin1(), item.id() ); } diff --git a/libopie2/examples/opieui/okeyconfigwidget/testwidget.h b/libopie2/examples/opieui/okeyconfigwidget/testwidget.h index b95c225..6ecb346 100644 --- a/libopie2/examples/opieui/okeyconfigwidget/testwidget.h +++ b/libopie2/examples/opieui/okeyconfigwidget/testwidget.h @@ -8,12 +8,12 @@ namespace Opie{ namespace Ui{ class OTabWidget; - class OKeyConfigManager; class OListView; - class OKeyConfigItem; } namespace Core { class OConfig; + class OKeyConfigManager; + class OKeyConfigItem; } } class QKeyEvent; @@ -26,15 +26,15 @@ public: TestMainWindow(QWidget* parent, const char*, WFlags fl ); ~TestMainWindow(); - Opie::Ui::OKeyConfigManager *manager(); + Opie::Core::OKeyConfigManager *manager(); protected: void keyPressEvent( QKeyEvent* ); private slots: void slotDelete( QWidget*, QKeyEvent* ); - void slotAction( QWidget*, QKeyEvent*, const Opie::Ui::OKeyConfigItem& ); + void slotAction( QWidget*, QKeyEvent*, const Opie::Core::OKeyConfigItem& ); private: Opie::Core::OConfig *m_config; - Opie::Ui::OKeyConfigManager *m_manager; + Opie::Core::OKeyConfigManager *m_manager; }; #endif |