[SOLVED] How do i make a QToolButton to work similiar to Bold button in text editors?
General and Desktop
9
Posts
3
Posters
3.0k
Views
1
Watching
-
@ callButton = new QToolButton;
callButton->addAction(callAct);
mainToolBar->addWidget(callButton);
callButton->setStyleSheet("QToolButton::menu-indicator{image:none;}");
callButton->setIcon(QIcon(voiceCallPix));
callButton->setCheckable(true);
// Connect
connect(callButton, SIGNAL(clicked()), this, SLOT(callUser()));// the callUser slot
void PMsgWindow::callUser() {callButton->setChecked(true); callAct->setToolTip("End call");
// the 2nd connect for the deactivation of the press
// this is in the callUser slot
connect(callButton, SIGNAL(clicked()), this, SLOT(endCall()));// the endcall slot
void PMsgWindow::endCall() {
callButton->setChecked(false);
callFrame->hide();
chatEdit->setMinimumHeight(400);
}@this code works only for the 1st click. then it doesn't react in the same way.