Пример #1
0
  /*!
   * \author Ingemar Axelsson and Anders Fernström
   * \date 2005-11-23 (update)
   *
   * \brief The class constructor
   *
   * 2005-10-27 AF, updated the method due to porting from Q3Support
   * to pure QT4 classes.
   * 2005-11-23 AF, added document to the constructor, because need
   * the document to insert images to the output part if ploting.
   */
  InputCell::InputCell(Document *doc, QWidget *parent)
    : Cell(parent),
    evaluated_(false),
    closed_(true),
    delegate_(0),
    oldHeight_( 0 ),
    document_(doc)
  {
    QWidget *main = new QWidget(this);
    setMainWidget(main);

    layout_ = new QGridLayout(mainWidget());
    layout_->setMargin(0);
    layout_->setSpacing(0);

    setTreeWidget(new InputTreeView(this));

    //2005-10-07 AF, Porting, change from 'QWidget::' to 'Qt::'
    setFocusPolicy(Qt::NoFocus);

    createInputCell();
    createOutputCell();

    //setBackgroundColor(QColor(200,200,255));
  }
Пример #2
0
KTreeWidgetSearchLine::KTreeWidgetSearchLine( QWidget *q, QTreeWidget *treeWidget )
  : KLineEdit( q ), d( new Private( this ) )
{
  connect( this, SIGNAL(textChanged(QString)),
           this, SLOT(_k_queueSearch(QString)) );

  setClearButtonShown( true );
  setTreeWidget( treeWidget );

  if ( !treeWidget ) {
      setEnabled( false );
  }
}
KTreeWidgetSearchLine::KTreeWidgetSearchLine(QWidget *parent, QTreeWidget *treeWidget) :
        KClickLineEdit(tr("Search"), parent)
{
    k = new KTreeWidgetSearchLinePrivate;

    connect(this, SIGNAL(textChanged(const QString &)),
            this, SLOT(queueSearch(const QString &)));

    setTreeWidget(treeWidget);

    if (!treeWidget)
        setEnabled(false);
}