Results 1 to 5 of 5

Thread: Adequate treatment of signal from widget (float, float, float)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    22
    Qt products
    Qt4

    Default Adequate treatment of signal from widget (float, float, float)

    Dear all,

    For my first program, I am using the amazing MathGL library to paint graphs and trajectories. The incorporated QMathGL class is extended from QWidget, and I have added this to my MainWindow.

    It sends a signal void mouseClick(float,float,float). I am now capturing this signal from the QMathGL ui->qmgl with QWidget ui->vehicles_tab using
    Qt Code:
    1. connect(ui->qmgl, SIGNAL(mouseClick(float, float, float)), ui->vehicles_tab, SLOT(on_graph_clicked(float, float, float)));
    To copy to clipboard, switch view to plain text mode 
    But within the class definition of ui->vehicles_tab i have defined slot on_graph_clicked as
    Qt Code:
    1. void VehiclesTab::on_graph_clicked(float x,float y,float z)
    To copy to clipboard, switch view to plain text mode 
    in order to handle the value of the floats (x, y and z).

    This seems to work, but i still get the warning:
    QMetaObject::connectSlotsByName: No matching signal for on_graph_clicked(float,float,float)

    What am I doing wrong?

    Thank you in advance!

  2. #2
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Adequate treatment of signal from widget (float, float, float)

    Actually, if you're getting that message it's not working -- the connect() isn't happening. ALWAYS test (eq, with an assert) the result of a connect to make sure it succeeds.

    Are you sure your slot is declared as a slot?

Similar Threads

  1. float display
    By freekill in forum Newbie
    Replies: 2
    Last Post: 13th May 2009, 12:43
  2. Replies: 1
    Last Post: 10th February 2009, 09:42
  3. float a = textedit???
    By Colx007 in forum Qt Programming
    Replies: 3
    Last Post: 10th October 2007, 17:25
  4. How Do I Float a QToolBar?
    By dvmorris in forum Qt Programming
    Replies: 7
    Last Post: 29th April 2007, 19:01
  5. float
    By mickey in forum General Programming
    Replies: 5
    Last Post: 25th July 2006, 11:52

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.