I have qml button file that I want to be visible above the keyboard when the keyboard is visible.

I just want to know what I should do with my QmlApplicationViewer so that my small qml block is always visible on top of all other applications but you should still have access to the application below.

I have already implemented a way for the file to become visible when the keyboard is visible and I can easily get it right above the keyboard later but now I am struggling to prevent it from stealing focus and closing the keyboard, because the moment a keyboard is opened my button appears and the keyboard closes. The moment I close my app the button disappears and the keyboard reopens in the app where I originally opened it. I want this to be a background task which supplements the keyboard functionality, the button will allow for speech input.

main.qml:
Qt Code:
  1. import QtQuick 1.1
  2. import com.nokia.symbian 1.1
  3.  
  4. Button{
  5. signal keyActive()
  6.  
  7. x: 0
  8. y: 0
  9. text: "Voice"
  10. property bool bob: inputContext.visible
  11. onBobChanged: console.log("keyboard" + bob), bob ? keyActive() : null
  12. }
To copy to clipboard, switch view to plain text mode 

main.cpp:
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "qmlapplicationviewer.h"
  3. #include <QObject>
  4. #include <QGraphicsObject>
  5.  
  6. Q_DECL_EXPORT int main(int argc, char *argv[])
  7. {
  8. QApplication app(argc, argv);
  9.  
  10. QmlApplicationViewer viewer;
  11. viewer.setMainQmlFile(QLatin1String("qml/topwidget/main.qml"));
  12.  
  13. viewer.setWindowFlags(Qt::WindowStaysOnTopHint);
  14. viewer.setAttribute(Qt::WA_ShowWithoutActivating);
  15. viewer.move(10, 20);
  16. viewer.releaseKeyboard();
  17. viewer.show();
  18.  
  19. QObject *rootObject = viewer.rootObject();
  20. QObject::connect(rootObject, SIGNAL(keyActive()), &viewer, SLOT(raise()));
  21.  
  22. return app.exec();
  23. }
To copy to clipboard, switch view to plain text mode