本文整理汇总了C++中TXshColumn::getRange方法的典型用法代码示例。如果您正苦于以下问题:C++ TXshColumn::getRange方法的具体用法?C++ TXshColumn::getRange怎么用?C++ TXshColumn::getRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TXshColumn
的用法示例。
在下文中一共展示了TXshColumn::getRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void execute() override {
TColumnSelection *selection =
dynamic_cast<TColumnSelection *>(TSelection::getCurrent());
if (!selection) {
DVGui::warning(
tr("It is not possible to merge tlv columns because no column was "
"selected."));
return;
}
std::set<int> indices = selection->getIndices();
if (indices.size() < 2) {
DVGui::warning(
tr("It is not possible to merge tlv columns because at least two "
"columns have to be selected."));
return;
}
std::set<int>::iterator it = indices.begin();
int destColumn = *it;
TCellSelection::Range cells;
cells.m_c0 = cells.m_c1 = destColumn;
TXshColumn *column =
TApp::instance()->getCurrentXsheet()->getXsheet()->getColumn(
destColumn);
column->getRange(cells.m_r0, cells.m_r1);
// column->getLevelColumn()
TFilePath newLevelPath;
TXshCell c = TApp::instance()->getCurrentXsheet()->getXsheet()->getCell(
cells.m_r0, destColumn);
if (!c.isEmpty() && c.getSimpleLevel())
newLevelPath = c.getSimpleLevel()->getPath();
if (MergeCmappedDialog(newLevelPath).exec() != QDialog::Accepted) return;
it = indices.begin();
for (; it != indices.end(); ++it)
if (!checkColumnValidity(*it)) return;
DVGui::ProgressDialog progress(tr("Merging Tlv Levels..."), QString(), 0,
indices.size() - 1,
TApp::instance()->getMainWindow());
progress.setWindowModality(Qt::WindowModal);
progress.setWindowTitle(tr("Merging Tlv Levels..."));
progress.setValue(0);
progress.show();
QCoreApplication::instance()->processEvents();
TUndoManager::manager()->beginBlock();
cloneColumn(cells, newLevelPath);
it = indices.begin();
++it;
for (int count = 0; it != indices.end();) {
int index = *it;
it++;
mergeCmapped(destColumn, index - count,
it == indices.end()
? QString::fromStdWString(newLevelPath.getWideString())
: "",
false);
ColumnCmd::deleteColumn(index - count);
progress.setValue(++count);
QCoreApplication::instance()->processEvents();
}
TUndoManager::manager()->endBlock();
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
}