Logo Search packages:      
Sourcecode: facturalux version File versions  Download package

void FLFormRecordDB::setMainWidget ( QWidget *  w  )  [virtual]

Reimplementado, aņade un widget como principal del formulario

Reimplemented from FLFormDB.

Definition at line 744 of file FLFormRecordDB.cpp.

References accept(), acceptContinue(), FLSqlCursor::BROWSE, FLFormDB::cursor_, FLFormDB::layout, layoutButtons, FLFormDB::mainWidget_, FLSqlCursor::modeAccess(), pushButtonAccept, pushButtonAcceptContinue, pushButtonCancel, FLFormDB::receiver_, reject(), FLReceiver::setSender(), and showAcceptContinue_.

Referenced by acceptContinue().

{
  if (!cursor_ || !w)
      return;

  if (layoutButtons)
      delete layoutButtons;

  if (layout)
      delete layout;

  w->setFont (qApp->font ());
  layout = new QVBoxLayout (this);
  layout->setSpacing (5);
  layout->setMargin (5);

  layoutButtons = new QHBoxLayout;
  layoutButtons->setSpacing (6);
  layoutButtons->setMargin (0);
  QSpacerItem *spacer_2 = new QSpacerItem (20, 20, QSizePolicy::Expanding,
                                                               QSizePolicy::Minimum);

  layoutButtons->addItem (spacer_2);

  if (cursor_->modeAccess () != FLSqlCursor::BROWSE)
      {
     if (showAcceptContinue_)
      {
        pushButtonAcceptContinue = new QPushButton (this, "pushButtonAcceptContinue");
        QPixmap rld(reload_xpm);
        pushButtonAcceptContinue->setIconSet(rld);
        pushButtonAcceptContinue->setSizePolicy (QSizePolicy((QSizePolicy::SizeType) 7, (QSizePolicy::SizeType) 0, pushButtonAcceptContinue->sizePolicy ().hasHeightForWidth ()));
        pushButtonAcceptContinue->setMinimumSize (QSize (0, 0));
        pushButtonAcceptContinue->setText (tr ("Aceptar y seguir (F8)", ""));
        pushButtonAcceptContinue->setFocusPolicy (QWidget::NoFocus);
        pushButtonAcceptContinue->setAccel (QKeySequence (Qt::Key_F8));
        layoutButtons->addWidget (pushButtonAcceptContinue);
        QSpacerItem *spacer_3 = new QSpacerItem (20, 20, QSizePolicy::Minimum,QSizePolicy::Minimum);
        layoutButtons->addItem (spacer_3);
        connect (pushButtonAcceptContinue, SIGNAL (clicked ()), this, SLOT (acceptContinue ()));
      }
      
        pushButtonAccept = new QPushButton (this, "pushButtonAccept");
     QPixmap ok(button_ok_xpm);
     pushButtonAccept->setIconSet(ok);
        pushButtonAccept->setSizePolicy (QSizePolicy ((QSizePolicy::SizeType) 7, (QSizePolicy::SizeType) 0, pushButtonAccept->sizePolicy ().hasHeightForWidth ()));
        pushButtonAccept->setMinimumSize (QSize (0, 0));
        pushButtonAccept->setText (tr ("Aceptar (F10)", ""));
        pushButtonAccept->setFocusPolicy (QWidget::NoFocus);
        pushButtonAccept->setAccel (QKeySequence (Qt::Key_F10));
        layoutButtons->addWidget (pushButtonAccept);
        QSpacerItem *spacer_4 = new QSpacerItem (20, 20, QSizePolicy::Minimum,
                                                                     QSizePolicy::Minimum);

        layoutButtons->addItem (spacer_4);
        connect (pushButtonAccept, SIGNAL (clicked ()), this, SLOT (accept ()));
      }

  pushButtonCancel = new QPushButton (this, "pushButtonCancel");
  QPixmap cancel(button_cancel_xpm);
  pushButtonCancel->setIconSet(cancel);
  pushButtonCancel->
      setSizePolicy (QSizePolicy ((QSizePolicy::SizeType) 7, (QSizePolicy::SizeType) 0, pushButtonCancel->sizePolicy ().hasHeightForWidth ()));
  if (cursor_->modeAccess () != FLSqlCursor::BROWSE)
      {
        pushButtonCancel->setText (tr ("Cancelar (ESC)", ""));
        pushButtonCancel->setFocusPolicy (QWidget::NoFocus);
        pushButtonCancel->setAccel (4096);
      }
  else
      {
        pushButtonCancel->setText (tr ("Aceptar (ESC)", ""));
     QPixmap ok(button_ok_xpm);
     pushButtonCancel->setIconSet(ok);
        pushButtonCancel->setFocusPolicy (QWidget::StrongFocus);
        pushButtonCancel->setFocus ();
        pushButtonCancel->setAccel (4096);
      }
  pushButtonCancel->setDefault (true);
  layoutButtons->addWidget (pushButtonCancel);
  connect (pushButtonCancel, SIGNAL (clicked ()), this, SLOT (reject ()));

  layout->add (w);
  layout->addLayout (layoutButtons);
  mainWidget_ = w;
  setFocusProxy (mainWidget_);
  mainWidget_->setFocusPolicy (QWidget::NoFocus);
  mainWidget_->setFocus ();
  resize (mainWidget_->size ());

  if (receiver_)
      receiver_->setSender (this);
}


Generated by  Doxygen 1.6.0   Back to index