bool QSymbianApplication::symbianEventFilter(const QSymbianEvent *event)
{
    if (event->type() == QSymbianEvent::WindowServerEvent) {
        switch (event->windowServerEvent()->Type()) {
        case KAknUidValueEndKeyCloseEvent: {
            QSymbianHelper::hideInBackground();
            return true;
        }

        case EEventFocusGained: {
            iForeground = true;
            emit foregroundChanged(iForeground);

            if (QSymbianHelper::isHide())
                QSymbianHelper::setHide(false);
        }
            break;

        case EEventFocusLost: {
            iForeground = false;
            emit foregroundChanged(iForeground);
        }
            break;
        }
    }
    else if (event->type() == QSymbianEvent::CommandEvent) {
        if (event->command() == EEikCmdExit) {
            QSymbianHelper::hideInBackground();
            return true;
        }
    }

    return QApplication::symbianEventFilter(event);
}
Esempio n. 2
0
/**
 * Foreground and background colors switch places and signals are emitted.
 */
void DualColorButton::swapColors()
{
	const QColor tmp = foreground_;
	foreground_ = background_;
	background_ = tmp;
	emit foregroundChanged(foreground_);
	emit backgroundChanged(background_);
	update();
}
Esempio n. 3
0
void DualColorButton::dropEvent(QDropEvent *event)
{
	const QColor color = qvariant_cast<QColor>(event->mimeData()->colorData());
	if(foregroundRect().contains(event->pos())) {
		foreground_ = color;
		emit foregroundChanged(color);
	} else if(backgroundRect().contains(event->pos())) {
		background_ = color;
		emit backgroundChanged(color);
	}
	update();
}
void DeclarativeWebContainer::setForeground(bool active)
{
    if (m_foreground != active) {
        m_foreground = active;

        if (!m_foreground) {
            // Respect content height when browser brought back from home
            resetHeight(true);
        }
        emit foregroundChanged();
    }
}
Esempio n. 5
0
void DualColorButton::mouseReleaseEvent(QMouseEvent *event)
{
	if(event->button() != Qt::LeftButton)
		return;
	QRectF fgr = foregroundRect();
	QRectF bgr = backgroundRect();
	if(fgr.contains(event->pos()))
		emit foregroundClicked(foreground_);
	else if(bgr.contains(event->pos()))
		emit backgroundClicked(background_);
	else if(event->pos().x() > fgr.right() && event->pos().y() < bgr.top())
		swapColors();
	else if(event->pos().x() < bgr.left() && event->pos().y() > fgr.bottom()) {
		foreground_ = Qt::black;
		background_ = Qt::white;
		emit foregroundChanged(foreground_);
		emit backgroundChanged(background_);
		update();
	}
}
Esempio n. 6
0
/**
 * The foregroundColorChanged signal is emitted
 * @param c color to set
 */
void DualColorButton::setForeground(const QColor &c)
{
	foreground_ = c;
	emit foregroundChanged(c);
	update();
}