×
Namespaces

Variants
Actions
Revision as of 09:55, 27 March 2009 by tepaa (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Archived:Changing QWidget background colour

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): 5800 XpressMusic
Compatibility
Platform(s): Qt
Symbian
Article
Keywords: QPalette
Created: (27 Mar 2009)
Last edited: tepaa (27 Mar 2009)

Contents

Overview

This code snippets shows how to change QWidget background color.

Note: In order to use this code, you need to have Qt for S60 installed on your platform.


Preconditions


Source

Change background color of the QWidget.

#include <QPalette>
 
QMyWidget::QMyWidget(QWidget *parent)
: QWidget(parent)
{
QPalette p(palette());
// Set background color to black
p.setColor(QPalette::Background, Qt::black);
setPalette(p);
}


Postconditions

QWidget background color is black.

228 page views in the last 30 days.
×