[SOLVED] Wierd looking text in TableView section in Qt 5.1.0 Beta



  • The text of the sections in a tableview are not rendered correctly. (It is the same sort of effect with text running the "Scene Graph - OpenGL Under QML" example.)
    Here is a screenshot od the TableView problem
    !https://dl.dropboxusercontent.com/u/15626803/CaptureQmlBug1.PNG!

    My code is simple:
    @import QtQuick 2.0
    import QtQuick.Controls 1.0
    import QtQuick.Window 2.0

    ApplicationWindow {
    width: 640
    height: 480

    Component {
        id: sectionDel
        Rectangle {
            height: childrenRect.height
            width: mainTable.width
            color: "lightsteelblue"
            Text {
                x: 20
                text: section
                font.bold: true
            }
        }
    }
    
    ListModel {
       id: libraryModel
       ListElement{ title: "A Masterpiece" ; author: "Gabriel"; cat: "big" }
       ListElement{ title: "Outstanding"   ; author: "Frederik"; cat: "big" }
       ListElement{ title: "Brilliance"    ; author: "Jens"; cat: "small" }
    }
    TableView {
       id: mainTable
       TableViewColumn{ role: "title"  ; title: "Title" ; width: 100 }
       TableViewColumn{ role: "author" ; title: "Author" ; width: 200 }
       model: libraryModel
       section.property: "cat"
       section.criteria: ViewSection.FullString
       section.delegate: sectionDel
    }
    

    }
    @

    I am using windows 7 Enterprise 32bit
    My opengl version according to "OpenGL Extensions Viewer" is 2.0.

    I get the following warnings/errors when running the QML project:
    Starting C:\Qt\Qt5.1.0\5.1.0-beta1\mingw47_32\bin\qmlscene.exe D:/prototypes/QuickWithControlsTest/QuickWithControlsTest.qml
    getProcAddress: Unable to resolve 'glGenFramebuffers'
    getProcAddress: Unable to resolve 'glGenFramebuffersOES'
    getProcAddress: Unable to resolve 'glGenFramebuffersARB'
    getProcAddress: Unable to resolve 'glBindFramebuffer'
    getProcAddress: Unable to resolve 'glBindFramebufferOES'
    getProcAddress: Unable to resolve 'glBindFramebufferARB'
    getProcAddress: Unable to resolve 'glFramebufferTexture2D'
    getProcAddress: Unable to resolve 'glFramebufferTexture2DOES'
    getProcAddress: Unable to resolve 'glFramebufferTexture2DARB'
    QOpenGLShader::link: "No errors."
    getProcAddress: Unable to resolve 'glFramebufferRenderbuffer'
    getProcAddress: Unable to resolve 'glFramebufferRenderbufferOES'
    getProcAddress: Unable to resolve 'glFramebufferRenderbufferARB'
    QOpenGLShader::link: "No errors."
    QOpenGLShader::link: "No errors."
    QOpenGLShader::link: "No errors."
    QOpenGLShader::link: "No errors."



  • I can confirm that this code works fine on mac so it does imply that there might be a rendering issue. Are you using the plain windows (angle based) package or the (-opengl). If you are not sure, just paste the file name.



  • As a workaround, try adding renderType: Text.NativeRendering to the text item.



  • @Jens I am not sure what you mean by the plain windows package or the opengl package. Which filename are you reffering to. If it is the whole sdk installer I donwloaded "qt-windows-opensource-5.1.0-beta1-mingw47_opengl-x86-offline.exe".?

    I am not able to try the Text.NativeRendering at the moment, I am away from my computer with Qt5.1 on. I will give it a try as soon as I can



  • The NativeRendering solves the text rendering problem.
    I tried the same program on a different machine and the text renders properly, without having to use NativeRendering. The machine on which it works is also win 7.
    I have read up on NativeRendering and understand the it uses the native renderer (as opposed to distance field text) to make the text more crisp. Is there perhaps a bug with the "distance field text" rendering mechanism or graphics driver/card that could produce the "spots" shown below. (It is the same example with bigger text to highlight the problem):
    !https://dl.dropboxusercontent.com/u/15626803/CaptureQmlRender.PNG!



  • hi riaank ,i has the same problem in my computer about win 7 32bit,has happen when i run qt demo,can you help me?i am chinese so my english is very poor.



  • Unfortunaltey I do not get a real solution to the problem, but I found setting "renderType: Text.NativeRendering" of text that renders wierd to use solved my immediate problem. There are some disadvantages to this when the text is animated in any way. The blog post explains it in more detail: "Native-looking text in QML 2":http://blog.qt.digia.com/blog/2012/08/08/native-looking-text-in-qml-2/

    Below is how I changed my text to display properly:
    @
    Text {
    id: ta
    x: 20
    text: section
    renderType: Text.NativeRendering // Added this
    }
    @

    Hope that helps.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.