Results 1 to 20 of 27

Thread: Coin3d + Qt: SIGLNALs and SLOTs

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Location
    Rakovnik, Czech Republic
    Posts
    175
    Thanks
    43
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Coin3d + Qt: SIGLNALs and SLOTs

    In my attempts last week to render a Coin3d scene in a Qt application, I used Qt's hellogl demo program as a template and modified it. The Coin scene renders nicely now, but I cannot get it to recognize Qt's signals & slots. My window.cpp file still contains this:

    Qt Code:
    1. connect(xSlider, SIGNAL(valueChanged(int)), coinWidget, SLOT(setXRotation(int)));
    2. connect(coinWidget, SIGNAL(xRotationChanged(int)), xSlider, SLOT(setValue(int)));
    To copy to clipboard, switch view to plain text mode 
    My CoinWidget constructor looks like this:

    Qt Code:
    1. CoinWidget::CoinWidget(QWidget *parent) : QMainWindow(parent)
    2. {
    3. SoQt::init(this);
    4.  
    5. SoSeparator *root = new SoSeparator;
    6. SoRotationXYZ *rootRot = new SoRotationXYZ;
    7. root->ref();
    8.  
    9. root->addChild(rootRot);
    10. root->addChild(new SoCone);
    11.  
    12. rootRot->angle=xRot;
    13.  
    14. SoQtExaminerViewer *eviewer = new SoQtExaminerViewer(this);
    15. eviewer->setDecoration(false);
    16. eviewer->setSceneGraph(root);
    17. eviewer->show();
    18.  
    19. }
    To copy to clipboard, switch view to plain text mode 

    ...such that the xRot variable *should* be modified by moving the slider (and thus cause my model to rotate), but it's not happening. I'm thinking that when using SoQt, there may be an additional step involved. Any suggestions?
    Last edited by wysota; 7th May 2007 at 15:05. Reason: missing [code] tags

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.