PDA

View Full Version : Problem connect: No such signal QSlider::sliderMove()



nanusefue
4th March 2010, 10:56
I new in qt and i have this problem, any solucion for this and use form extencion .ui
thanks.




#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<iostream>

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
std::cout<<"Valor de la x"<<std::endl;
connect(ui->X, SIGNAL(sliderMove()),this, SLOT(on_X_sliderMoved(int)));
}

MainWindow::~MainWindow()
{
delete ui;
}

void MainWindow::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}

void MainWindow::on_X_sliderMoved(int position)
{
position++;
std::cout<<"Valor de la x"<<position<<std::endl;
}

BalaQT
4th March 2010, 11:12
The correct signal should be
sliderMoved() not sliderMove()

pls change the SIGNAL part

hope it helps

Bala

nanusefue
4th March 2010, 11:24
i change but the error is the same thanks....

nanusefue
4th March 2010, 11:30
the problem is solve only i fogget put in the sliderModed(int)


connect(ui->X, SIGNAL(sliderMoved(int)),this, SLOT(on_X_sliderMoved(int)));

Lykurg
4th March 2010, 11:44
connect(ui->X, SIGNAL(sliderMoved(int)),this, SLOT(on_X_sliderMoved(int)));

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.