hello guys
I was make custom frame and I have to decorate them using stylesheet.
my custom frame has title bar and main widget.
and I hope paint to blue only title bar not main widget.
but is not working...........
first, my custom frame is organized like this :
Frame::Frame()
{
m_titleBar = new TitleBar(this);
vbox->addWidget(m_titleBar);
layout->addWidget(m_content);
vbox->addLayout(layout);
}
TitleBar
::TitleBar(QWidget* parent
){
label->setText("mylabel");
hbox->addWidget(label);
}
Frame::Frame()
{
m_titleBar = new TitleBar(this);
m_content = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout(this);
vbox->addWidget(m_titleBar);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(m_content);
vbox->addLayout(layout);
}
TitleBar::TitleBar(QWidget* parent)
: QWidget(parent)
{
QLabel *label = new QLabel(this);
label->setText("mylabel");
QHBoxLayout *hbox = new QHBoxLayout(this);
hbox->addWidget(label);
}
To copy to clipboard, switch view to plain text mode
and I was try some method this :
titlebar->setobjectname("titlebar");
customframe->setstylesheet(tr("QWidget#titlebar{background : red;}"));
titlebar->setobjectname("titlebar");
customframe->setstylesheet(tr("QWidget#titlebar{background : red;}"));
To copy to clipboard, switch view to plain text mode
and this :
titlebar->setstylesheet(tr("QWidget{background : red;"}))
titlebar->setstylesheet(tr("QWidget{background : red;"}))
To copy to clipboard, switch view to plain text mode
It's so hard... please help me ...
Bookmarks