open a picture for editing
Hi,
I need to implement this-
When I click on the 'Edit photo' button,the photo currently displayed on top of QLabel 'Picture' is opened for editing in 'KolourPaint' (a paint application in Linux).I believe I will have to use 'QProcess' for it.Could someone please give me some idea of how to write the code?
Thanks in advance.
update(using Qt 4.4.3,Linux)
I got the image viewer to open(using 'gthumb Image Viewer) but now,the question is 'How do I get the 'pic' on top of the QLabel to be displayed by default when the editor opens.' I can't think of how to proceed.
The code till now is as follows.(I copied the gthumb exe in the folder which contains my .cpp,.h and .pro files for the Qt program)
Code:
void ImageViewer::edit()
{
proc->start("./gthumb");
}
please advice.
:) got the expected result
Hi,
got the code to work and am getting desired result.Was pretty simple :o
Am pasting the working code below.
Code:
void ImageViewer::edit() //added by avishek
{
arguments<<fileName; //fileName is the path to the pic which is to be opened
//for editing(displayed on a QLabel)
proc->start("./gthumb",arguments); //./gthumb--> the graphics program I am
//using to edit the pic
}
Re: open a picture for editing
Here's a minor improvement for you:
Code:
connect(proc,
SIGNAL(finished
(int,
QProcess::ExitStatus)), proc,
SLOT(deleteLater
()));
There is no need to keep the QProcess instance in memory once the process has finished, right?
Re: open a picture for editing
yup,you are right.Thanks :)
Re: open a picture for editing
Here's a minor improvement for you:
Code:
connect(proc,
SIGNAL(finished
(int,
QProcess::ExitStatus)), proc,
SLOT(deleteLater
()));
There is no need to keep the QProcess instance in memory once the process has finished, right?