Hi
I developped a window with lots of entry fields, so many that the whole thing doesnt fit onto my screen. So I thought one way out would be to create a scroll area and let the user scroll though this.
Trouble is, all my trials have come to nothing. I was hoping to have a minimal change
Here is the constructor for my window:
{
m_scrollArea
->setBackgroundRole
(QPalette::Light);
setCentralWidget(m_scrollArea);
this
->m_frame
= new QFrame(this);
m_scrollArea->setWidget(m_vLayout);
// add entry fields and labels to m_vLayout below.
}
MyWindow::MyWindow(QMainWindow *parent)
{
this->m_scrollArea = new QScrollArea;
m_scrollArea->setBackgroundRole(QPalette::Light);
setCentralWidget(m_scrollArea);
this->m_frame = new QFrame(this);
this->m_vLayout = new QVBoxLayout(m_frame);
m_scrollArea->setWidget(m_vLayout);
// add entry fields and labels to m_vLayout below.
}
To copy to clipboard, switch view to plain text mode
I have of course defined some fields called m_scrollArea, m_frame, etc of the types that you would guess.
When I display my window I just get one big blank area.
Please tell me if you want more detail.
I should add that my window derived from QDialog initially, and then I tried to derive it from QMainWindow in the above code.
Bookmarks