Results 1 to 20 of 29

Thread: General lineEdit, converting problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default General lineEdit, converting problem

    Hi. I've got a problem. I've got a piece of code:
    Qt Code:
    1. if (ui.beaufortBox->isChecked() && ui.knotBox_2->isChecked())
    2. {
    3. QString current = ui.fromLineEdit->text();
    4. int converted = current.toInt();
    5.  
    6. if (converted == 0)
    7. {
    8. ui.whiteLabel->setText("0-1");
    9. }
    10. }
    To copy to clipboard, switch view to plain text mode 
    program's contents you already know from my previous posts, but this is a new thing in it. The problem is, that when I select beaufortBox and knotBox_2 and click next step, type 0 to fromLineEdit, and click convert(which is connected to function where this code is) whiteLabel's text isn't set to 0-1. Why? Regards
    edit:
    but the problem isn't about value, i added
    Qt Code:
    1. else
    2. {
    3. ui.whiteLabel->setText("other");
    4. }
    To copy to clipboard, switch view to plain text mode 
    and still without result.
    Last edited by Salazaar; 15th June 2007 at 21:36.

Similar Threads

  1. Problem in converting QString to QChar array?
    By KaKa in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2007, 00:38
  2. problem converting string-char-int
    By mickey in forum General Programming
    Replies: 1
    Last Post: 9th December 2006, 23:43
  3. Problem converting .ui files from Qt3 to 4
    By Amanda in forum Qt Programming
    Replies: 6
    Last Post: 28th October 2006, 04:34
  4. general sqlplugin problem
    By a550ee in forum Installation and Deployment
    Replies: 5
    Last Post: 28th February 2006, 10:03
  5. Replies: 10
    Last Post: 1st February 2006, 10:08

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.