hi friends,
is there any way to check the popup direction of qcombobox . is it any way to check the popup drops up or down ..
hi friends,
is there any way to check the popup direction of qcombobox . is it any way to check the popup drops up or down ..
"Behind every great fortune lies a crime" - Balzac
I guess it happens automatically. Why you need to check manually ?
For details check the source code of QComboBox::showPopup
my combobox adjust only after i add the forth item in my combobox .. im having some space below where the combobox is placed .. so initial three items will pop down but my requirement is to show pop upwards all the time ..
actually i have to show the popup in drop up even before qt adjust the orientation .. so i tried this
it works .. but when qt adjust the orientation my calculation of move() is going in wrong ..for that reason only im asking if any possible way i can detect ..:showPopup()
{
QComboBox::showPopup();
QWidget *popup = this->findChild<QFrame*>();
popup->move(popup->x(),popup->y()-this->height()-popup->height())
"Behind every great fortune lies a crime" - Balzac
Well, you could first check if the popup's top left is above or below the combobox's rectangle, no?
Cheers,
_
wagmare (6th November 2013)
done thx!
qreal yPos = mapToGlobal(this->rect().topLeft()).y();
if(popup->y() > yPos)
"Behind every great fortune lies a crime" - Balzac
Bookmarks