~timo-jyrinki/ubuntu/trusty/maliit-framework/fix_qt52

« back to all changes in this revision

Viewing changes to tests/utils/gui-utils.cpp

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2013-01-31 13:26:48 UTC
  • Revision ID: package-import@ubuntu.com-20130131132648-w1u9d2279tppxcft
Tags: upstream-0.94.1
ImportĀ upstreamĀ versionĀ 0.94.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* * This file is part of Maliit framework *
 
2
 *
 
3
 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
 
4
 * All rights reserved.
 
5
 *
 
6
 * Contact: maliit-discuss@lists.maliit.org
 
7
 *
 
8
 * This library is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU Lesser General Public
 
10
 * License version 2.1 as published by the Free Software Foundation
 
11
 * and appearing in the file LICENSE.LGPL included in the packaging
 
12
 * of this file.
 
13
 */
 
14
 
 
15
#include "gui-utils.h"
 
16
 
 
17
#include <QtDebug>
 
18
#include <QtCore>
 
19
#include <QtGui>
 
20
#include <QtTest>
 
21
 
 
22
namespace MaliitTestUtils {
 
23
 
 
24
RemoteWindow::RemoteWindow(QWidget *p, Qt::WindowFlags f)
 
25
    : QWidget(p, f)
 
26
{
 
27
    setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
 
28
}
 
29
 
 
30
void RemoteWindow::paintEvent(QPaintEvent *)
 
31
{
 
32
    QPainter p(this);
 
33
    p.setBrush(QBrush(QColor(Qt::green)));
 
34
    p.drawRect(QRect(QPoint(), size()));
 
35
    QFont f;
 
36
    f.setPointSize(32);
 
37
    p.setFont(f);
 
38
    p.drawText(QRect(QPoint(), size()).adjusted(16, 16, -16, -16),
 
39
               QString("Maliit"));
 
40
}
 
41
 
 
42
}
 
43