I'm not able to reproduce your problem using Qt Designer. Could you post the ui file (or a small compilable application) here that would show what you mean?
I'm not able to reproduce your problem using Qt Designer. Could you post the ui file (or a small compilable application) here that would show what you mean?
I have attached a small example. It does work in the designer but once you actually make an app, it doesn't. It doesn't matter whether or not I put the text browser in the QScrollArea through designer or through code.
I can even reproduce it with a regular titlebar and no mouse events.
I have noticed the same behavior on windows and mac and I am using the latest 4.4.1.
Thanks.
Last edited by ntp; 15th August 2008 at 02:00.
Wait a minute. QTextBrowser is already scrollable. What's the point placing it inside a QScrollArea?
J-P Nurmi
I have lots of other custom widgets and a tab widget in the scroll area. The text widget is inside of the tab widget. The example that I gave you is just a minimized version of what I do to duplicate the problem.
I just substituted the following code in MainWidget.cpp to use a QLabel instead of QTextBrowser and I still see the problem:
Qt Code:
scrollArea_->setWidget(label); label->setText("1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n");To copy to clipboard, switch view to plain text mode
Turns out the culprit was the fact that I had:
Qt Code:
setStyleSheet("background-color: rgb(240,240, 240)");To copy to clipboard, switch view to plain text mode
in the mainDialog.cpp
This propagated to widgets that cannot be styled this way. In order to style the scrollbar, it looks like I am going to have to style each part of the scrollbar.
stylesheet description for scrollbar
I was hoping that I could set the color of my entire application in one call but it looks like I am going to have to be a little more detailed than that.
Bookmarks