Hi All,
Is there any way to turn google tools on or off through Qt on QLineEdit focus.
Actually i am using multilingual application & I want different language on different line edits.
Thanks in advance.
Regards,
Rohit.
Hi All,
Is there any way to turn google tools on or off through Qt on QLineEdit focus.
Actually i am using multilingual application & I want different language on different line edits.
Thanks in advance.
Regards,
Rohit.
I want to access a different application(Google Tools) from Qt.
I want to turn google tools on or off*(pressing Ctr+G) based on which qlineedit it has focussed.
Or can i press Ctr+G (Not through keyboard externally) on line edit focussing.
Or firing Keyboard event.
What google tools? What does Qt have to do with this? Do you mean google input tools (http://www.google.com/inputtools/)? Could you be more specific about what you have now, what you want and how is what you have different from what you want?
Yes it is google input tools.
I want google input tools to be turned off & on based on the line edit on which I am focusing.
So, on focus event for a line edit I want Ctrl+G(viz. a shortcut to turn google tools on & off) to be pressed.
Can I do this ? Is it possible to press /Call keyboard event or can I directly access Google tools application from qt.
Help will be appreciated.
My Application is a multi language application in which user inputs a different language for a certain line edit & a different language on different line edit.
Hence, pressing Ctrl+G I have to toggle the language each time , but now i want it to be done through programmatically.
If the tool does not provide any API to control it then most likely you can't do it. If the tool provides some API you can use then most probably you can do it. Which is the case I doubt anyone on this forum has any knowledge of and it would be better to ask at some google site or read their manual.
rohitkk (3rd April 2014)
Its not about whether google tools provide it , Its about whether Qt allows to do it. If Yes then how?
Create a QShortCut for CTRL+G and in the slot check which of your QLineEdit has focus (if any).
You can trigger the slot directly, e.g. through subclassing QLineEdit and reimplementing focusInEvent() or by using an event filter.
You can do that as well. Create a QKeyEvent and use QApplication:ostEvent() or QApplication::sentEvent() to whatever widget you'd like to be the receiver.
All of that is obviously totally independent of what you do when the short cut is triggered.
Cheers,
_
Is this what you are looking for ?
Qt Code:
connect(shortcut, SIGNAL(activated()), objectOfCorrespondingClass, SLOT(getFocussedLineEdit())); // -- slot void YourClass::getFocussedLineEdit() { if(lineEdit_1->hasFocus()) { // Do necessary } else if(lineEdit_2->hasFocus()) { // Do necessary } else if(lineEdit_3->hasFocus()) { // Do necessary } else { // ... } }To copy to clipboard, switch view to plain text mode
I am able to check that whether line edit is in focus but i am not able to fire the 'Ctrl+G' event after focusing.
Below is my code snippet,
Qt Code:
{ if (target == ui->leAge) //On focussing Age line edit i want to fire 'Ctrl+G' event { { qDebug()<<"Inside Event"; } } }To copy to clipboard, switch view to plain text mode
Is the line 8 should not be a :
Qt Code:
To copy to clipboard, switch view to plain text mode
What exactly you expect to happen when you send Ctrl+G to your application object? If you expect another application to respond to it then it is not going to happen.
Last edited by rohitkk; 2nd April 2014 at 13:29.
QCoreApplication::postEvent send event to any object in this application.
Definitely not this way. You are sending an internal event to an internal object so don't expect some other entity to receive and understand that. It's like you were driving a car, turning your driver wheel right and expecting some concrete car in a different country to start ringing its horn.
Then what is right way to do it?
I am really getting confused bcoz of this shit.
Added after 22 minutes:
As of now u must have understand my requirement. If there are any suggestion on how to do it will be highly appreciated.
Please co-ordinate as i am new to qt framework.
Regards,
Rohit
Last edited by rohitkk; 2nd April 2014 at 14:39.
rohitkk (2nd April 2014)
Bookmarks