October 15, 2010

HaykG HaykG
Lab Rat
12 posts

Drop down lists in QGraphicsWebView

 

Switching from QWebView to QGraphicsWebVIew the style of the combo box drop-down was lost. I was using the QCleanlooksStyle on my QWebView and when switched to QGraphicsWebVIew I’ve applied the same style to it. I see that the style works ok for most of the elements but the drop-down list doesn’t have the correct applied style. What is the problem with it?

Also if I’ve set the QGraphicsWebView::setResizesToContents(true), and in case if the combo-box is in the bottom of the viewport area of QGraphicsView (where the QGraphicsWebView is shown), it doesn’t popup in upper direction but it popus out to the bottom and most part of the combo box is not being visible. How can I solve this issue?

7 replies

October 15, 2010

Benjamin Poulain Benjamin Poulain
Lab Rat
153 posts
HaykG wrote:
Switching from QWebView to QGraphicsWebVIew the style of the combo box drop-down was lost. I was using the QCleanlooksStyle on my QWebView and when switched to QGraphicsWebVIew I've applied the same style to it. I see that the style works ok for most of the elements but the drop-down list doesn't have the correct applied style. What is the problem with it?

This sounds like a bug. Could you open a bug report and paste the number here?

HaykG wrote:
Also if I've set the QGraphicsWebView::setResizesToContents(true), and in case if the combo-box is in the bottom of the viewport area of QGraphicsView (where the QGraphicsWebView is shown), it doesn't popup in upper direction but it popus out to the bottom and most part of the combo box is not being visible. How can I solve this issue?

Could you give a test case? I am not sure to understand the problem.

If you are making an interface for a touch-screen device, you probably don’t want to use the combo box’s popup at all. We are making a platform plugin interface for those use cases, if you are interested to work with WebKit trunk, we would appreciate feedback of people experimenting with that.

October 17, 2010

HaykG HaykG
Lab Rat
12 posts

I’ve opened a bug, here is the url of it: http://bugreports.qt.nokia.com/browse/QTWEBKIT-290 [bugreports.qt.nokia.com]

[edit: fixed link / chetankjain]

October 17, 2010

Benjamin Poulain Benjamin Poulain
Lab Rat
153 posts
HaykG wrote:
I've opened a bug, here is the url of it: http://bugreports.qt.nokia.com/browse/QTWEBKIT-290.

WebKit’s bugs should be reported on bugs.webkit.org, not on the bug tracker of Qt. Here is a shortcut to report a bug: http://webkit.org/new-qtwebkit-bug [webkit.org]
Don’t forget to attach a test case, otherwise it is likely to be closed.

Sorry I did not mention it ealier, I thought you knew about that.

October 17, 2010

HaykG HaykG
Lab Rat
12 posts

Ok, i’ll submit the bug in the webkit.org.

For reproducing the second issue please follow the steps:

  • Build and launch the test-case (code is below)
  • Scroll down until you should see combo-boxes in the left bottom. Try to align these combo-boxes with the bottom of the GraphicsView.
  • Click on the combo-box to open it. You’ll see that it pop’s down (and therefore some part of it is not visible anymore). If you scroll down you’ll see the hidden part of the combo-box. The combo box should at least open up, because it should realize that it’s close to the bottom of the view. In the finger-friendly case, it should not completely expand (because it may be higher than the height of the GraphicsView and therefore not fit in any case). Depenting on QT styles used, it may have scrollbars in such cases, but for example when we use the QCleanlooks style then we don’t even see those scrollbars and it’s completely unusable for touch-screens.

  1. #include <QApplication>
  2. #include <QGraphicsScene>
  3. #include <QGraphicsView>
  4. #include <QGraphicsWebView>
  5. #include <QWebSettings>
  6. #include <QCleanlooksStyle>
  7.  
  8. int main(int argc, char **argv)
  9. {
  10.     QApplication app(argc, argv);
  11.     const int width = 640;
  12.     const int height = 480;
  13.     QGraphicsScene scene;
  14.     QGraphicsView view(&scene);
  15.     view.setFrameShape(QFrame::NoFrame);
  16.     QGraphicsWebView webview;
  17.     webview.setStyle(new QCleanlooksStyle());
  18.     webview.setResizesToContents(true);
  19.     webview.page()->setPreferredContentsSize(QSize(width, height));
  20.     webview.load(QUrl("http://www.google.de/language_tools?hl=de"));
  21.     scene.addItem(&webview);
  22.     view.resize(width, height);
  23.     view.show();
  24.     return app.exec();
  25. }

October 17, 2010

HaykG HaykG
Lab Rat
12 posts

Created the same bug in the webkit.org: https://bugs.webkit.org/show_bug.cgi?id=47778 [bugs.webkit.org]

October 17, 2010

HaykG HaykG
Lab Rat
12 posts

Also if possible could you please give some example/documentation of using that “platform plugin interface”, because it would be the ideal case for me:)

October 17, 2010

Benjamin Poulain Benjamin Poulain
Lab Rat
153 posts

HaykG wrote:
Created the same bug in the webkit.org: https://bugs.webkit.org/show_bug.cgi?id=47778 [bugs.webkit.org]

Please check the bug report, I asked you a question there. :)

HaykG wrote:
Also if possible could you please give some example/documentation of using that “platform plugin interface”, because it would be the ideal case for me:)

There is not doc yet, this is still a feature in development. The idea is that platforms could provide some very specific implementations of features. In the case of combobox for example, you typically don’t want them with touch interfaces, you want a fullscreen selection box for a better user interface (like on Maemo 5).

You’ll find the platform plugin interfaces here: http://gitorious.org/webkit/webkit/blobs/master/WebKit/qt/Api/qwebkitplatformplugin.h [gitorious.org]

 
  ‹‹ How can I disable selection property on Qwebview      Flash is working too slow using QGraphicsWebView ››

You must log in to post a reply. Not a member yet? Register here!