Qscrollbar doesn’t show scroll bar on Qlabel
I have to display a scrollable label, it contains some help text so it is bigger than the height of the screen, so i use scroll area to display that label. I have been able to scroll the label in C7 device but when i run it on E72 then the scroll bar doesn’t scroll.
Following is my code
- QWidget* window = new QWidget;
- QScrollArea* scr = new QScrollArea;
I will be really thankful if some one give me even any hint regarding that.
Only widgets derived from QAbstractScrollArea (or custom widgets that do this differently) provide a scrollbar. QLabel is not one of these.
You have two options:
- Use another widget as suggested by ludde above. You can also considder QTextBrowser for this task.
- Use a QScrollArea, and put a QLabel inside. Now, your label can grow as big as you need it to be. You probably should give it a maximum width though (and sync that with the maximum width of the scroll area itself), to prevent the scrolling to become horizontal instead of vertical.
I just read the QT document http://www.developer.nokia.com/Distribute/Packaging_and_signing.xhtml. As per this document E72 is not supported in QT 4.7 and above. Do you think this could be the issue ?? Should i target E series devices with QT 4.7 or leave it ?
E72 is S60 3rd Edition device (FP2 to be exact). Latest Qt SDK is not intended for “old” S60 devices. But 4.7.x should still work there, you just might not target that device with your app through Ovi store.
I am still fairly certain that the above issue is due to focus getting lost in the non-touch device.