Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [BUG] Scroll bar erases border set with Qt style sheets
QtWS25 Last Chance

[BUG] Scroll bar erases border set with Qt style sheets

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 5.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chernetsov0
    wrote on last edited by
    #1

    Actually it seems more like a bug but maybe I just do something wrong.
    Here is the code:
    @#include <QtGui/QApplication>
    #include <QtGui/QPlainTextEdit>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);

    QPlainTextEdit e;
    e.setStyleSheet("QPlainTextEdit { border: 1px solid palette(dark); }");
    

    // e.setStyleSheet("border: 1px solid palette(dark)"); works with same effect
    e.show();

    return a.exec&#40;&#41;;
    

    }@

    If you try to resize window or let it loose focus you will see this (as seen on Windows 7):
    <br>
    !http://img835.imageshack.us/img835/8707/scrollbarissue1.png(Yep, it's erased, I mean border.)!

    Do I need to change my code or file a bug report?

    UPDATE: looks like it's a bug. "Link to bug report":https://bugreports.qt.nokia.com/browse/QTBUG-20672

    Programmer is an organism that can turn caffeine into code.

    1 Reply Last reply
    0
    • E Offline
      E Offline
      evergreen
      wrote on last edited by
      #2

      That doesn't seem clear to me.
      Could you explain what you expect to see and what is wrong in the picture?

      1 Reply Last reply
      0
      • EddyE Offline
        EddyE Offline
        Eddy
        wrote on last edited by
        #3

        At first sight I tought it had something to do with the paint "coordinate system":http://developer.qt.nokia.com/doc/qt-4.7/coordsys.html#id-51ea41fc-6e51-44fe-9059-0d49988c6b35.

        But then I tried your code with 10px and the part of the borderline under the scrollbar becomes white. Also if you do that with other border widths you get the same. I'm not sure what can cause this. Altering the height of the window up and down on the twilight zone where a scrollbar is needed or not shows the scrollbar is responsible for this painting of the border.

        Please, file a bug report on this on the "bug tracker":https://bugreports.qt.nokia.com.

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        0
        • C Offline
          C Offline
          chernetsov0
          wrote on last edited by
          #4

          You know, I'm amazed. I first found this in Qt 4.6 but I thought it was my fault, cause nobody on the internet reported that.

          Will be done in no time.

          Programmer is an organism that can turn caffeine into code.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            chernetsov0
            wrote on last edited by
            #5

            [quote author="evergreen" date="1312183435"]That doesn't seem clear to me.
            Could you explain what you expect to see and what is wrong in the picture?[/quote]

            I expected to see border under the scrollbar to be of palette(dark) color but not white.
            Even if I try to get screenshot for expected state, window looses it's focus, and... You've got the idea.

            Programmer is an organism that can turn caffeine into code.

            1 Reply Last reply
            0
            • EddyE Offline
              EddyE Offline
              Eddy
              wrote on last edited by
              #6

              [quote author="chernetsov0" date="1312200874"]You know, I'm amazed. I first found this in Qt 4.6 but I thought it was my fault, cause nobody on the internet reported that.

              Will be done in no time.[/quote]

              That's because you need the eyes of an eagle to see it.

              Could you put the link to the bugreport page here? Also, If you add a link to this topic in the bug report, it wil be easier for the developers to understand the issue.

              Thanks

              Qt Certified Specialist
              www.edalsolutions.be

              1 Reply Last reply
              0
              • C Offline
                C Offline
                chernetsov0
                wrote on last edited by
                #7

                [quote author="Eddy" date="1312209416"]
                That's because you need the eyes of an eagle to see it.
                [/quote]

                It was kind of obvious for me. When you messing around with widget styles this is kind of issues you are looking for, right?

                "Link to bug report":https://bugreports.qt.nokia.com/browse/QTBUG-20672

                Programmer is an organism that can turn caffeine into code.

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  brad_e
                  wrote on last edited by
                  #8

                  Not sure if you've figured this out but you should be able to fix this by changing the frameShape setting of the widget. For example, for QPlainTextEdit make sure the frameShape is set to "NoFrame" and then you can use this styling:
                  @
                  QPlainTextEdit
                  {
                  border: 2px solid #c0c0c0;
                  border-radius: 8px;
                  padding:2px;
                  }
                  @
                  If you leave frameShape as "StyledPanel" the scrollbar overlaps the border for some reason.

                  [Edit: Added @ tags around code; mlong]

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    brad_e
                    wrote on last edited by
                    #9

                    Never mind, it doesn't seem to work all the time.

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved