Results 1 to 5 of 5

Thread: connect failed, slot not found

  1. #1
    Join Date
    May 2015
    Posts
    42
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default connect failed, slot not found

    Hallo everybody,

    please have a look:


    I subclassed "QAreaSeries" to "myQAreaSeries". No I want to connect a selfdesigned slot to some signal emitted by a chart on mainWindow. Somehow Qt tells me:

    Qt Code:
    1. QObject::connect: No such slot QtCharts::QAreaSeries::setTextPosition(QRectF)
    To copy to clipboard, switch view to plain text mode 


    And here's some wrap up:

    Qt Code:
    1. QT_CHARTS_USE_NAMESPACE
    2.  
    3. namespace Ui {
    4. class myQAreaSeries;
    5. }
    6.  
    7. class myQAreaSeries : public QAreaSeries
    8. {
    9.  
    10. public:
    11. // some member
    12.  
    13. private slots:
    14.  
    15. // here it is:
    16. void setTextPosition(QRectF rect);
    17.  
    18.  
    19. private:
    20.  
    21. // some member
    22. };
    To copy to clipboard, switch view to plain text mode 

    The implementation:

    Qt Code:
    1. #include "myqareaseries.h"
    2.  
    3. myQAreaSeries::myQAreaSeries(qreal in, qreal out , int track, QChartView *Chartview){
    4.  
    5.  
    6. // here it even offers me the setTextPosition-SLOT, which it later doesn't find
    7. connect(chartview->chart(), SIGNAL(plotAreaChanged(QRectF)), this, SLOT(setTextPosition(QRectF)));
    8. }
    9.  
    10.  
    11.  
    12. void myQAreaSeries::setTextPosition(QRectF rect){
    13.  
    14. // some action
    15. }
    To copy to clipboard, switch view to plain text mode 

    Most likely I missed something at school.
    Thanks in advance for your replies.

    Lars

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: connect failed, slot not found

    Hi,

    Qt Code:
    1. class myQAreaSeries : public QAreaSeries
    2. {
    3. Q_OBJECT
    4. ...
    5. ...
    6. ...
    7. };
    To copy to clipboard, switch view to plain text mode 
    Òscar Llarch i Galán

  3. #3
    Join Date
    May 2015
    Posts
    42
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: connect failed, slot not found

    Oh my, what do I have to pay you, to not to make this public :-) Cost' me half a day.
    After all I got a 'undefined reference to 'vtable' error. Had to refresh my qmake. Now it works.

    Thanks a million, Lars

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: connect failed, slot not found

    When the invoice from the forum arrives in your Inbox, just pay it. Don't argue, don't make noise, just pay it...
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: connect failed, slot not found

    Oh my, what do I have to pay you, to not to make this public :-)
    Only one smile. ;-)

    When the invoice from the forum arrives in your Inbox, just pay it. Don't argue, don't make noise, just pay it...
    50% for me and 50% for you? ;-)

    Have a nice day
    Òscar Llarch i Galán

Similar Threads

  1. connect to rest service with qt and error SSL handshake failed
    By panagiotisss in forum Qt Programming
    Replies: 5
    Last Post: 24th September 2015, 10:56
  2. Replies: 4
    Last Post: 5th December 2011, 18:54
  3. Replies: 6
    Last Post: 25th November 2010, 22:02
  4. Replies: 3
    Last Post: 8th August 2010, 11:53
  5. Qt Designer & Qt4, connect to my own slot.
    By geitosten in forum Newbie
    Replies: 2
    Last Post: 17th February 2007, 20:22

Tags for this Thread

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.