Page 2 of 2 FirstFirst 12
Results 21 to 29 of 29

Thread: General lineEdit, converting problem

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

    Default Re: General lineEdit, converting problem

    Quote Originally Posted by jacek View Post
    Right. Now use qDebug() to see what do the both isChecked() calls return.
    How can I do it? Where to place qDebug()?

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: General lineEdit, converting problem

    Quote Originally Posted by Salazaar View Post
    How can I do it?
    I'm sure you'll find an example here.

    Quote Originally Posted by Salazaar View Post
    Where to place qDebug()?
    In a place that will allow you to see the output and at the same time will guarantee that the return values are the same as the ones used in the if statement.

  3. #23
    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: General lineEdit, converting problem

    Quote Originally Posted by Salazaar View Post
    Yes, it contains only 0 character. But even if not, it should set whiteLabel to "none" text. Here's the screenshot:
    http://allyoucanupload.webshots.com/...41797424490087
    The screenshot is useless. I asked you to select all the contents or better yet just add the following to your code:

    Qt Code:
    1. qDebug() << "Line edit value:" << ui.fromLineEdit->text();
    To copy to clipboard, switch view to plain text mode 

  4. #24
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: General lineEdit, converting problem

    I reached: Line edit value: "0" But doing that doesn't make sense, my problem is that
    Qt Code:
    1. if (ui.beaufortBox->isChecked() && ui.knotBox_2->isChecked())
    To copy to clipboard, switch view to plain text mode 
    doesn't return true (of course I selected this radiobuttons before) and I don't know why. In my code after user selects radiobuttons, all radiobuttons are
    Qt Code:
    1. ->setCheckable(false)
    To copy to clipboard, switch view to plain text mode 
    But the real mistery is when user selected two checkboxes (ui.beaufortBox and ui.knotBox_2) and clicked next step button, it sets up labels correctly (which means that this radiobuttons are checked) and after they are set to checkable(false) if clause with
    Qt Code:
    1. if (ui.beaufortBox->isChecked() && ui.knotBox_2->isChecked())
    To copy to clipboard, switch view to plain text mode 
    doesn't return true. Regards

  5. #25
    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: General lineEdit, converting problem

    Are both buttons checked? Radio buttons are by default mutual exclusive...

  6. #26
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: General lineEdit, converting problem

    Yes, they are both checked, they are in two different groupBoxes. But before setting it to setCheckable(false) the same if clause but in different function returned true!! Strange, isn't it? Regards

  7. #27
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: General lineEdit, converting problem

    I've got it now! I deleted setCheckable(false) and it works. It means, that setCheckable(false) deletes current checked status.

  8. #28
    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: General lineEdit, converting problem

    If you change the buttons not to be checkable then no wonder they are not checked... If you want to prevent the user from changing their value, use QWidget::setDisabled() instead.

  9. #29
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: General lineEdit, converting problem

    Marcel told me, that it saves checked() value... However, problem solved

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.