[Help] With Qt

Posts 1–6 of 6 · Page 1 of 1
[Help] With Qt
Main :
Code:
#include <QApplication>
#include "MaFenetre.h"


int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    MaFenetre fenetre;
    fenetre.show();

    return app.exec();
}
*.h

Code:
#ifndef MAFENETRE_H_INCLUDED
#define MAFENETRE_H_INCLUDED

#include <QApplication>
#include <QWidget>
#include <QPushButton>
#include <QSlider>
#include <QProgressBar>

class MaFenetre : public QWidget
{
    public:
    MaFenetre();

    private:
    QProgressBar *m_bar;
    QSlider *m_slider;
};



#endif
*.cpp

Code:
#include "MaFenetre.h"

MaFenetre::MaFenetre() : QWidget()
{
    setFixedSize(200, 100);

    m_bar = new QProgressBar(this);
    m_bar->setGeometry(10, 20, 150, 20);

    m_slider = new QSlider(Qt::Horizontal, this);
    m_slider->setGeometry(10, 60, 150, 20);

    QObject::connect(m_slider, SIGNAL(valueChanged(int)), m_bar, SLOT(display(int)));
    QObject::connect(m_bar, SIGNAL(valueChanged(int)), m_slider, SLOT(setValue(int)));

}
Here is my question :

I want that when i move the slider, the value of the Progress Bar follow the slider.... But I don't find how. Plz HELP
good luck getting help, nobody uses qt.
Quote Originally Posted by Kallisti View Post
good luck getting help, nobody uses qt.
...Seriously now? A lot of people use Qt.
Quote Originally Posted by -Raz0r- View Post
...Seriously now? A lot of people use Qt.
i meant on mpgh.
/request close i found how.

Code:
    QObject::connect(m_slider, SIGNAL(valueChanged(int)), m_bar, SLOT(setValue(int)));
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us