johan07
16th November 2015, 09:24
Hi,
i have QComboBox when i select item they send signal to an function to do something
liste = new QComboBox();
connect(liste , SIGNAL(currentIndexChanged(int)),this,SLOT(handleS electionChanged(int)));
void MainWindow::handleSelectionChanged(int i)
{
emit display(i);
connect(this, SIGNAL(display(int)),myapp, SLOT(display(int))) ;
connect(liste, SIGNAL(display(int)),myapp, SLOT(display(int))) ;
}
and that's work
in the other hand i have QSlider
m_slider = new QSlider(Qt::Horizontal, page_13);
m_slider->setGeometry(10, 60, 150, 20);
m_slider->setMinimum(0);
m_slider->setMaximum(5);
m_slider->setSingleStep(0.01);
connect(m_slider, SIGNAL(valueChanged(int)),mQOgreWidget, SLOT(display(int))) ;
i want change strategy , where when i select item from the QComboBox it does not send signal to display, but save the index of the item( save i)
and the QSlider send signal to another function that take into account the index i of the item and the value of the slider
is there somone have an idea how i do it ?
i have QComboBox when i select item they send signal to an function to do something
liste = new QComboBox();
connect(liste , SIGNAL(currentIndexChanged(int)),this,SLOT(handleS electionChanged(int)));
void MainWindow::handleSelectionChanged(int i)
{
emit display(i);
connect(this, SIGNAL(display(int)),myapp, SLOT(display(int))) ;
connect(liste, SIGNAL(display(int)),myapp, SLOT(display(int))) ;
}
and that's work
in the other hand i have QSlider
m_slider = new QSlider(Qt::Horizontal, page_13);
m_slider->setGeometry(10, 60, 150, 20);
m_slider->setMinimum(0);
m_slider->setMaximum(5);
m_slider->setSingleStep(0.01);
connect(m_slider, SIGNAL(valueChanged(int)),mQOgreWidget, SLOT(display(int))) ;
i want change strategy , where when i select item from the QComboBox it does not send signal to display, but save the index of the item( save i)
and the QSlider send signal to another function that take into account the index i of the item and the value of the slider
is there somone have an idea how i do it ?