Qt Combo box UP/DOWN arrow keys not working properly
-
connect(comboSize,SIGNAL(activated(int)),this,SLOT(UP_DOWN_arrow_font_changed(int)),Qt::UniqueConnection);
connect(comboSize,SIGNAL(highlighted(QString)),this,SLOT(textSize(QString)),Qt::UniqueConnection);void TextEdit::UP_DOWN_arrow_font_changed(int index)
{
QString strCBData=comboSize->currentText();
textSize(strCBData);
}void TextEdit::textSize(const QString &p)
{
qDebug()<<"TextEdit::textSize() START::";
qDebug(PriorityP1())<<"TextEdit Font Size before" << p.toInt();
qreal pointSize =(p.toFloat()) ;
qDebug(PriorityP3())<<"TextEdit Font Size after" << pointSize << (p.toFloat());
if (p.toFloat() > 0)
{
QTextCharFormat fmt;
bSizeChanged = true;
fmt.setFontPointSize(pointSize);
mergeFormatOnWordOrSelection(fmt);
}
qDebug()<<"TextEdit::textSize() END::";
} -
@Himanshu-charde "not working properly" - what does this mean exactly?
-
@jsulm actually when the signal is emitted by highlightened(), then the size of font is changing properly. And at the time i use keyboard UP/DOWN key for which i used activated() signal to change the content of combo box it is not working
-
@Himanshu-charde Did you make sure connect() succeeded?
Did you make sure slot was called?
Did p.toInt() succeed? -
yeah it is all working even textSize() function is also getting called but dont know where it is stucked
-
@Himanshu-charde So, what is the value of pointSize in qreal pointSize =(p.toFloat()) ?