Results 1 to 4 of 4

Thread: bb

  1. #1
    Join Date
    Feb 2014
    Posts
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Windows

    Default bb

    how to compare text entered in textfield with text returned from value() of QSettings?? I am using cascades

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: bb

    Both classes use QString, so as simple as using the QString operators or functions.

    Cheers,
    _

  3. #3
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: bb

    The value-method returns a QVariant. To convert it to a QString (which can be compared with another QString using the ==-operator or the compare-method of the QString class), just use the toString-method of the returned QVariant object.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: bb

    The text() method returns the text as a QString already.

    Cheers,
    _

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.