Qt4/C++ - QClipboard - copy & paste to a terminal
Hello,
Debian 'Wheezy' - Qt4 - C++
I'm calling a system teminal and I can paste the clipbord contents into the terminal with a mouse right click & paste.
OK so far.
Code:
myClip->setText(myCommandString);
QString program
= ("lxterminal -e");
tProcess->start(program);
Would it be possible to use the centre mouse button to paste, as is normal in linux?
Or is it possible to paste to the termimal programmatically?
I would like the terminal to stay visible after the paste as 'myCommandString' expects a user response.
Regards
Re: Qt4/C++ - QClipboard - copy & paste to a terminal
On unix systems there are two separate clipboards available -- Clipboard and Selection. The first one is the one related to Ctrl+C, Ctrl+V, the other one is handled with the middle mouse button.
Re: Qt4/C++ - QClipboard - copy & paste to a terminal
Hello wysota,
Many thanks, works fine.
Just out of curiosity.
Quote:
Or is it possible to paste to the termimal programmatically?
Regards
Re: Qt4/C++ - QClipboard - copy & paste to a terminal
A terminal is a external application so you would need to send some system event to it.
Re: Qt4/C++ - QClipboard - copy & paste to a terminal
Hello wysota,
No problems, working fine.
A last question, should I clear the clipboard on program close or will it clear and free memory automatically?
Regards
Re: Qt4/C++ - QClipboard - copy & paste to a terminal
Clipboard belongs to the system. It is the one deciding what happens with its contents. If you want to clear it (e.g. because of sensitivity of the information or its scope) then you can of course do that if you want.