Example #1
0
void PreFlightCheckListPage::slotEdit()
{
  QTableWidgetItem* item = m_list->currentItem();

  if( item == static_cast<QTableWidgetItem *>(0) )
    {
      // Item can be a Null pointer!
      return;
    }

  QList<QTableWidgetSelectionRange> selRangeList = m_list->selectedRanges();

  if( selRangeList.size() == 0 )
    {
      // Nothing seems to be selected
      return;
    }

  QTableWidgetSelectionRange sr = selRangeList.at(0);

  if( sr.rowCount() > 1 )
    {
      // More than one row are selected
      return;
    }

  if( sr.rightColumn() == 1 )
    {
	  slotEditCell( m_list->currentRow(), 1 );
    }
}
Example #2
0
TableEditor::TableEditor(QWidget* parent, const char* name)
  : TableEditorS(parent, name)
{
  m_popup = new KPopupMenu();
  m_cellEditId = m_popup->insertItem(i18n("&Edit Cell Properties"), this ,SLOT(slotEditCell()));
  m_rowEditId = m_popup->insertItem(i18n("Edit &Row Properties"), this ,SLOT(slotEditRow()));
  //  m_colEditId = m_popup->insertItem(i18n("Edit &Column Properties"), this ,SLOT(slotEditCol()));
  m_mergeSeparatorId = m_popup->insertSeparator();
  m_mergeCellsId = m_popup->insertItem(i18n("Merge Cells"), this, SLOT(slotMergeCells()));
  m_unmergeCellsId = m_popup->insertItem(i18n("Break Merging"), this, SLOT(slotUnmergeCells()));

  m_popup->insertSeparator();
  m_popup->insertItem(i18n("&Insert Row"), this, SLOT(slotInsertRow()));
  m_popup->insertItem(i18n("Insert Co&lumn"), this, SLOT(slotInsertCol()));
  m_popup->insertItem(i18n("Remove Row"), this, SLOT(slotRemoveRow()));
  m_popup->insertItem(i18n("Remove Column"), this, SLOT(slotRemoveCol()));
  m_popup->insertSeparator();
  m_popup->insertItem(i18n("Edit &Table Properties"), this, SLOT(slotEditTable()));
  m_editChildId = m_popup->insertItem(i18n("Edit Child Table"), this, SLOT(slotEditChildTable()));

  buttonOk->setIconSet(SmallIconSet("button_ok"));
  buttonCancel->setIconSet(SmallIconSet("button_cancel"));
  buttonHelp->setIconSet(SmallIconSet("help"));

  m_row = m_col = -1;
  m_tbody = 0L;
  m_thead = 0L;
  m_tfoot = 0L;
  m_table = 0L;
  m_dtd = 0L;
  m_write = 0L;
  m_tableDataTags = new QValueList<QValueList<TableNode> >;
  m_tableHeaderTags = new QValueList<QValueList<TableNode> >;
  m_tableFooterTags = new QValueList<QValueList<TableNode> >;
  m_tableTags = 0L;
  m_tableDataRows = new QValueList<TableNode>;
  m_tableHeaderRows = new QValueList<TableNode>;
  m_tableFooterRows = new QValueList<TableNode>;
  m_tableRows = 0L;
  m_createNodes = true;
  newNum += 7;

  connect(headerColSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveCol(int)));
  connect(headerRowSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveRow(int)));
  connect(rowSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveRow(int)));
  connect(colSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveCol(int)));
  connect(footerRowSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveRow(int)));
  connect(footerColSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveCol(int)));
  connect(tableData, SIGNAL(contextMenuRequested(int,int,const QPoint&)),
    SLOT(slotContextMenuRequested(int,int,const QPoint&)));
  connect(pushButton7, SIGNAL(clicked()), SLOT(slotEditTable()));
  connect(pushButton7_2, SIGNAL(clicked()), SLOT(slotEditTableBody()));
  connect(pushButton7_3, SIGNAL(clicked()), SLOT(slotEditTableHeader()));
  connect(pushButton7_4, SIGNAL(clicked()), SLOT(slotEditTableFooter()));
  connect(headerTableData, SIGNAL(contextMenuRequested(int,int,const QPoint&)),
    SLOT(slotContextMenuRequested(int,int,const QPoint&)));
  connect(footerTableData, SIGNAL(contextMenuRequested(int,int,const QPoint&)),
    SLOT(slotContextMenuRequested(int,int,const QPoint&)));
  connect(tabWidget, SIGNAL(currentChanged(QWidget*)), SLOT(slotTabChanged(QWidget*)));
  connect(buttonHelp, SIGNAL(clicked()), SLOT(slotHelpInvoked()));
  connect(tableData, SIGNAL(valueChanged(int,int)), SLOT(slotEditCellText(int,int)));
  connect(headerTableData, SIGNAL(valueChanged(int,int)), SLOT(slotEditCellText(int,int)));
  connect(footerTableData, SIGNAL(valueChanged(int,int)), SLOT(slotEditCellText(int,int)));
}