PDA

View Full Version : Qt Problem



NewFolder
21st March 2010, 23:01
Hello guys,

I want to know how to run shell commands within Qt. This is my first application:
http://i44.tinypic.com/ejy7ig.png
I want to find a File using file name and file location. But how can I do that? I try to do this:

void Dialog::on_lineEdit_textEdited(QString )
{

}

void Dialog::on_lineEdit_2_textEdited(QString )
{

}

void Dialog::on_pushButton_clicked()
{
QString strText = QString("find ./%1 -name \'%2\' | zenity --text-info --title \'Find Files\'").arg(lineEdit.text()).arg(lineEdit_2.text());
}

But it doesn't work:

/home/tonto/Desktop/FindFiles/dialog.cpp:22: error: ‘lineEdit’ was not declared in this scope
/home/tonto/Desktop/FindFiles/dialog.cpp:22: error: ‘lineEdit_2’ was not declared in this scope
So, can anyone help me? Thanks.

PS: I use Ubuntu Linux.

aamer4yu
22nd March 2010, 04:34
As far as your lineedit error goes, is lineEdit a member variable of Dialog class ? May be you have some ui member variable and you need to do something like ui->lineEdit. :rolleyes:

NewFolder
22nd March 2010, 08:46
@aamer4yu
No, lineEdit is not a member variable of Dialog class. Please help me, I don't know what to do!

aamer4yu
22nd March 2010, 08:53
what is the lineEdit member of then ? You need to properly access it through its holder / creator

NewFolder
22nd March 2010, 09:00
I'm not sure, but I think lineEdit is a member of Dialog class.
So, what can I do?

Download source: http://rapidshare.com/files/366414212/FindFiles.tar.gz.html

wysota
22nd March 2010, 10:58
Is it a school assignment of some kind?