Ticket #12484: mythuishape_qt5_v1.patch

File mythuishape_qt5_v1.patch, 2.3 KB (added by Jim Stichnoth, 8 years ago)
  • mythtv/libs/libmythui/mythuishape.cpp

    diff --git a/mythtv/libs/libmythui/mythuishape.cpp b/mythtv/libs/libmythui/mythuishape.cpp
    index 6f9ccb4..39775b2 100644
    a b MythUIShape::MythUIShape(MythUIType *parent, const QString &name) 
    2626    m_linePen = QPen(Qt::NoPen);
    2727    m_cornerRadius = 10;
    2828    m_cropRect = MythRect(0, 0, 0, 0);
     29    m_parsedLine = false;
    2930}
    3031
    3132void MythUIShape::SetCropRect(int x, int y, int width, int height)
    bool MythUIShape::ParseElement( 
    130131        }
    131132        else
    132133            m_linePen.setStyle(Qt::NoPen);
     134        m_parsedLine = true;
    133135    }
    134136    else if (element.tagName() == "cornerradius")
    135137    {
    void MythUIShape::CopyFrom(MythUIType *base) 
    161163    m_linePen = shape->m_linePen;
    162164    m_cornerRadius = shape->m_cornerRadius;
    163165    m_cropRect = shape->m_cropRect;
     166    m_parsedLine = shape->m_parsedLine;
    164167
    165168    MythUIType::CopyFrom(base);
    166169}
    void MythUIShape::CreateCopy(MythUIType *parent) 
    173176    MythUIShape *shape = new MythUIShape(parent, objectName());
    174177    shape->CopyFrom(this);
    175178}
     179
     180/**
     181 *  \copydoc MythUIType::Finalize()
     182 */
     183void MythUIShape::Finalize(void)
     184{
     185    if (!m_parsedLine)
     186    {
     187        // If no <line> element was specified in the xml, explicitly set
     188        // the line pen, otherwise Qt5 steals one pixel all the way
     189        // around for an invisible border.
     190        m_linePen.setColor(m_fillBrush.color());
     191        m_linePen.setWidth(0);
     192        m_linePen.setStyle(Qt::SolidLine);
     193    }
     194    MythUIType::Finalize();
     195}
  • mythtv/libs/libmythui/mythuishape.h

    diff --git a/mythtv/libs/libmythui/mythuishape.h b/mythtv/libs/libmythui/mythuishape.h
    index 15c363f..df75417 100644
    a b class MUI_PUBLIC MythUIShape : public MythUIType 
    3636        const QString &filename, QDomElement &element, bool showWarnings);
    3737    virtual void CopyFrom(MythUIType *base);
    3838    virtual void CreateCopy(MythUIType *parent);
     39    virtual void Finalize(void);
    3940
    4041  private:
    4142    QString        m_type;
    class MUI_PUBLIC MythUIShape : public MythUIType 
    4344    QPen           m_linePen;
    4445    int            m_cornerRadius;
    4546    MythRect       m_cropRect;
     47    bool           m_parsedLine;
    4648
    4749    friend class MythUIProgressBar;
    4850    friend class MythUIEditBar;