~ubuntu-branches/ubuntu/lucid/mythtv/lucid

« back to all changes in this revision

Viewing changes to libs/libmythui/mythpainter_qt.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello
  • Date: 2009-09-29 01:33:23 UTC
  • mto: This revision was merged to the branch mainline in revision 94.
  • Revision ID: james.westby@ubuntu.com-20090929013323-e6d2b5bzpg4t3t3x
Tags: upstream-0.22.0~trunk22101
ImportĀ upstreamĀ versionĀ 0.22.0~trunk22101

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <cassert>
2
 
#include <iostream>
 
1
 
 
2
// QT headers
3
3
#include <QPainter>
4
4
#include <QPixmap>
5
5
 
 
6
// MythUI headers
6
7
#include "mythpainter_qt.h"
7
8
#include "mythfontproperties.h"
8
9
#include "mythmainwindow.h"
 
10
 
 
11
// MythDB headers
9
12
#include "compat.h"
 
13
#include "mythverbose.h"
10
14
 
11
15
class MythQtImage : public MythImage
12
16
{
40
44
 
41
45
void MythQtPainter::Begin(QWidget *parent)
42
46
{
43
 
    assert(parent);
 
47
    if (!parent)
 
48
    {
 
49
        VERBOSE(VB_IMPORTANT, "FATAL ERROR: No parent widget defined for "
 
50
                              "QT Painter, bailing");
 
51
        return;
 
52
    }
44
53
 
45
54
    MythPainter::Begin(parent);
46
55
 
74
83
void MythQtPainter::DrawImage(const QRect &r, MythImage *im,
75
84
                              const QRect &src, int alpha)
76
85
{
77
 
    assert(painter);
 
86
    if (!painter)
 
87
    {
 
88
        VERBOSE(VB_IMPORTANT, "FATAL ERROR: DrawImage called with no painter");
 
89
        return;
 
90
    }
 
91
    
78
92
    (void)alpha;
79
93
 
80
94
    MythQtImage *qim = reinterpret_cast<MythQtImage *>(im);
86
100
                             int flags, const MythFontProperties &font,
87
101
                             int alpha, const QRect &boundRect)
88
102
{
89
 
    assert(painter);
 
103
    if (!painter)
 
104
    {
 
105
        VERBOSE(VB_IMPORTANT, "FATAL ERROR: DrawText called with no painter");
 
106
        return;
 
107
    }
 
108
 
90
109
    (void)alpha;
91
110
 
92
111
    painter->setFont(font.face());