Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-32420

HTML Form Control States Rendered Incorrectly with Windows Vista and XP application style

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.4.2
    • 5.1.0
    • GUI: Look'n'Feel

    Description

      After I apply the patch from https://bugreports.qt-project.org/browse/QTBUG-31376, there are still more problems regarding the rendering of html controls. Here is a test page: http://www.slimbrowser.net/testpages/testform.htm . In this page, the checkbox appears not checked even after a mouse click. If I hover the mouse on the checkbox, the radio button becomes checked instead. When I hover the mouse on the radio button and then move the mouse button away, it looks like a stretched radio buttom bitmap is drawn in the background on the first edit box in the same form. I am using the Windows Vista style on Windows 7 for this test.

      I did some tracing myself here. It appears there is problem with the code inside this function in qwindowsvistastyle.cpp.

      void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option,QPainter *painter, const QWidget *widget) const

      There seems to be issues related to the transition animation drawing. Even if there is no state change, the oldState and state are never the same. Look at the following code within this function:

      int oldState = styleObject->property("_q_stylestate").toInt();
      oldRect = styleObject->property("_q_stylerect").toRect();
      newRect = option->rect;
      styleObject->setProperty("_q_stylestate", (int)option->state);
      styleObject->setProperty("_q_stylerect", option->rect);

      As far as I can see from this code, the oldState should be overwritten by the new state after retrieving the old state value. However, the next time the code hits here, the oldState returned from styleObject property value is still the old one. It seems like at some other place the property value is messed up.

      If I disable the transition animation by setting the boolean value doTransition to always false, the rendering is ok for Windows vista style.

      What is more, if I switch to the Windows XP style, the edit box is rendered without border.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            elproxy Pierre Rossi
            stephench Stephen Cheng
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes