Results 1 to 5 of 5

Thread: problem about renderText

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default problem about renderText

    hi:

    I used two qglwidget in my mainwindow. And I invoked renderText in both of the qglwidget. But in one of the qglwidget, I just cannot change the color of text. Could you please help me?

    Code like below:

    Qt Code:
    1. void VARDrawer::DrawLabel()
    2. {
    3. setting->ValidateLabels();
    4. glLineWidth(1.2f);
    5. glColor4f(1.0f,0.0f,0.0f,1.0f);:confused:Do not work here
    6.  
    7. map<int,TextureSetting*>::iterator mi;
    8. for (mi = setting->varMap.begin();
    9. mi != setting->varMap.end() ; mi++)
    10. {
    11. TextureSetting* texSetting = mi->second;
    12. if (texSetting->isDrawLabel)
    13. {
    14.  
    15. QString label(texSetting->srcDim->GetDimensionName().c_str());
    16. Vec3 pos = Vec3(texSetting->blockPos.X,
    17. texSetting->blockPos.Y+texSetting->VisSize.height+0.02f,
    18. 0.0f);
    19.  
    20. renderText(pos.X, pos.Y,0.0f,
    21. texSetting->srcDim->GetDimensionName().c_str());
    22.  
    23. }
    24. }
    25. }
    26. void PareCoordDrawer::DrawAxisLabel(void)
    27. {
    28. setting->ValidateAxisLabel(dataSet);
    29. glLineWidth(1.2f);
    30. qglColor(Qt::red);
    31. QVector<float>::iterator qli;
    32. QList<string>::iterator qsli;
    33. for (qli = setting->axisPos.begin(), qsli = setting->labelList.begin();
    34. qli != setting->axisPos.end(); qli++, qsli++)
    35. {
    36. float pos = *qli;
    37. string dimName = *qsli;
    38. renderText(pos, 1.05f, 0.0f, dimName.c_str());:o Every thing just fine here
    39. }
    40. }
    To copy to clipboard, switch view to plain text mode 


    Thanks,
    zhang
    Last edited by wysota; 19th September 2007 at 10:51. Reason: missing [code] tags

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. QGLWidget renderText problem
    By mbjerkne in forum Qt Programming
    Replies: 1
    Last Post: 7th April 2006, 21:35
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.