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
) :{
this->setFixedSize(420,420);
_imageFrame
= new QFrame(this);
_imageFrame
->setFrameShape
(QFrame::Panel);
_imageFrame->setLineWidth(5);
repaint();
}
SeriesViewer::SeriesViewer(QWidget *parent) :
QWidget(parent)
{
this->setFixedSize(420,420);
_imageFrame = new QFrame(this);
_imageFrame->setFrameShape(QFrame::Panel);
_imageFrame->setLineWidth(5);
repaint();
}
To copy to clipboard, switch view to plain text mode
OR
SeriesViewer
::SeriesViewer(QWidget *parent
) :{
this->setFixedSize(420,420);
_imageFrame
->setFrameShape
(QFrame::Panel);
_imageFrame->setLineWidth(5);
repaint();
}
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();
}
To copy to clipboard, switch view to plain text mode
Output is the same:
Could anyone tell me where I'm going wrong?
Regards,
KF
Bookmarks