Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

TextField with InnerShadow effect sometimes renders completely black



  • Hi everyone!

    So I have this TextField QML object for users to input some text. I have this InnerShadow effect to help give the text field some depth (to make it look like it is inset in the frame) with this little chunk of code here:

                layer.effect: InnerShadow{
                    anchors.fill: text_edit
                    horizontalOffset: js_file.horizontal_offset
                    verticalOffset: js_file.vertical_offset
                    radius: js_file.radius
                    samples: js_file.samples
                    color: js_file.color
                    source: text_edit
                }
    

    The effect is within the TextField object in question, but I have narrowed it down to the above mentioned piece of code.

    js_file is a javascript file where I put a lot of my globally accessible items in and it is imported at the top of the QML document as:

    import "js_file.js" as js_file
    

    In the js_file.js the variables are...

    var horizontal_offset = 3.0;
    var vertical_offset = 3.0;
    var radius = 5.0;
    var samples = 10;
    var color = "#30000000";
    

    also here are the rest of my imports (not part of the js file that is imported, part of the main qml doc)...

    import QtQuick 2.5
    import QtQuick.Controls 1.4
    import QtQuick.Window 2.0
    import QtQuick.Controls.Styles 1.4
    import QtGraphicalEffects 1.0
    

    I would say the textfield object would render completely black about 10% of the time.
    I'm also accessing and testing this QML program via VNC connection from a VM as well in Linux (if that has any part of it).

    Is this some sort of OpenGL rendering issue with hardware/software? Or is it something to do with how the shading effect is being used?

    Some graphics information if it helps...

    bash-4.2$ glxinfo | grep -i vendor
    server glx vendor string: SGI
    client glx vendor string: Mesa Project and SGI
    OpenGL vendor string: VMware, Inc.
    

    and from qtdiag...

    Screens: 1, High DPI scaling: inactive
    # 0 "VNC-0" Depth: 24 Primary: yes
      Geometry: 1600x1200+0+0 Available: 1600x1173+0+27
      Physical size: 423x318 mm  Refresh: 60 Hz Power state: 0
      Physical DPI: 96.0757,95.8491 Logical DPI: 96,96 Subpixel_None
      DevicePixelRatio: 1 Pixel density: 1
      Primary orientation: 2 Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0
    
    LibGL Vendor: VMware, Inc.
    Renderer: Gallium 0.4 on llvmpipe (LLVM 3.9, 256 bits)
    Version: 2.1 Mesa 17.0.1
    Shading language: 1.30
    Format: Version: 2.1 Profile: 0 Swap behavior: 0 Buffer size (RGB): 8,8,8
    

    Any help on this situation would be greatly valued, I've been scouring the internet trying to find help regarding why this happens so inconsistently.


Log in to reply