Results 1 to 20 of 22

Thread: Problems with setCentralWidget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #13
    Join Date
    Feb 2008
    Posts
    28
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1

    Default Re: Problems with setCentralWidget

    If you include QT in the Factory you loose the whole point
    the point is to separate QT GUI from the program's logic
    WidgetView is not a QWidget, but QTTextEdit which inherited from it IS
    so I can.
    this is strange, as the same code is working perfectly under Windows

    I wrote a simplified program that show the problem:
    Qt Code:
    1. #include <QtGui>
    2.  
    3. class CompView {
    4. public:
    5. virtual ~CompView() {}
    6. virtual void eli() = 0;
    7. };
    8.  
    9. class Comp : public QTextEdit, public CompView {
    10. public:
    11. void eli() {}
    12. };
    13.  
    14. int main(int argc, char *argv[]) {
    15. QApplication app(argc, argv);
    16. CompView* c = new Comp;
    17. mw.setCentralWidget((QWidget*)c);
    18. mw.show();
    19. return app.exec();
    20. }
    To copy to clipboard, switch view to plain text mode 

    when I run this I also get segmentation fault
    Last edited by Rockem; 8th March 2008 at 19:22.

Similar Threads

  1. Replies: 2
    Last Post: 8th March 2007, 22:22
  2. Utf8 problems
    By cristiano in forum Qt Programming
    Replies: 5
    Last Post: 11th November 2006, 00:14
  3. Problems building mysql plugin for Qt 4.1.2 on windows XP
    By Philip_Anselmo in forum Installation and Deployment
    Replies: 3
    Last Post: 17th May 2006, 15:38
  4. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39
  5. [Win32/VC++ 8.0] Strange problems with qrc_*.cpp files
    By mloskot in forum Installation and Deployment
    Replies: 6
    Last Post: 6th March 2006, 10:28

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.