I can't find a way to get the scroll bar to work with QFrame. My class is derived from QFrame and I display a couple of images within it. I want to add a scrollbar as soon as the images gets to many. I tried a lot of examples without success for my particular design
Monitors
::Monitors(QWidget *parent
){
for (int i = 0; i < 4; i++)
{
paint.begin(&pic);
paint.drawPixmap(225, 162, pic);
paint.end();
MonitorIcon->setPixmap(pic);
if (i < 2)
MonitorIcon->move(20 + (i * 100), 20);
else
MonitorIcon->move(20 + ((i -2) * 100), 20 + 100);
MonitorIcon->show();
MonitorIcon->setAttribute(Qt::WA_DeleteOnClose);
}
}
Monitors::Monitors(QWidget *parent)
: QFrame(parent)
{
for (int i = 0; i < 4; i++)
{
QLabel *MonitorIcon = new QLabel(this);
QPixmap pic = QPixmap("C:/DevelopmentWork/TestFrame/test.png");
QPainter paint;
paint.begin(&pic);
paint.drawPixmap(225, 162, pic);
paint.end();
MonitorIcon->setPixmap(pic);
if (i < 2)
MonitorIcon->move(20 + (i * 100), 20);
else
MonitorIcon->move(20 + ((i -2) * 100), 20 + 100);
MonitorIcon->show();
MonitorIcon->setAttribute(Qt::WA_DeleteOnClose);
}
}
To copy to clipboard, switch view to plain text mode
The following example doesn't work on my class either http://discussion.forum.nokia.com/fo...-Bar-in-QFrame
Bookmarks