PDA

View Full Version : QwtDial and QwtKnob not sending position information



tmulrooney
17th December 2015, 21:50
I am new to Qt and Qwt so I apologize in advance for the simplicity of my question. I am using Qt 5

I created a QwtDial and QwtKnob and wanted to connect a signal to see the value change. I also created a QDial and did the same thing. the signals work correctly when I move the Qdial.

d_knob = new QwtKnob;
d_knob->setScale(0,20);
ui->knobVerticalLayout->addWidget(d_knob);

connect(d_knob, SIGNAL(d_knob->sliderMoved(double)), this, SLOT(testQwtDialSliderMoved(double)));

when I run I get the message:
QObject::connect: No such signal QwtKnob::d_knob->sliderMoved(double) in ..\qwt_test\mainwindow.cpp:51
QObject::connect: (receiver name: 'MainWindow')

I am sure I am missing something very simple. I am not getting a signal sent from QwtDial or QwtKnow but I am getting the signal from QDial.

in my header file:
public Q_SLOTS:
void testQDialSliderMoved(int value);
void testQwtDialSliderMoved(double value);


any help would be appreciated.

d_stranz
17th December 2015, 23:56
Wrong syntax for the connect() statement. Should be:


connect(d_knob, SIGNAL(sliderMoved(double)), this, SLOT(testQwtDialSliderMoved(double)));

and be sure to define "testQwtDialSliderMoved()" as a slot in your MainWindow class.

Please use CODE tags when posting code. Click "Go advanced" and then the "#" icon to insert the open/close tag pair. Paste your code between them.

tmulrooney
18th December 2015, 13:55
all worked perfectly. operator error. Thank you very much. Love Qt awesome!!!