Exemplo n.º 1
0
void TaskManager::createActions()
{
    this->insertAct = new QAction(tr("&Insert"),this);
    //this->insertAct->setShortcut(QKeySequence::New);
    this->setStatusTip(tr("Добавляет новую строку в конец списка."));
    connect(insertAct, SIGNAL(triggered()), this, SLOT(slotInsertRow()));

    this->deleteAct = new QAction(tr("&Delete"),this);
    //this->deleteAct->setShortcut(QKeySequence::Delete);
    this->setStatusTip(tr("Удаляет выбранную строку."));
    connect(deleteAct, SIGNAL(triggered()), this, SLOT(slotDeleteRow()));
}
Exemplo n.º 2
0
void TableEditor::slotAddRemoveRow( int num )
{
  m_row = -1;
  int numRows = m_dataTable->numRows();
  if (num > numRows) {
    for (int i = numRows; i < num; i++) {
      slotInsertRow();
    }
  }
  else {
    for (int i = num; i < numRows; i++) {
      slotRemoveRow();
    }
  }
  //TODO: change the main tag's rowspan if necessary
}
Exemplo n.º 3
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)));
}