Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED] Wierd looking text in TableView section in Qt 5.1.0 Beta
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 3 Posters 4.4k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    riaank
    wrote on last edited by
    #1

    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."

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jens
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • R Offline
          R Offline
          riaank
          wrote on last edited by
          #4

          @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

          1 Reply Last reply
          0
          • R Offline
            R Offline
            riaank
            wrote on last edited by
            #5

            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!

            1 Reply Last reply
            0
            • T Offline
              T Offline
              toby520
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • R Offline
                R Offline
                riaank
                wrote on last edited by
                #7

                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.

                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