I have a problem. I've created a class, in which I have a slider and a label. I want to connect these with the QObject::connect, but when I do it, nothing happens. Can you tell me what am I doing wrong?
My class:
class Loads :public QObject
{
    Q_OBJECT
public:
    QSlider slider;
    QLabel label;
    QMainWindow okno;
    Loads();
private:
    int wart;
public slots:
    void zmiana(int li);
};
Class "Loads" constructor:
Loads::Loads()
{
    okno.setGeometry(300,300,300,300);
    label.setParent(&okno);
    slider.setParent(&okno);
    label.setGeometry(0,0,300,200);
    slider.setGeometry(0,200,300,100);
    slider.setMinimum(1);
    slider.setMaximum(30);
    label.setText("0");
    wart=0;
    QObject::connect(this, SIGNAL( slider.valueChanged(int)), this , SLOT( zmiana(int)) );
    okno.show();
}
My "zmiana" slot
void Loads::zmiana(int li)
{
        wart=li;
        label.setText(QString::number(li));
}
 
                        
I don't think that's correct, you're connecting the signal of the
Loadsobject to the slot but theLoadsobject is not the one generating the signal, thesliderobject is doing that.Hence I think you'll need
slideras the first argument, notthis. Usingthisas the third argument is okay, I believe, since the slot does belong to theLoadsobject.