Results 1 to 7 of 7

Thread: Please help me to understand the Code !

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    74
    Thanks
    31
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Please help me to understand the Code !

    Hello! Everybody,
    I started to unuderstand the codings in simple_plot example wherein i tried to understand simple.cpp code but had few problems. Those are: -

    1.) In this code: -
    Qt Code:
    1. public:
    2. SimpleData(double(*y)(double), size_t size):
    3. d_size(size),
    4. d_y(y)
    5. {
    6. }
    To copy to clipboard, switch view to plain text mode 
    Here i came to know that its a constructor with 2 variables, d_size & d_y are declared globally. But main point is i didn't understand " double(*y)(double) " declaration. Also is size_t a new variable introduced in Qwt, if yes what are its limitations?

    2.) In this code: -
    Qt Code:
    1. Const int nPoints=100;
    2. cSin->setData(SimpleData(::sin, nPoints));
    3. cCos->setData(SimpleData(::cos, nPoints));
    To copy to clipboard, switch view to plain text mode 
    Here i came to know that nPoints is an int variable with value=100. Also following 2 lines are setting data for those 2 curves. But main point is what type of arguments are sent here like "::sin" "::cos"& which subroutine is called to set the data actually?

    Can anyone please help me out in understanding them.----> I will be obliged.

    Thanks in Advance.
    Last edited by Krish; 22nd February 2008 at 10:58.

Similar Threads

  1. Qt 4.3.0 lots of Bugs!
    By VireX in forum Qt Programming
    Replies: 69
    Last Post: 20th June 2007, 22:05
  2. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  3. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49
  4. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41

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.