I have defined a QLineEdit in the "BaseForm" constructor as
boxLayout->addLayout ( inputStripLayout );
lbCategory
= new QLabel("Category #");
lbCategory->setFont ( fb );
inputStripLayout->addWidget ( lbCategory );
leCategoryNumber->setAlignment ( Qt::AlignCenter );
leCategoryNumber->setPalette ( palE );
leCategoryNumber->setFont ( fb );
leCategoryNumber->setMaximumWidth(30);
leCategoryNumber->setEnabled(false);
inputStripLayout->addWidget ( leCategoryNumber)
boxLayout = new QVBoxLayout ( frameD );
inputStripLayout = new QHBoxLayout ( );
boxLayout->addLayout ( inputStripLayout );
lbCategory = new QLabel("Category #");
lbCategory->setFont ( fb );
inputStripLayout->addWidget ( lbCategory );
leCategoryNumber= new QLineEdit();
leCategoryNumber->setAlignment ( Qt::AlignCenter );
leCategoryNumber->setPalette ( palE );
leCategoryNumber->setFont ( fb );
leCategoryNumber->setMaximumWidth(30);
leCategoryNumber->setEnabled(false);
inputStripLayout->addWidget ( leCategoryNumber)
To copy to clipboard, switch view to plain text mode
and I want to change the color of the QLineEdit and set the focus with
void BaseForm::slotPb1()
{
catNum->inputCatNum();
Pb1->setText("-");
Pb2->setText("Cat'ory");
leCategoryNumber
->setPalette
( QColor (17,
255,
255) );
leCategoryNumber->setEnabled(true);
leCategoryNumber->setFocus();
void BaseForm::slotPb1()
{
catNum->inputCatNum();
Pb1->setText("-");
Pb2->setText("Cat'ory");
leCategoryNumber->setPalette ( QColor (17, 255, 255) );
leCategoryNumber->setEnabled(true);
leCategoryNumber->setFocus();
To copy to clipboard, switch view to plain text mode
I get the "focus" ok, but I get a "white" box, not the "blue" one I want. Looked at the QPalette" documentation and don't understand a word of it. I am sure there is a simple way to togle colors on a QLineEdit" as a signal for "User" input. But I couldn't find it .
Thanks in advance for you help.
Bookmarks