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. QGraphicsSimpleTextItem under Qt 5.0 no longer draws outline
Forum Updated to NodeBB v4.3 + New Features

QGraphicsSimpleTextItem under Qt 5.0 no longer draws outline

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.0k 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.
  • M Offline
    M Offline
    mickyj
    wrote on last edited by
    #1

    Hello all,

    I have a simple desktop app under Qt that started as a 4.8 project and has been ported to 5.0 however upon doing so the QGraphicsSimpleTextItem class now seems to function differently. I have searched to find references to this problem to no avail. It is a fairly vanilla example and I cannot see what I have done wrong. I am certain it will be painfully obvious when someone points out the error in my attempt. Many thanks in advance for any kind help you might offer and for your time. I include a code fragment for clarity.

    @
    this->activeText = new QGraphicsSimpleTextItem( this->text );
    if ( this->activeText != null )
    {
    this->font.setFamily( this->fontName );
    this->font.setPointSize( this->pointSize );
    this->activeText->setFont( this->font );
    if( tst( color ) )
    this->activeText->setBrush( QBrush( QColor( this->color ) ) );
    if( tst( generic ) )
    {
    QPen pen;
    if(tst(width))
    pen.setWidth( this->width );
    pen.setColor( this->generic );
    this->activeText->setPen( pen );
    }

            // preset all its parameters.
            SetUpParams( *this->activeText );
    
            // set the location to be displayed.
            if ( tst( startingLoc ) )
                {
                this->activeText->setPos( this->startingLoc );
                SnxScene->addItem( this->activeText );
                }
    
            // mark this event as completed
            mark( Completed );
            }
    

    @

    A few notes, all if's will evaluate to true and thus execute their clauses, and the end result is that the text will paint perfectly into the scene but it will not show an outline. I have not overridden the paint function. This yields red text and should have a black outline, but the outline is suppressed in 5.0, but it appears quite normally in 4.8. Yes I did single step through with the debugger and it appears to execute normally. Font changes and base color changes all work properly. ONLY the outline (QPen portion) seems to fail now. I have not reported this as a bug as I am fairly certain the bug is mine.....

    thanks again,
    mickyj

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mickyj
      wrote on last edited by
      #2

      Anyone have any thoughts on how I can solve this? Any changes I could make to help illuminate/identify the problem?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DivideByZer0
        wrote on last edited by
        #3

        I'm having this problem myself, using the same method in 5.0.0.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          atten
          wrote on last edited by
          #4

          I have the same problem in Qt 5.2.
          In Qt 4.8, it works fine.
          Is this issue already posted on bugtracker?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            atten
            wrote on last edited by
            #5

            Hooray, it seems that this issue is fixed in Qt 5.3.

            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