Hi to all,
I'm able to attach a widget to a scrollarea. I would know if it's possible to attach more than one qwidget to the same scrollarea.
So when I move the scrollbar, both widgets should be moved.
I tried with this code:
/* scroll area */
sa->setWidgetResizable( true );
sa->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
sa->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
QScrollBar *scrollBar
= sa
->horizontalScrollBar
();
m_WaveDisplay = new WaveDisplay; //QWidget
m_TimeDisplay = new TimeWidget; //QWidget
sa->setWidget(m_TimeDisplay);
sa->setWidget(m_WaveDisplay);
layout->addWidget( sa );
..more code..
/* scroll area */
QScrollArea* sa = new QScrollArea( this );
sa->setWidgetResizable( true );
sa->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
sa->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
QScrollBar *scrollBar = sa->horizontalScrollBar();
m_WaveDisplay = new WaveDisplay; //QWidget
m_TimeDisplay = new TimeWidget; //QWidget
sa->setWidget(m_TimeDisplay);
sa->setWidget(m_WaveDisplay);
QVBoxLayout* layout = new QVBoxLayout();
layout->addWidget( sa );
..more code..
To copy to clipboard, switch view to plain text mode
but I get a crash when the application starts.
Maybe is not possible?
Best
Bookmarks