Results 1 to 3 of 3

Thread: Are there C/C++ commands which don't work with Qt?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    46
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Are there C/C++ commands which don't work with Qt?

    This is either a very silly mistake which is staring me in the face,
    or something weird...


    in maze.h:

    class MazeField : public QWidget {

    Q_OBJECT
    public:
    MazeField( QWidget *parent=0, const char *name=0 );

    QSizePolicy sizePolicy() const;

    (...)
    int ** Log;
    void MazeField::intialiseLog();
    (...)
    };


    in maze.cpp:

    int NUMBER_OF_COLUMNS = 4;
    int NUMBER_OF_ROWS = 10;

    (...)

    // Used at initialisation
    void MazeField::intialiseLog() {
    Log = (int **) calloc ((NUMBER_OF_COLUMNS + 1), sizeof(int *));
    for (int col = 0; col < NUMBER_OF_COLUMNS; col++) {
    Log[col] = (int *) calloc ((NUMBER_OF_ROWS + 2), sizeof(int));
    }
    Log[0][0] = 3;
    Log[0][5] = 5;
    for (int row = 0; row < NUMBER_OF_ROWS; row++) {
    for (int col = 1; col < NUMBER_OF_COLUMNS; col++) {
    cout << Log[col][row];
    }
    cout << endl;
    }
    exit(0);
    }

    It outputs :

    000
    000
    000
    000
    000
    000
    000
    000
    000
    000

    And I've been unable to make it output any number except zeros...

    Mariane
    Last edited by Mariane; 30th January 2006 at 22:24. Reason: The indentation disappeared (tabs)

Similar Threads

  1. Qt4 : QPainter::setRedirected doesn't work
    By Ankitha Varsha in forum Qt Programming
    Replies: 2
    Last Post: 20th June 2008, 17:52
  2. QActions don't work with menubar hidden
    By Pepe in forum Qt Programming
    Replies: 1
    Last Post: 16th August 2007, 01:04
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  4. Change work area OS
    By pakulo in forum Qt Programming
    Replies: 15
    Last Post: 15th May 2007, 07:20
  5. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23

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.