Results 1 to 5 of 5

Thread: Problem connect: No such signal QSlider::sliderMove()

  1. #1
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Problem connect: No such signal QSlider::sliderMove()

    I new in qt and i have this problem, any solucion for this and use form extencion .ui
    thanks.


    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3. #include<iostream>
    4.  
    5. MainWindow::MainWindow(QWidget *parent) :
    6. QMainWindow(parent),
    7. ui(new Ui::MainWindow)
    8. {
    9. ui->setupUi(this);
    10. std::cout<<"Valor de la x"<<std::endl;
    11. connect(ui->X, SIGNAL(sliderMove()),this, SLOT(on_X_sliderMoved(int)));
    12. }
    13.  
    14. MainWindow::~MainWindow()
    15. {
    16. delete ui;
    17. }
    18.  
    19. void MainWindow::changeEvent(QEvent *e)
    20. {
    21. QMainWindow::changeEvent(e);
    22. switch (e->type()) {
    23. case QEvent::LanguageChange:
    24. ui->retranslateUi(this);
    25. break;
    26. default:
    27. break;
    28. }
    29. }
    30.  
    31. void MainWindow::on_X_sliderMoved(int position)
    32. {
    33. position++;
    34. std::cout<<"Valor de la x"<<position<<std::endl;
    35. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem connect: No such signal QSlider::sliderMove()

    The correct signal should be
    sliderMoved() not sliderMove()

    pls change the SIGNAL part

    hope it helps

    Bala

  3. #3
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem connect: No such signal QSlider::sliderMove()

    i change but the error is the same thanks....

  4. #4
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem connect: No such signal QSlider::sliderMove()

    the problem is solve only i fogget put in the sliderModed(int)
    Qt Code:
    1. connect(ui->X, SIGNAL(sliderMoved(int)),this, SLOT(on_X_sliderMoved(int)));
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Problem connect: No such signal QSlider::sliderMove()

    Quote Originally Posted by nanusefue View Post
    Qt Code:
    1. connect(ui->X, SIGNAL(sliderMoved(int)),this, SLOT(on_X_sliderMoved(int)));
    To copy to clipboard, switch view to plain text mode 
    With that code, your slot will be triggered two times! Qt does that connection for you. So there is no need to do it manually.

Similar Threads

  1. Replies: 2
    Last Post: 6th July 2009, 13:53
  2. A signal/slot connect isn't working.
    By Daimonie in forum Qt Programming
    Replies: 6
    Last Post: 15th February 2009, 23:55
  3. QObject::connect: No such signal
    By caseyong in forum Qt Programming
    Replies: 5
    Last Post: 19th February 2008, 08:23
  4. can i connect a signal to a signal
    By amit_pansuria in forum Qt Programming
    Replies: 1
    Last Post: 29th August 2007, 07: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.