本文整理汇总了C++中Q3TableSelection::bottomRow方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3TableSelection::bottomRow方法的具体用法?C++ Q3TableSelection::bottomRow怎么用?C++ Q3TableSelection::bottomRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3TableSelection
的用法示例。
在下文中一共展示了Q3TableSelection::bottomRow方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
}
示例2: 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);
}
}
}
示例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: Interpola_Hndl
void arnNumericMatrixViewer::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);
doValueChange(sel.topRow(),indC);
}
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);
doValueChange(indR,sel.rightCol());
}
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);
doValueChange(sel.bottomRow(),indC);
}
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);
doValueChange(indR,sel.leftCol());
}
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);
doValueChange(indR,indC);
}
}
}
pMatrix->clearSelection();
}
示例5: InterpolaY_Hndl
void arnBitValueMatrixViewer::InterpolaY_Hndl(void)
{
for (int indxSel = 0; indxSel < pMatrix->numSelections(); indxSel++) {
Q3TableSelection sel = pMatrix->selection(indxSel);
for (int indC = sel.leftCol() ; indC <= sel.rightCol(); indC++) {
double valP1= pMatrix->text(sel.topRow(),indC).toDouble();
double valP2 = pMatrix->text(sel.bottomRow(),indC).toDouble();
double step = (valP2 - valP1) / (sel.bottomRow() - sel.topRow());
for (int indR = sel.topRow() + 1; indR < sel.bottomRow(); indR++) {
valP1 += step;
setValue(indR,indC,valP1);
}
}
}
pMatrix->clearSelection();
//if (pVector) pVector->invalidate();
}
示例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: setTable
void SetColValuesDialog::setTable(Table* w)
{
table = w;
QStringList colNames = w->colNames();
int cols = w->numCols();
for (int i=0; i<cols; i++)
boxColumn->insertItem("col(\""+colNames[i]+"\")", i);
int s = w->table()->currentSelection();
if (s >= 0) {
Q3TableSelection sel = w->table()->selection(s);
w->setSelectedCol(sel.leftCol());
start->setValue(sel.topRow() + 1);
end->setValue(sel.bottomRow() + 1);
} else {
start->setValue(1);
end->setValue(w->numRows());
}
updateColumn(w->selectedColumn());
}
示例9: 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();
}
示例10: QDialog
FrequencyCountDialog::FrequencyCountDialog(Table *t, QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl ),
d_source_table(t),
d_result_table(NULL),
d_col_name(""),
d_col_values(NULL),
d_bins(10)
{
setObjectName( "FrequencyCountDialog" );
setWindowTitle(tr("QtiPlot - Frequency count"));
setSizeGripEnabled( true );
setAttribute(Qt::WA_DeleteOnClose);
QGroupBox *gb1 = new QGroupBox();
QGridLayout *gl1 = new QGridLayout(gb1);
ApplicationWindow *app = (ApplicationWindow *)parent;
double min = 0.0, max = 0.0, step = 0.0;
if (t){
int col = -1;
int sr = 0;
int er = t->numRows();
int ts = t->table()->currentSelection();
if (ts >= 0){
Q3TableSelection sel = t->table()->selection(ts);
sr = sel.topRow();
er = sel.bottomRow() + 1;
col = sel.leftCol();
d_col_name = t->colName(col);
}
int size = 0;
for (int i = sr; i < er; i++){
if (!t->text(i, col).isEmpty())
size++;
}
if (size > 1)
d_col_values = gsl_vector_alloc(size);
if (d_col_values){
int aux = 0;
for (int i = sr; i < er; i++){
if (!t->text(i, col).isEmpty()){
gsl_vector_set(d_col_values, aux, t->cell(i, col));
aux++;
}
}
gsl_sort_vector(d_col_values);
min = floor(gsl_vector_get(d_col_values, 0));
max = ceil(gsl_vector_get(d_col_values, size - 1));
step = (max - min)/(double)d_bins;
int p = app->d_decimal_digits;
double *data = d_col_values->data;
QLocale l = app->locale();
QString s = "[" + QDateTime::currentDateTime().toString(Qt::LocalDate)+ " \"" + t->objectName() + "\"]\n";
s += tr("Statistics on %1").arg(d_col_name) + ":\n";
s += tr("Mean") + " = " + l.toString(gsl_stats_mean (data, 1, size), 'f', p) + "\n";
s += tr("Standard Deviation") + " = " + l.toString(gsl_stats_sd(data, 1, size), 'f', p) + "\n";
s += tr("Median") + " = " + l.toString(gsl_stats_median_from_sorted_data(data, 1, size), 'f', p) + "\n";
s += tr("Size") + " = " + QString::number(size) + "\n";
s += "--------------------------------------------------------------------------------------\n";
app->updateLog(s);
}
}
gl1->addWidget(new QLabel(tr("From Minimum")), 0, 0);
boxStart = new DoubleSpinBox();
boxStart->setLocale(app->locale());
boxStart->setValue(min);
boxStart->setDecimals(app->d_decimal_digits);
gl1->addWidget(boxStart, 0, 1);
gl1->addWidget(new QLabel(tr("To Maximum")), 1, 0);
boxEnd = new DoubleSpinBox();
boxEnd->setLocale(app->locale());
boxEnd->setValue(max);
boxEnd->setDecimals(app->d_decimal_digits);
gl1->addWidget(boxEnd, 1, 1);
gl1->addWidget(new QLabel(tr("Step Size")), 2, 0);
boxStep = new DoubleSpinBox();
boxStep->setLocale(app->locale());
boxStep->setValue(step);
boxStep->setDecimals(app->d_decimal_digits);
gl1->addWidget(boxStep, 2, 1);
gl1->setRowStretch(3, 1);
gl1->setColumnStretch(1, 1);
buttonApply = new QPushButton(tr( "&Apply" ));
buttonApply->setDefault( true );
buttonCancel = new QPushButton(tr( "&Cancel" ));
buttonOk = new QPushButton(tr( "&Ok" ));
//.........这里部分代码省略.........