Пример #1
0
/*!
    \reimp
*/
bool QFontComboBox::event(QEvent *e)
{
    if (e->type() == QEvent::Resize) {
        QListView *lview = qobject_cast<QListView*>(view());
        if (lview)
            lview->window()->setFixedWidth(width() * 5 / 3);
    }
    return QComboBox::event(e);
}
Пример #2
0
/*!
    \reimp
*/
bool QFontComboBox::event(QEvent *e)
{
    if (e->type() == QEvent::Resize) {
        QListView *lview = qobject_cast<QListView*>(view());
        if (lview) {
            lview->window()->setFixedWidth(qMin(width() * 5 / 3,
                               QApplication::desktop()->availableGeometry(lview).width()));
        }
    }
    return QComboBox::event(e);
}