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

Thread: What is wrong with my code?

  1. #21
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: What is wrong with my code?

    can you show us how you call this method? please, provide relevant code.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  2. #22
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What is wrong with my code?

    with having :
    Qt Code:
    1. #include <QtGui>
    2. #include <cmath>
    3. #include "Calc++.h"
    4.  
    5. using namespace std;
    To copy to clipboard, switch view to plain text mode 
    at the top
    Qt Code:
    1. else if (operation.contains("sqrt"))
    2. if(m_op1<0){
    3. lineEdit->setAlignment(Qt::AlignLeft);
    4. lineEdit->setText("Sqrt accepts just positive numbers.");
    5. }
    6. else lineEdit->setText(QString::number(sqrt(m_op1)));
    7. else if (operation.contains("sin"))
    8. lineEdit->setText(QString::number(sin(m_op1)));
    9. else if (operation.contains("cos"))
    10. lineEdit->setText(QString::number(cos(m_op1)));
    11. else if (operation.contains("tan"))
    12. lineEdit->setText(QString::number(tan(m_op1)));
    To copy to clipboard, switch view to plain text mode 
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  3. #23
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: What is wrong with my code?

    I don't see any problem. it should work fine.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  4. #24
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What is wrong with my code?

    So what should i do?
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  5. #25
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: What is wrong with my code?

    try to rebuild all project, make make clean, qmake, make.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  6. #26
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What is wrong with my code?

    No result!
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  7. #27
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: What is wrong with my code?

    ok, attach you sources again.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  8. #28
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What is wrong with my code?

    Hey we have a proverb that says
    a shot in darkness
    that means doing sth not very wise when you have no hope.well i did the same.
    I added "std::" before those functions and i understood that there is no difference whether or not you write the line "using namespace std;" and you know,It worked.
    thanks all of you
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

Similar Threads

  1. copyright and gpl
    By janus in forum General Discussion
    Replies: 8
    Last Post: 21st October 2008, 01:13
  2. Qt 4.3.0 lots of Bugs!
    By VireX in forum Qt Programming
    Replies: 69
    Last Post: 20th June 2007, 22:05
  3. Pasting code from code tag in emacs
    By Gopala Krishna in forum General Discussion
    Replies: 0
    Last Post: 16th February 2007, 05:47
  4. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15

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.