Results 1 to 7 of 7

Thread: My first app not working

  1. #1
    Join Date
    Jan 2010
    Location
    tamil nadu,thanjavur
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default My first app not working

    HEllo people,
    I am following the book of qt4-the art of building qt applications..the below problem is of a byte converter ..but there is a logical error ...please help me rectify it...files uploaded.
    Thanks
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My first app not working

    What kind of logical error?

  3. #3
    Join Date
    Jan 2010
    Location
    tamil nadu,thanjavur
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My first app not working

    You just try to run the program...you yourselves will find it..there is some problem with the code....but i cant figure it out.........

  4. #4
    Join Date
    Aug 2009
    Location
    Greece, Chania
    Posts
    63
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: My first app not working

    Your problem lies in the constructor in 47-49 lines

    Qt Code:
    1. connect(decEdit, SIGNAL(textChanged(const QString&)),this, SLOT(decChanged(const QString&)));
    2. connect(hexEdit, SIGNAL(textChanged(const QString&)),this, SLOT(hexChanged(const QString&)));
    3. connect(binEdit, SIGNAL(textChanged(const QString&)),this, SLOT(binChanged(const QString&)));
    To copy to clipboard, switch view to plain text mode 

    Replace with these:

    Qt Code:
    1. connect(decEdit, SIGNAL(textEdited(const QString&)),this, SLOT(decChanged(const QString&)));
    2. connect(hexEdit, SIGNAL(textEdited(const QString&)),this, SLOT(hexChanged(const QString&)));
    3. connect(binEdit, SIGNAL(textEdited(const QString&)),this, SLOT(binChanged(const QString&)));
    To copy to clipboard, switch view to plain text mode 

    The difference is the signal that the lineEdit emits.
    textEdit(...) isn't emitted when you call setText(), but textChanged(...) does. So your problem was everytime
    you setText() in your class's slots the textChanged(...) signal was called again and again...
    Misha R.evolution - High level Debugging IDE

    Programming is about 2 basic principles: KISS and RTFM!!!

  5. The following user says thank you to Archimedes for this useful post:

    Noks (2nd February 2010)

  6. #5
    Join Date
    Jan 2010
    Location
    tamil nadu,thanjavur
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My first app not working

    By The Way ...where is the option to delete posts...i am not able to see it
    Thanks
    Last edited by Noks; 2nd February 2010 at 16:15.

  7. #6
    Join Date
    Jan 2010
    Location
    tamil nadu,thanjavur
    Posts
    18
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My first app not working

    Well thanks,
    It started working....But could you please provide some more details.....i am a noob with Line edits.,.....basically what is textchanged and texedited?
    Thanks

  8. #7
    Join Date
    Aug 2009
    Location
    Greece, Chania
    Posts
    63
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: My first app not working

    A very detailed description of QLineEdit is here http://doc.qt.nokia.com/4.6/qlineedit.html
    Misha R.evolution - High level Debugging IDE

    Programming is about 2 basic principles: KISS and RTFM!!!

Similar Threads

  1. Working with QObject
    By been_1990 in forum Qt Programming
    Replies: 15
    Last Post: 20th June 2009, 21:12
  2. working with SQLite
    By bhs-ittech in forum Qt Programming
    Replies: 3
    Last Post: 15th September 2008, 07:51
  3. working with images
    By kernel_panic in forum Qt Programming
    Replies: 1
    Last Post: 13th January 2007, 18:35
  4. QPalette isn't working
    By roleroz in forum Qt Programming
    Replies: 5
    Last Post: 19th October 2006, 20:15
  5. Mac OS X UI not working
    By hvengel in forum Qt Programming
    Replies: 3
    Last Post: 1st April 2006, 01:02

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.