Results 1 to 4 of 4

Thread: QTable gives error when put on a dialog??

  1. #1
    Join Date
    Mar 2006
    Posts
    47
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default QTable gives error when put on a dialog??

    Hi,
    I am trying to make a new project using QT 3.3.5 Designer. My requirement is to take
    a table on a dialog. But when i take a table widget on a dialog and I do nothing with
    table and compile the project it gives errors


    Following are the errors at compile time:

    c++ -c -pipe -Wall -W -Os -DQT_NO_DEBUG -DQT_SHARED -
    DQT_ACCESSIBILITY_SUPPORT -DQT_TABLET_SUPPORT -I/Developer/qt/mkspecs/
    default -I. -I. -I/Developer/qt/include -o form1.o form1.cpp
    form1.cpp: In constructor `Form1::Form1(QWidget*, const char*, bool, unsigned
    int)':
    form1.cpp:32: error: invalid use of undefined type `struct QTable'
    form1.h:20: error: forward declaration of `struct QTable'
    form1.cpp:33: error: `numCols' undeclared (first use this function)
    form1.cpp:33: error: (Each undeclared identifier is reported only once for each
    function it appears in.)
    form1.cpp:33: error: `setNumCols' undeclared (first use this function)
    form1.cpp:34: error: `horizontalHeader' undeclared (first use this function)
    form1.cpp:37: error: `setGeometry' undeclared (first use this function)
    form1.cpp:38: error: `setNumRows' undeclared (first use this function)
    form1.cpp: In member function `virtual void Form1::languageChange()':
    form1.cpp:60: error: `horizontalHeader' undeclared (first use this function)
    make: *** [form1.o] Error 1

    Same errors get when i make a new project on QT 3.3.6 and take a dailog containg a
    table on it.

    When i delete the table and compile the project it compiles error free.


    Please help me by giving example of table. What should i have to do?


    Thanks and Regards

  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: QTable gives error when put on a dialog??

    Qt Code:
    1. #include <qtable.h>
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. #3
    Join Date
    Mar 2006
    Posts
    47
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QTable gives error when put on a dialog??

    I had done nothing in my project , I only take a qtable widget on a dialog.
    I am attaching my project , Plz check table.zip.


    Thanks and Regards
    Attached Files Attached Files

  4. #4
    Join Date
    Mar 2006
    Location
    Mexico City
    Posts
    31
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTable gives error when put on a dialog??

    Hi, darpan

    I think I know what's going on. In your project there are two versions of form1.h.

    One is in dir .ui, the other in the main directory. The one in the .ui directory do not have the line:
    #include <qtable.h>

    but file form1.h in main directory, include's qtable.h.

    Maybe the way you are compiling your projet is using the one without the <qtable.h> include. I can't check this because i'm ussing Qt 3.3.4, and this version generates files with qtable.h included automatically.

    But if I modify all source files that include qtable.h and run make without running qmake, I get an error similar to the one you get:

    g++ -c -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -g -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -g -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_THREAD_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -o form1.o form1.cpp
    form1.cpp: In constructor `Form1::Form1(QWidget*, const char*, bool, unsigned int)':
    form1.cpp:33: error: invalid use of undefined type `struct QTable'
    form1.h:21: error: forward declaration of `struct QTable'
    form1.cpp:34: error: `setGeometry' undeclared (first use this function)
    form1.cpp:34: error: (Each undeclared identifier is reported only once for each function it appears in.)
    form1.cpp:35: error: `setNumRows' undeclared (first use this function)
    form1.cpp:36: error: `setNumCols' undeclared (first use this function)
    make: *** [form1.o] Error 1

    I hope this can be of some help.

Similar Threads

  1. Replies: 3
    Last Post: 23rd July 2006, 18:02
  2. Show/hide part of dialog with resizing.
    By Spockmeat in forum Qt Tools
    Replies: 6
    Last Post: 7th June 2006, 08:22
  3. Dialog positioning in GNOME
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2006, 09:41
  4. QTable..Vs.. QListView
    By :db:sStrong in forum Qt Programming
    Replies: 1
    Last Post: 15th February 2006, 21:03
  5. Shape-changing dialog with qt4.1
    By moe in forum Qt Tools
    Replies: 3
    Last Post: 2nd February 2006, 10:12

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.