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. Different behavior of QPaint Print Text in different machines.

Different behavior of QPaint Print Text in different machines.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 1 Posters 2.1k 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.
  • J Offline
    J Offline
    julio jerez
    wrote on last edited by
    #1

    The is my Main GlPaint function
    @void DemoEntityManager::paintEvent(QPaintEvent* ev)
    {
    newtonDemos* const mainWindow = (newtonDemos*) parent();

    makeCurrent();

    // do all 2d drawing
    glShadeModel(GL_FLAT);
    glDisable(GL_CULL_FACE);
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_LIGHTING);

    QPainter painter(this);
    painter.setPen(Qt::white);

    //This is correct on all OS
    Print (painter, 14, 14, "FPS: %6.2f", fps);

    // This is correct on Widnows 7, Linux and Mac but wrong on Windows64 (what is wrong?)
    Print (painter, 14, 30, "Physics time (ms): %6.3f", m_physicsTime * 1000.0f);

    painter.end();
    }@

    and this is the Print function
    @void DemoEntityManager::Print (QPainter& painter, int x, int y, const char *fmt, ... ) const
    {
    va_list argptr;
    char string[2048];

    va_start (argptr, fmt);
    vsprintf (string, fmt, argptr);
    va_end( argptr );

    painter.drawText(x, y, tr(string));
    }@

    This work fine on an Window 7, Linux and Mac
    whoever when I test it on a win64 system the statics text is all over the place on the screen.

    the funny thing is that If I only call Print once, the Text is printed correct,
    Am I doing something incorrect?

    edit:
    cleanup code to bare mimum tha reproduces the Bug on win64

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      hi julio, please also remove unnecessary code or commented out code from above code snip. easier for other readers to look at your code

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

        Ok I edited to the bare minumum that can reproduce the Bug.
        Sorry about that.


        EDIT: Also fixed spellings

        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