Results 1 to 2 of 2

Thread: Macro

  1. #1
    Join Date
    Jul 2007
    Posts
    8
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Macro

    hi there,
    pls teach me how to assign macro in qt4,

    let say i have the following data:

    num_1 = 500;
    num_2 = 340;
    num_3 = 300;
    num_4 = 600;
    num_5 = 700;

    then i want to trace each number (num_?) value using macro.
    last time when i use Foxpro to display number is like this:
    k = 1
    do while (k <=4)
    str = str(k)
    @10+k,5 say num_&str <--- using '&'
    enddo

    does qt4 has such macro methode..?

    thank for help.
    Regard
    comlink21

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Macro

    This doesn't actually have anything to do with Qt. Qt is just a C++ library. However, here's one way to do it in C++:
    Qt Code:
    1. int num[5];
    2. num[0] = 500;
    3. num[1] = 340;
    4. num[2] = 300;
    5. num[3] = 600;
    6. num[4] = 700;
    7.  
    8. for (int i = 0; i < 5; ++i)
    9. std::cout << num[i] << std::endl;
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. Qtopia core 4.2.2 cross compile make error
    By smiyai18 in forum Installation and Deployment
    Replies: 2
    Last Post: 28th August 2007, 17:04
  2. Macro used for debugging
    By sunil.thaha in forum General Programming
    Replies: 11
    Last Post: 30th March 2007, 17:32
  3. Q_OBJECT macro issue
    By kandalf in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2007, 19:28
  4. qDebug macro substitution
    By the_bis in forum Qt Programming
    Replies: 2
    Last Post: 15th November 2006, 08:31
  5. Q_EXPORT_PLUGIN2 proplem
    By high_flyer in forum Qt Programming
    Replies: 1
    Last Post: 2nd February 2006, 19:39

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.