Hi to all,
I would display a little image at the left of a QSlider. The slider change the volume of a song and instead of put the text Volume: near the slider
I would display a little icon representing the volume so the user can know the meaning of the slider.
I would layout orizontally the icon and the slider so:
QPixmap panPixmap
(":/images/pan.png");
panPixmap.scaled(5,5);
m_panPixmap->setPixmap(panPixmap);
m_panSlider
= new QSlider(Qt
::Horizontal);
m_panSlider->setMinimum( -100 );
m_panSlider->setMaximum( 100 );
m_panSlider->setValue( 0 );
panLayout.addWidget(m_panPixmap);
panLayout.addWidget(m_panSlider);
m_panPixmap = new QLabel;
QPixmap panPixmap(":/images/pan.png");
panPixmap.scaled(5,5);
m_panPixmap->setPixmap(panPixmap);
m_panSlider = new QSlider(Qt::Horizontal);
m_panSlider->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
m_panSlider->setMinimum( -100 );
m_panSlider->setMaximum( 100 );
m_panSlider->setValue( 0 );
QVBoxLayout panLayout;
panLayout.addWidget(m_panPixmap);
panLayout.addWidget(m_panSlider);
To copy to clipboard, switch view to plain text mode
and then add to the main vertical layout
vl->setSpacing(20);
vl->addLayout(ll);
vl->addStretch(1);
vl->addLayout(&panLayout); //<-- this is the pan layout
..more code
QVBoxLayout* vl = new QVBoxLayout();
vl->setSpacing(20);
vl->addLayout(ll);
vl->addStretch(1);
vl->addLayout(&panLayout); //<-- this is the pan layout
..more code
To copy to clipboard, switch view to plain text mode
My problem is that the image is displayed too big and it break the layout. The image and the slider are not displayed correctly.
How can I solve my problem?
Best Regards,
Franco
Bookmarks