[Solved]select effect in pushbuttons
-
:)
i come again with yet another button problem. Ive created an array of buttons with out using the designer.@cellBut[i][j]=new QPushButton();
connect(cellBut[i][j],SIGNAL(clicked()),this,SLOT(onClickAction()));@these are arranged in rows , a calender sorta thing, and i want to select them when clicked once, jus to know tht ive clicked that particular date. It gives the default "pressed and released effect" but not the highlighted effect.
I want it do the highlighting jus like how the default calenderwidget does.
is there some highlight function thing. I found an autofill backgroundthing or setMask, but it does nothing, or i dont know how to use it.
or if i get a pointer of the selected date, does it have the function to select???Guide me on this please
Thank you
-
thanks franzk
can we uncheck it programatically. Meaning setCheckable(true) wil check it once clicked right. but even if i click the next button, both the currently clicked and previously clicked are checked :)
jus like minesweepers :) i don want tht. i want to uncheck the previously clicked one.
thank you
-
The select effect can be done either putting images for the pressed and not pressed state.
So set the stylesheet to suit your needs.Ex:
@QPushButton#settingBut { color: rgb(0, 0, 0);
border-width: 1px; border-radius: 10px; font: bold 20px; min-width: 8em; padding: 5px;
}
QPushButton#settingBut:pressed
{
border-style:solid;
border-width:2px;
}
@