Results 1 to 4 of 4

Thread: float a = textedit???

  1. #1
    Join Date
    Oct 2007
    Location
    Caracas - Venezuela
    Posts
    27
    Thanks
    6
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default float a = textedit???

    i have programmed in Builder 5 c++ And I want to migrate to qt, someone can say to me how :

    A = Form1->edit1->text.StrToInt(); or float or double.

    at c'll be something like scanf("%d" &A);

    also I would like being able to assign values to the vectors and "matrices" (excuse me I speak spanish) using xyz files (dat, txt, xls...etc).

    Excuse me again as I said, I use to be program at Builder 5 c++
    Colombo C. Da Encarnaçao Q.

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

    Default Re: float a = textedit???


  3. #3
    Join Date
    Oct 2007
    Location
    Caracas - Venezuela
    Posts
    27
    Thanks
    6
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: float a = textedit???

    OK. I tried thit. why doesn´t work

    figura.jpg

    error.txt
    Colombo C. Da Encarnaçao Q.

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

    Default Re: float a = textedit???

    Probably because the code I gave you is meant for Qt4 and you are using Qt3, despite of what the "Related to" info in this thread says. If you look at QString docs for Qt3, you'll find similar methods to convert the string to int or double.

    By the way, the code from the screenshot doesn't make sense. Make sure to read the docs of QLineEdit to see how to set a text in it.

Similar Threads

  1. How Do I Float a QToolBar?
    By dvmorris in forum Qt Programming
    Replies: 7
    Last Post: 29th April 2007, 19:01
  2. Make the cursor visible in textEdit (Qt3.3.5)
    By vermarajeev in forum Qt Programming
    Replies: 9
    Last Post: 24th January 2007, 22:50
  3. unable to save QCStrings properly in a buffer
    By nass in forum Qt Programming
    Replies: 13
    Last Post: 15th November 2006, 20:49
  4. float value to Qspinbox
    By nErnie in forum Qt Programming
    Replies: 6
    Last Post: 17th October 2006, 08:16
  5. visible text of textedit
    By regix in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2006, 09: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.