[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#445068: qabstractscrollarea setScrollBar bug



Hi,

After another look at the Bug I sent, I found out, that the real Problem lies 
in QAbstractScrollArea.
If the QAbstractScrollArea is hidden while the custom QScrollButton is 
inserted, the show() method of the QScrollButton must  be called to make it 
visible.

The attachment demonstrates the behavior
#include <QApplication>
#include <QScrollArea>
#include <QScrollBar>



int main(int argc, char **argv) {

	QApplication app(argc, argv);
	QScrollArea *flawed = new QScrollArea();
	flawed->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
	flawed->setWindowTitle("flawed");

	QScrollArea *correct = new QScrollArea();
	correct->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
	correct->setWindowTitle("correct");

// relevan start
	flawed->setVerticalScrollBar(new QScrollBar());
	flawed->show();
	correct->show();
	correct->setVerticalScrollBar(new QScrollBar());
// relevant end

	app.exec();

}

Reply to: