Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/demos/embedded/anomaly/src/AddressBar.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4545#include <QtGui>
    4646
    47 class LineEdit: public QLineEdit
    48 {
    49 public:
    50     LineEdit(QWidget *parent = 0): QLineEdit(parent) {}
    51 
    52     void paintEvent(QPaintEvent *event) {
    53         QLineEdit::paintEvent(event);
    54         if (text().isEmpty()) {
    55             QPainter p(this);
    56             int flags = Qt::AlignLeft | Qt::AlignVCenter;
    57             p.setPen(palette().color(QPalette::Disabled, QPalette::Text));
    58             p.drawText(rect().adjusted(10, 0, 0, 0), flags, "Enter address or search terms");
    59             p.end();
    60         }
    61     }
    62 };
    63 
    6447AddressBar::AddressBar(QWidget *parent)
    6548    : QWidget(parent)
    6649{
    67     m_lineEdit = new LineEdit(parent);
     50    m_lineEdit = new QLineEdit(parent);
     51    m_lineEdit->setPlaceholderText("Enter address or search terms");
    6852    connect(m_lineEdit, SIGNAL(returnPressed()), SLOT(processAddress()));
    6953    m_toolButton = new QToolButton(parent);
Note: See TracChangeset for help on using the changeset viewer.