qt-interest@trolltech.com
[Top] [All Lists]

QListWidget background color

Subject: QListWidget background color
From: Jeff Lacki
Date: Wed, 22 Mar 2006 10:24:15 -0800 PST
Hello-

Im trying to set the background color in QListWidget for
a dockwindow in 4.1.0

It seems so straightforward, but yet its not working.
Is this something I did or is this a bug in QT?

Id try 4.1.1 but when it came out, my canvas move calls
didnt work at all, I couldnt believe it.

void
MainWindow::createDockWindow()
{
    _dock = new QDockWidget(tr("Details"), this);

    QListWidget *list = new QListWidget(_dock);
    QPalette qp;
    qp.setColor(QPalette::Active,QPalette::Background,QColor(55,55,55));
    list->setPalette(qp);
    list->setBackgroundRole(QPalette::Background);
    list->resize(500,80);
    list->addItem("jeff");
    list->addItem("mike");
    list->addItem("jbob");
    list->addItem("dkdk");

    _dock->setAllowedAreas(
        Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea |
        Qt::BottomDockWidgetArea | Qt::TopDockWidgetArea);
    _dock->setFeatures(QDockWidget::AllDockWidgetFeatures);
    _dock->setWidget(list);

    addDockWidget(Qt::BottomDockWidgetArea, _dock);
}

Thanks,
Jeff

--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>