Results 1 to 6 of 6

Thread: Qt Problem

  1. #1
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt Problem

    Hello guys,

    I want to know how to run shell commands within Qt. This is my first application:

    I want to find a File using file name and file location. But how can I do that? I try to do this:
    Qt Code:
    1. void Dialog::on_lineEdit_textEdited(QString )
    2. {
    3.  
    4. }
    5.  
    6. void Dialog::on_lineEdit_2_textEdited(QString )
    7. {
    8.  
    9. }
    10.  
    11. void Dialog::on_pushButton_clicked()
    12. {
    13. QString strText = QString("find ./%1 -name \'%2\' | zenity --text-info --title \'Find Files\'").arg(lineEdit.text()).arg(lineEdit_2.text());
    14. }
    To copy to clipboard, switch view to plain text mode 
    But it doesn't work:
    Qt Code:
    1. /home/tonto/Desktop/FindFiles/dialog.cpp:22: error: ‘lineEdit’ was not declared in this scope
    2. /home/tonto/Desktop/FindFiles/dialog.cpp:22: error: ‘lineEdit_2’ was not declared in this scope
    To copy to clipboard, switch view to plain text mode 
    So, can anyone help me? Thanks.

    PS: I use Ubuntu Linux.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Problem

    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.

  3. #3
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt Problem

    @aamer4yu
    No, lineEdit is not a member variable of Dialog class. Please help me, I don't know what to do!

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Problem

    what is the lineEdit member of then ? You need to properly access it through its holder / creator

  5. #5
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt Problem

    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/36641421...es.tar.gz.html

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Problem

    Is it a school assignment of some kind?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.