kachofool
27th December 2010, 03:33
Hi!
I'm unable to get QFrame to take on a particular size, or even default to the size of its parent widget. Instead, QFrame becomes a tiny rectangle, and I don't know how the size of the frame is decided. I've tried creating QFrame without specifying dimensions (in which case I thought that QFrame would take on the dimensions of the parent widget), and also by explicitly specifying a QRect. Both result in the same thing; a tiny QFrame in the widget.
SeriesViewer::SeriesViewer(QWidget *parent) :
QWidget(parent)
{
this->setFixedSize(420,420);
_imageFrame = new QFrame(this);
_imageFrame->setFrameShape(QFrame::Panel);
_imageFrame->setLineWidth(5);
repaint();
}
OR
SeriesViewer::SeriesViewer(QWidget *parent) :
QWidget(parent)
{
this->setFixedSize(420,420);
_imageFrame = new QFrame(QRect(0,0,250,250));
_imageFrame->setFrameShape(QFrame::Panel);
_imageFrame->setLineWidth(5);
repaint();
}
Output is the same:
http://img440.imageshack.us/img440/2806/screenshotvjv.png
Could anyone tell me where I'm going wrong?
Regards,
KF
I'm unable to get QFrame to take on a particular size, or even default to the size of its parent widget. Instead, QFrame becomes a tiny rectangle, and I don't know how the size of the frame is decided. I've tried creating QFrame without specifying dimensions (in which case I thought that QFrame would take on the dimensions of the parent widget), and also by explicitly specifying a QRect. Both result in the same thing; a tiny QFrame in the widget.
SeriesViewer::SeriesViewer(QWidget *parent) :
QWidget(parent)
{
this->setFixedSize(420,420);
_imageFrame = new QFrame(this);
_imageFrame->setFrameShape(QFrame::Panel);
_imageFrame->setLineWidth(5);
repaint();
}
OR
SeriesViewer::SeriesViewer(QWidget *parent) :
QWidget(parent)
{
this->setFixedSize(420,420);
_imageFrame = new QFrame(QRect(0,0,250,250));
_imageFrame->setFrameShape(QFrame::Panel);
_imageFrame->setLineWidth(5);
repaint();
}
Output is the same:
http://img440.imageshack.us/img440/2806/screenshotvjv.png
Could anyone tell me where I'm going wrong?
Regards,
KF