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

void Item::initItem ( bool  checked  )  [private]

Create needed objects / widgets and initialize them with common properties (including isChecked) m_type must be initialized before call initItem

Definition at line 190 of file item.cpp.

References AlignableCheckBox::checkBox(), Global::debugWindow, Basket::hAlign(), Basket::isLocked(), m_previous, AlignableCheckBox::setCheckCursor(), AlignableCheckBox::setFocusPolicy(), Basket::showCheckBoxes(), and Basket::vAlign().

Referenced by Item().

{
      if (Global::debugWindow)
            *Global::debugWindow << "Item[" + fullPath() +"] Created";

      m_layout = new QHBoxLayout(this, margins, margins);

      m_check = new AlignableCheckBox(QString(), this);
      m_check->setShown( m_parentBasket->showCheckBoxes() );
      m_check->setSizePolicy( QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding, 0, 0, false) );
      m_check->setEnabled( ! m_parentBasket->isLocked() );
      m_check->checkBox()->setChecked( checked );
      m_check->setCheckCursor(QCursor(Qt::ArrowCursor)); // Since a click to open just check/uncheck
      m_layout->addWidget(m_check);                      //   m_check, assign "normal" cursor
      m_check->setFocusPolicy(QWidget::NoFocus);

      if (useLinkLabel()) {
            m_linkLabel = new LinkLabel(m_parentBasket->hAlign(), m_parentBasket->vAlign(), this);
            m_layout->addWidget(m_linkLabel);
            m_item = 0L;
      } else {
            m_item = new QLabel(this);
            m_item->setScaledContents(false); // I could speed-up draws (not timered it : perhapse not so important)
            m_layout->addWidget(m_item);
            m_linkLabel = 0L;
      }

      alignChanged( m_parentBasket->hAlign(), m_parentBasket->vAlign() );

      connect( m_check->checkBox(), SIGNAL(clicked()), this, SLOT(slotChecked()) );
      connect( &m_selectTimer,      SIGNAL(timeout()), this, SLOT(select())      );

      m_playObj    = 0L;
      m_playServer = 0L;
      m_previous   = 0L;
      m_next       = 0L;
      m_isSelected = false;
      m_isFocused  = false;
      m_canDrag    = false;
      m_wasPressed = false;
}


Generated by  Doxygen 1.6.0   Back to index