Results 1 to 2 of 2

Thread: How can I invoke the member funcions of QTableViewPrivate?

  1. #1
    Join Date
    Feb 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question How can I invoke the member funcions of QTableViewPrivate?

    Hi
    I want to inherit QTableView and invoke some QTableViewPrivate member functions.

    .h file
    Qt Code:
    1. #include <QTableView>
    2. #include <QTableView>
    3. class SpreadsheetPrivate;
    4. class Spreadsheet : public QTableView
    5. {
    6. Q_OBJECT
    7. public:
    8. Spreadsheet();
    9. void test();
    10. protected:
    11. private:
    12. Q_DECLARE_PRIVATE(Spreadsheet)
    13. };
    To copy to clipboard, switch view to plain text mode 
    .cpp file
    Qt Code:
    1. #include <QtGui>
    2. #include <private/qtableview_p.h>
    3. #include "Spreadsheet.h"
    4. class SpreadsheetPrivate: public QTableViewPrivate
    5. {
    6. };
    7. Spreadsheet::Spreadsheet()
    8. {
    9. }
    10. void Spreadsheet::test()
    11. {
    12. Q_D(Spreadsheet);
    13. //The problem come here
    14. }
    To copy to clipboard, switch view to plain text mode 

    The Problem is that when I use fields or inline functions of QTableViewPrivate,it works fine.When I try to invoke the member functions(not inline functions) of QTableViewPrivate,I can compile the code,however,it will show a error while linking like this:
    undefined reference to 'QTableViewPrivate::xxxxx'
    Can anyone tell me what's wrong with it?How can I do to invoke the member functions of QTableViewPrivate?
    thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    5
    Thanked 86 Times in 81 Posts

    Default Re: How can I invoke the member funcions of QTableViewPrivate?

    IMHO the problem is conceptual. you cannot use xxxPrivate members.

    When you installs Qt the <*_p.h> includes are not available
    A camel can go 14 days without drink,
    I can't!!!

Similar Threads

  1. Invoke UI functions from a different thread ?
    By umanga in forum Qt Programming
    Replies: 4
    Last Post: 27th May 2010, 07:44
  2. When and where to invoke QAbstractItemView::setIndexWidge?
    By mallun.wang in forum Qt Programming
    Replies: 1
    Last Post: 3rd December 2009, 09:48
  3. Can we invoke other lang. scripts through QT
    By yogeshkarpate in forum Newbie
    Replies: 1
    Last Post: 14th August 2009, 10:43
  4. How to invoke a running application
    By srikanthch in forum Qt Programming
    Replies: 2
    Last Post: 18th December 2008, 15:42
  5. Replies: 22
    Last Post: 8th October 2008, 13:54

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.