Exemplo n.º 1
0
void MigrateDialog::ask()
{
    QAbstractButton *btn = button( QWizard::CancelButton );
    QPoint p = btn->mapToGlobal(QPoint(0, 0));
    QRect rc(p.x(), p.y(), btn->width(), btn->height());
    BalloonMsg::ask(NULL, i18n("Cancel convert?"), this, SLOT(cancel(void*)), NULL, &rc);
}
Exemplo n.º 2
0
void LineEditWidget::showEvent(QShowEvent *e)
{
    // Width of standard QLineEdit plus extended tool buttons
    int width = 0;
    for (QWidget *w: _toolbuttons) {
        if (w->isVisible()) {
            width += w->width();
            QAbstractButton *bt = qobject_cast<QAbstractButton*>(w);
            if (bt && bt->iconSize().height() > bt->height()) {
                bt->setIconSize(QSize(bt->height(), bt->height()));
            }
        }
    }

    setTextMargins(0, 0, width, 0);
    QLineEdit::showEvent(e);
}
Exemplo n.º 3
0
void PatVerticalTabWidget::setCurrentIndex(int index)
{
  int yPos = 25;
  
  for(int i = 0; i < m_buttonGroup->buttons().size(); i++)
  {
    QAbstractButton * button = m_buttonGroup->button(i);

    button->move(0,yPos);

    yPos += button->height();

    // Ignore clicks to the already active tab
    if(button->isEnabled() && button->isChecked() && currentIndex != index){
      currentIndex = index;
      emit tabSelected(i);
    }
  }
  QTimer::singleShot(0, this, SLOT(refreshIcons()));
}