Results 1 to 6 of 6

Thread: Object::connect: Parentheses expected, slot...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Object::connect: Parentheses expected, slot...

    I am trying to connect a QSpinBox to a slot:

    Qt Code:
    1. connect(Layer_spinBox, SIGNAL(valueChanged(int)),this, SLOT(setLayer(int)));
    2.  
    3. void
    4. JDFWindow::setLayer(int lyr)
    5. {
    6. active_layer_number = lyr;
    7. redraw();
    8. }
    To copy to clipboard, switch view to plain text mode 

    and

    Qt Code:
    1. class JDFWindow : public QWidget, public Ui::JDFView
    2. {
    3. Q_OBJECT
    4. public:
    5. JDFWindow( QWidget * parent = 0, Qt::WFlags f = 0 );
    6. ~JDFWindow();
    7. void redraw();
    8.  
    9.  
    10. signals:
    11. void valueChanged(int);
    12. private slots:
    13. void setLayer(int);
    14.  
    15. private:
    16.  
    17. protected:
    18. QRectF screct;
    19. myQGraphicsScene *scene;
    20. JOB *Job;
    21. int active_layer_number;
    22. };
    To copy to clipboard, switch view to plain text mode 

    I get this strange message from the console:
    Object::connect: Parentheses expected, slot JDFWindow::
    Object::connect: (sender name: 'Layer_spinBox')
    Object::connect: (receiver name: 'JDFView')
    The slot works, I get the correct value form the QSpinBox, but the context of the JDFWindow object is lost when setLayer() is entered , the content of my object "Job" is garbage when enter the slot, while it was ok before I triggered the QSpinBox..

    The console message tells me soething is wrong with my syntax, but I cannot figure out what.

    Can someone enlighten me?
    Last edited by bnilsson; 2nd April 2008 at 22:06.
    MacOSX user dabbling with Linux and Windows.

Similar Threads

  1. Replies: 21
    Last Post: 5th January 2008, 15:44
  2. Need help integrating sigc++ with a KDE3/Qt3 app
    By Valheru in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2007, 15:39
  3. Replies: 2
    Last Post: 8th October 2007, 15:02
  4. Program crashes (SIGSEGV)
    By Voldemort in forum Qt Programming
    Replies: 47
    Last Post: 21st May 2007, 20:09

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.