本文整理汇总了C++中Q3TableSelection::rightCol方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3TableSelection::rightCol方法的具体用法?C++ Q3TableSelection::rightCol怎么用?C++ Q3TableSelection::rightCol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3TableSelection
的用法示例。
在下文中一共展示了Q3TableSelection::rightCol方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Copia_Hndl
void arnNumericMatrixViewer::Copia_Hndl(void)
{
QString aTxt("MATRIX\n");
int minR, minC;
minR = pMatrix->numRows();
minC = pMatrix->numCols();
for (int indxSel = 0; indxSel < pMatrix->numSelections(); indxSel++) {
Q3TableSelection sel = pMatrix->selection(indxSel);
for (int indR = sel.topRow(); indR <= sel.bottomRow(); indR++) {
for (int indC = sel.leftCol(); indC <= sel.rightCol(); indC++) {
if ((indR < pMatrix->numRows()) && (indC < pMatrix->numCols())) {
if (indR < minR) minR = indR;
if (indC < minC) minC = indC;
}
}
}
}
for (int indxSel = 0; indxSel < pMatrix->numSelections(); indxSel++) {
Q3TableSelection sel = pMatrix->selection(indxSel);
for (int indR = sel.topRow(); indR <= sel.bottomRow(); indR++) {
for (int indC = sel.leftCol(); indC <= sel.rightCol(); indC++) {
if ((indR < pMatrix->numRows()) && (indC < pMatrix->numCols())) {
QString r,c;
r.setNum(indR - minR);
c.setNum(indC - minC);
aTxt += r; aTxt += ",";
aTxt += c; aTxt += ",";
aTxt += pMatrix->text(indR,indC);
aTxt += "\n";
}
}
}
}
if (pClip) {
if (pClip->supportsSelection()) {
//pClip->clear(QClipboard::Clipboard);
//pClip->clear(QClipboard::Selection);
pClip->setText( aTxt, QClipboard::Selection);
pMatrix->clearSelection();
Incolla->setEnabled(true);
}
else {
//pClip->clear(QClipboard::Clipboard);
//pClip->clear(QClipboard::Selection);
pClip->setText( aTxt, QClipboard::Clipboard);
pMatrix->clearSelection();
Incolla->setEnabled(true);
}
}
}
示例2: Interpola_Hndl
void arnBitValueMatrixViewer::Interpola_Hndl(void)
{
for (int indxSel = 0; indxSel < pMatrix->numSelections(); indxSel++) {
Q3TableSelection sel = pMatrix->selection(indxSel);
double valP1 = pMatrix->text(sel.topRow(),sel.leftCol()).toDouble();
double valP2 = pMatrix->text(sel.topRow(),sel.rightCol()).toDouble();
double valP3 = pMatrix->text(sel.bottomRow(),sel.leftCol()).toDouble();
double valP4 = pMatrix->text(sel.bottomRow(),sel.rightCol()).toDouble();
double step,start;
step = (valP2 - valP1) / (sel.rightCol() - sel.leftCol());
start = valP1;
for (int indC = sel.leftCol() + 1; indC < sel.rightCol(); indC++) {
start += step;
setValue(sel.topRow(),indC,start);
}
step = (valP4 - valP2) / (sel.bottomRow() - sel.topRow());
start = valP2;
for (int indR = sel.topRow() + 1; indR < sel.bottomRow(); indR++) {
start += step;
setValue(indR,sel.rightCol(),start);
}
step = (valP4 - valP3) / (sel.rightCol() - sel.leftCol());
start = valP3;
for (int indC = sel.leftCol() + 1; indC < sel.rightCol(); indC++) {
start += step;
setValue(sel.bottomRow(),indC,start);
}
step = (valP3 - valP1) / (sel.bottomRow() - sel.topRow());
start = valP1;
for (int indR = sel.topRow() + 1; indR < sel.bottomRow(); indR++) {
start += step;
setValue(indR,sel.leftCol(),start);
}
for (int indR = sel.topRow() + 1; indR < sel.bottomRow(); indR++) {
double valP1= pMatrix->text(indR,sel.leftCol()).toDouble();
double valP2 = pMatrix->text(indR,sel.rightCol()).toDouble();
double step = (valP2 - valP1) / (sel.rightCol() - sel.leftCol());
for (int indC = sel.leftCol() + 1; indC < sel.rightCol(); indC++) {
valP1 += step;
setValue(indR,indC,valP1);
}
}
}
pMatrix->clearSelection();
//if (pVector) pVector->invalidate();
}
示例3: Moltiplica_Hndl
void arnNumericMatrixViewer::Moltiplica_Hndl(void)
{
bool ok = false;
double res = QInputDialog::getDouble(
tr( "Aggiungi" ),
tr( "Inserisci Numero." ),
0, -2147483647, 2147483647, prec + 3, &ok, this, "InizializeValueBox" );
if ( ok ) { // user entered something and pressed OK
for (int indxSel = 0; indxSel < pMatrix->numSelections(); indxSel++) {
Q3TableSelection sel = pMatrix->selection(indxSel);
for (int indR = sel.topRow(); indR <= sel.bottomRow(); indR++) {
for (int indC = sel.leftCol(); indC <= sel.rightCol(); indC++) {
if ((indR < pMatrix->numRows()) && (indC < pMatrix->numCols())) {
double val = pMatrix->text(indR,indC).toDouble();
val *= res;
setValue(indR,indC,val);
doValueChange(indR,indC);
}
}
}
}
}
else {;}// user pressed Cancel
pMatrix->clearSelection();
}
示例4: InterpolaX_Hndl
void arnNumericMatrixViewer::InterpolaX_Hndl(void)
{
for (int indxSel = 0; indxSel < pMatrix->numSelections(); indxSel++) {
Q3TableSelection sel = pMatrix->selection(indxSel);
for (int indR = sel.topRow(); indR <= sel.bottomRow(); indR++) {
double valP1= pMatrix->text(indR,sel.leftCol()).toDouble();
double valP2 = pMatrix->text(indR,sel.rightCol()).toDouble();
double step = (valP2 - valP1) / (sel.rightCol() - sel.leftCol());
for (int indC = sel.leftCol() + 1; indC < sel.rightCol(); indC++) {
valP1 += step;
setValue(indR,indC,valP1);
doValueChange(indR,indC);
}
}
}
pMatrix->clearSelection();
}
示例5: selectionChangedHndl
void arnBitValueMatrixViewer::selectionChangedHndl(void)
{
if (!pMatrix) return;
if (!pVector) return;
if (pMatrix->numSelections() > 1) return;
Q3TableSelection sel = pMatrix->selection(0);
if (sel.leftCol() < sel.rightCol()) return;
if ((sel.bottomRow() - sel.topRow() + 1) != pMatrix->numRows()) return;
//arnDebug("%d,%d,%d,%d\n",sel.topRow(),sel.bottomRow(),sel.leftCol(),sel.rightCol());
for (int indR = sel.topRow(); indR <= sel.bottomRow(); indR++) {
pVector->setValue(indR,pMatrix->text(indR,sel.leftCol()).toDouble());
}
}
示例6: Azzera_Hndl
void arnNumericMatrixViewer::Azzera_Hndl(void)
{
for (int indxSel = 0; indxSel < pMatrix->numSelections(); indxSel++) {
Q3TableSelection sel = pMatrix->selection(indxSel);
for (int indR = sel.topRow(); indR <= sel.bottomRow(); indR++) {
for (int indC = sel.leftCol(); indC <= sel.rightCol(); indC++) {
if ((indR < pMatrix->numRows()) && (indC < pMatrix->numCols())) {
setValue(indR,indC,0);
doValueChange(indR,indC);
}
}
}
}
pMatrix->clearSelection();
}
示例7: Azzera_Hndl
void arnBitValueMatrixViewer::Azzera_Hndl(void)
{
for (int indxSel = 0; indxSel < pMatrix->numSelections(); indxSel++) {
Q3TableSelection sel = pMatrix->selection(indxSel);
for (int indR = sel.topRow(); indR <= sel.bottomRow(); indR++) {
for (int indC = sel.leftCol(); indC <= sel.rightCol(); indC++) {
if ((indR < pMatrix->numRows()) && (indC < pMatrix->numCols())) {
setValue(indR,indC,0);
}
}
}
}
pMatrix->clearSelection();
//if (pVector) pVector->invalidate();
}
示例8: Inizializza_Hndl
void arnBitValueMatrixViewer::Inizializza_Hndl(void)
{
bool ok = false;
double res = QInputDialog::getDouble(
tr( "Inizializza" ),
tr( "Inserisci Numero." ),
0, -2147483647, 2147483647, prec + 3, &ok, this, "InizializeValueBox" );
if ( ok ) { // user entered something and pressed OK
for (int indxSel = 0; indxSel < pMatrix->numSelections(); indxSel++) {
Q3TableSelection sel = pMatrix->selection(indxSel);
for (int indR = sel.topRow(); indR <= sel.bottomRow(); indR++) {
for (int indC = sel.leftCol(); indC <= sel.rightCol(); indC++) {
if ((indR < pMatrix->numRows()) && (indC < pMatrix->numCols())) {
setValue(indR,indC,res);
}
}
}
}
}
else {;}// user pressed Cancel
pMatrix->clearSelection();
//if (pVector) pVector->invalidate();
}