taraj
18th August 2011, 07:01
Hello,
I have been using the following keyboard as a standalone application
http://qt-apps.org/content/show.php/QVKeyboard?content=77983
and it works great.
I wish to integrate this application into an exisiting product. I have a toolbar (QWidget) with buttons and edit boxes, i also have a display (QWidget), both are separate classes that are stared up in main() with 'new'. On the toolbar I have a QToolButton that when i press i wish to activate the qvkeyboard, when i press again i wish to close the qvkeyboard. I have attempted to do this 2 ways, both have problems though.
1.Use QProcess which calls proc->start("./qvkeyboard"). This works and qvkeyboard is able to be used/interacts with QLineEdit etc on the toolbar that the QToolbutton is on. Problem I have is that when i press the QToolButton again to close the qvkeyboard it won't. I have tried proc->kill and proc->terminate and it does nothing. Is there a way to send a signal/slot to a proc, or a message somehow?
2. I have intergrated the qvkeyboard code into my existing produce (called it KeyPadwindow). I create it with
KeyPadwindow = new Q_KeyPadwindow(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTop)
at system start up then use
KeyPadWindow->show()
When the QToolButton is pressed
This show command opens the KeyPadwindow but it will not interact with the QLineEdit boxes in the toolbar. Do i need to get focus? Does the XTestFakeKeyEvent only send fake key to application outside the one that the code is being run?
I think that instead of using XTestFakeKeyEvent that i could use signals/slots but i would need to create a QKeyEvent for all the keys on the keyboard and this seems a messy way. Also how do i determine where the focus is between my 2 widgets (toolbar and display)? I need to be able to send key presses to both depending on where the focus is.
Depending on the key pressed can the focus be changed between the two? I don't really understand QFocus...
Hope that makes sense and some kind person can help
cheers,
X_Key_confused....
I have been using the following keyboard as a standalone application
http://qt-apps.org/content/show.php/QVKeyboard?content=77983
and it works great.
I wish to integrate this application into an exisiting product. I have a toolbar (QWidget) with buttons and edit boxes, i also have a display (QWidget), both are separate classes that are stared up in main() with 'new'. On the toolbar I have a QToolButton that when i press i wish to activate the qvkeyboard, when i press again i wish to close the qvkeyboard. I have attempted to do this 2 ways, both have problems though.
1.Use QProcess which calls proc->start("./qvkeyboard"). This works and qvkeyboard is able to be used/interacts with QLineEdit etc on the toolbar that the QToolbutton is on. Problem I have is that when i press the QToolButton again to close the qvkeyboard it won't. I have tried proc->kill and proc->terminate and it does nothing. Is there a way to send a signal/slot to a proc, or a message somehow?
2. I have intergrated the qvkeyboard code into my existing produce (called it KeyPadwindow). I create it with
KeyPadwindow = new Q_KeyPadwindow(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTop)
at system start up then use
KeyPadWindow->show()
When the QToolButton is pressed
This show command opens the KeyPadwindow but it will not interact with the QLineEdit boxes in the toolbar. Do i need to get focus? Does the XTestFakeKeyEvent only send fake key to application outside the one that the code is being run?
I think that instead of using XTestFakeKeyEvent that i could use signals/slots but i would need to create a QKeyEvent for all the keys on the keyboard and this seems a messy way. Also how do i determine where the focus is between my 2 widgets (toolbar and display)? I need to be able to send key presses to both depending on where the focus is.
Depending on the key pressed can the focus be changed between the two? I don't really understand QFocus...
Hope that makes sense and some kind person can help
cheers,
X_Key_confused....