geom/src/DlgRef/DlgRef.cxx

944 lines
20 KiB
C++
Raw Normal View History

2023-06-19 21:32:54 +05:00
// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2009-02-13 17:16:39 +05:00
//
2012-08-09 13:58:02 +06:00
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
2014-02-18 12:44:41 +06:00
// version 2.1 of the License, or (at your option) any later version.
2009-02-13 17:16:39 +05:00
//
2012-08-09 13:58:02 +06:00
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
2009-02-13 17:16:39 +05:00
//
2012-08-09 13:58:02 +06:00
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2009-02-13 17:16:39 +05:00
//
2012-08-09 13:58:02 +06:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2013-04-01 18:25:01 +06:00
//
2012-08-09 13:58:02 +06:00
2009-02-13 17:16:39 +05:00
// File : DlgRef.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
2012-08-09 13:58:02 +06:00
2009-02-13 17:16:39 +05:00
#include "DlgRef.h"
2013-02-28 20:00:05 +06:00
//////////////////////////////////////////
// DlgRef_1Check1Spin1Check
//////////////////////////////////////////
DlgRef_1Check1Spin1Check::DlgRef_1Check1Spin1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Check1Spin1Check::~DlgRef_1Check1Spin1Check()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_1List1Spin1Btn
//////////////////////////////////////////
DlgRef_1List1Spin1Btn::DlgRef_1List1Spin1Btn( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1List1Spin1Btn::~DlgRef_1List1Spin1Btn()
{
}
//////////////////////////////////////////
// DlgRef_1Sel1Check1List
//////////////////////////////////////////
DlgRef_1Sel1Check1List::DlgRef_1Sel1Check1List( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel1Check1List::~DlgRef_1Sel1Check1List()
{
}
//////////////////////////////////////////
// DlgRef_1Sel1Check1Sel
//////////////////////////////////////////
DlgRef_1Sel1Check1Sel::DlgRef_1Sel1Check1Sel( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel1Check1Sel::~DlgRef_1Sel1Check1Sel()
{
}
//////////////////////////////////////////
// DlgRef_1Sel1Check
//////////////////////////////////////////
DlgRef_1Sel1Check::DlgRef_1Sel1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel1Check::~DlgRef_1Sel1Check()
{
}
2012-08-09 13:58:02 +06:00
//////////////////////////////////////////
// DlgRef_1Sel1Frame
//////////////////////////////////////////
DlgRef_1Sel1Frame::DlgRef_1Sel1Frame( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel1Frame::~DlgRef_1Sel1Frame()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_1Sel1List1Check3Btn
//////////////////////////////////////////
DlgRef_1Sel1List1Check3Btn::DlgRef_1Sel1List1Check3Btn( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel1List1Check3Btn::~DlgRef_1Sel1List1Check3Btn()
{
}
//////////////////////////////////////////
// DlgRef_1Sel1Spin1Check
//////////////////////////////////////////
DlgRef_1Sel1Spin1Check::DlgRef_1Sel1Spin1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel1Spin1Check::~DlgRef_1Sel1Spin1Check()
{
}
//////////////////////////////////////////
// DlgRef_1Sel1Spin
//////////////////////////////////////////
DlgRef_1Sel1Spin::DlgRef_1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel1Spin::~DlgRef_1Sel1Spin()
{
}
//////////////////////////////////////////
// DlgRef_1Sel2Spin1View1Check
//////////////////////////////////////////
DlgRef_1Sel2Spin1View1Check::DlgRef_1Sel2Spin1View1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel2Spin1View1Check::~DlgRef_1Sel2Spin1View1Check()
{
}
//////////////////////////////////////////
// DlgRef_1Sel2Spin
//////////////////////////////////////////
DlgRef_1Sel2Spin::DlgRef_1Sel2Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel2Spin::~DlgRef_1Sel2Spin()
{
}
//////////////////////////////////////////
// DlgRef_1Sel3Check
//////////////////////////////////////////
DlgRef_1Sel3Check::DlgRef_1Sel3Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel3Check::~DlgRef_1Sel3Check()
{
}
//////////////////////////////////////////
// DlgRef_1Sel3Spin
//////////////////////////////////////////
DlgRef_1Sel3Spin::DlgRef_1Sel3Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel3Spin::~DlgRef_1Sel3Spin()
{
}
2012-08-09 13:58:02 +06:00
//////////////////////////////////////////
// DlgRef_1Sel3Spin2Check1Spin
//////////////////////////////////////////
DlgRef_1Sel3Spin2Check1Spin::DlgRef_1Sel3Spin2Check1Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel3Spin2Check1Spin::~DlgRef_1Sel3Spin2Check1Spin()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_1Sel3Spin1Check
//////////////////////////////////////////
DlgRef_1Sel3Spin1Check::DlgRef_1Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel3Spin1Check::~DlgRef_1Sel3Spin1Check()
{
}
//////////////////////////////////////////
// DlgRef_1Sel5Spin1Check
//////////////////////////////////////////
DlgRef_1Sel5Spin1Check::DlgRef_1Sel5Spin1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel5Spin1Check::~DlgRef_1Sel5Spin1Check()
{
}
//////////////////////////////////////////
// DlgRef_1Spin
//////////////////////////////////////////
DlgRef_1Spin::DlgRef_1Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Spin::~DlgRef_1Spin()
{
}
//////////////////////////////////////////
// DlgRef_1Sel
//////////////////////////////////////////
DlgRef_1Sel::DlgRef_1Sel( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel::~DlgRef_1Sel()
{
}
//////////////////////////////////////////
// DlgRef_1SelExt
//////////////////////////////////////////
DlgRef_1SelExt::DlgRef_1SelExt( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1SelExt::~DlgRef_1SelExt()
{
}
//////////////////////////////////////////
// DlgRef_2Sel1List1Check
//////////////////////////////////////////
DlgRef_2Sel1List1Check::DlgRef_2Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel1List1Check::~DlgRef_2Sel1List1Check()
{
}
2012-08-09 13:58:02 +06:00
//////////////////////////////////////////
// DlgRef_2Sel1List2Check
//////////////////////////////////////////
DlgRef_2Sel1List2Check::DlgRef_2Sel1List2Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel1List2Check::~DlgRef_2Sel1List2Check()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_2Sel1List
//////////////////////////////////////////
DlgRef_2Sel1List::DlgRef_2Sel1List( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel1List::~DlgRef_2Sel1List()
{
}
//////////////////////////////////////////
// DlgRef_2Sel1Spin2Check
//////////////////////////////////////////
DlgRef_2Sel1Spin2Check::DlgRef_2Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel1Spin2Check::~DlgRef_2Sel1Spin2Check()
{
}
2012-08-09 13:58:02 +06:00
//////////////////////////////////////////
// DlgRef_2Sel1Spin3Check1Spin
//////////////////////////////////////////
DlgRef_2Sel1Spin3Check1Spin::DlgRef_2Sel1Spin3Check1Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel1Spin3Check1Spin::~DlgRef_2Sel1Spin3Check1Spin()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_2Sel1Spin
//////////////////////////////////////////
DlgRef_2Sel1Spin::DlgRef_2Sel1Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel1Spin::~DlgRef_2Sel1Spin()
{
}
2012-08-09 13:58:02 +06:00
//////////////////////////////////////////
// DlgRef_2Sel1SpinInt
//////////////////////////////////////////
DlgRef_2Sel1SpinInt::DlgRef_2Sel1SpinInt( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel1SpinInt::~DlgRef_2Sel1SpinInt()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_2Sel2List
//////////////////////////////////////////
DlgRef_2Sel2List::DlgRef_2Sel2List( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel2List::~DlgRef_2Sel2List()
{
}
//////////////////////////////////////////
// DlgRef_2Sel2Spin1Check
//////////////////////////////////////////
DlgRef_2Sel2Spin1Check::DlgRef_2Sel2Spin1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel2Spin1Check::~DlgRef_2Sel2Spin1Check()
{
}
2012-08-09 13:58:02 +06:00
//////////////////////////////////////////
// DlgRef_2Sel2Spin3Check
//////////////////////////////////////////
DlgRef_2Sel2Spin3Check::DlgRef_2Sel2Spin3Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel2Spin3Check::~DlgRef_2Sel2Spin3Check()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_2Sel2Spin
//////////////////////////////////////////
DlgRef_2Sel2Spin::DlgRef_2Sel2Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel2Spin::~DlgRef_2Sel2Spin()
{
}
2012-08-09 13:58:02 +06:00
//////////////////////////////////////////
// DlgRef_2Sel2Spin1Push
//////////////////////////////////////////
DlgRef_2Sel2Spin1Push::DlgRef_2Sel2Spin1Push( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel2Spin1Push::~DlgRef_2Sel2Spin1Push()
{
}
//////////////////////////////////////////
// DlgRef_2Sel2Spin2Push
//////////////////////////////////////////
DlgRef_2Sel2Spin2Push::DlgRef_2Sel2Spin2Push( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel2Spin2Push::~DlgRef_2Sel2Spin2Push()
{
}
//////////////////////////////////////////
// DlgRef_2Sel3Spin1Check
//////////////////////////////////////////
DlgRef_2Sel3Spin1Check::DlgRef_2Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel3Spin1Check::~DlgRef_2Sel3Spin1Check()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_2Sel3Spin2Rb
//////////////////////////////////////////
DlgRef_2Sel3Spin2Rb::DlgRef_2Sel3Spin2Rb( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel3Spin2Rb::~DlgRef_2Sel3Spin2Rb()
{
}
//////////////////////////////////////////
// DlgRef_2Sel3Spin
//////////////////////////////////////////
DlgRef_2Sel3Spin::DlgRef_2Sel3Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel3Spin::~DlgRef_2Sel3Spin()
{
}
//////////////////////////////////////////
// DlgRef_2Sel
//////////////////////////////////////////
DlgRef_2Sel::DlgRef_2Sel( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Sel::~DlgRef_2Sel()
{
}
//////////////////////////////////////////
// DlgRef_2SelExt
//////////////////////////////////////////
DlgRef_2SelExt::DlgRef_2SelExt( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2SelExt::~DlgRef_2SelExt()
{
}
//////////////////////////////////////////
// DlgRef_2Spin
//////////////////////////////////////////
DlgRef_2Spin::DlgRef_2Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_2Spin::~DlgRef_2Spin()
{
}
//////////////////////////////////////////
// DlgRef_3Check
//////////////////////////////////////////
DlgRef_3Check::DlgRef_3Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Check::~DlgRef_3Check()
{
}
//////////////////////////////////////////
// DlgRef_3Radio
//////////////////////////////////////////
DlgRef_3Radio::DlgRef_3Radio( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Radio::~DlgRef_3Radio()
{
}
//////////////////////////////////////////
// DlgRef_3Radio1Sel1Spin
//////////////////////////////////////////
DlgRef_3Radio1Sel1Spin::DlgRef_3Radio1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Radio1Sel1Spin::~DlgRef_3Radio1Sel1Spin()
{
}
//////////////////////////////////////////
// DlgRef_3Sel1Check
//////////////////////////////////////////
DlgRef_3Sel1Check::DlgRef_3Sel1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Sel1Check::~DlgRef_3Sel1Check()
{
}
//////////////////////////////////////////
// DlgRef_3Sel1Spin
//////////////////////////////////////////
DlgRef_3Sel1Spin::DlgRef_3Sel1Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Sel1Spin::~DlgRef_3Sel1Spin()
{
}
2012-08-09 13:58:02 +06:00
//////////////////////////////////////////
// DlgRef_3Sel2Spin
//////////////////////////////////////////
DlgRef_3Sel2Spin::DlgRef_3Sel2Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Sel2Spin::~DlgRef_3Sel2Spin()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_3Sel3Spin1Check
//////////////////////////////////////////
DlgRef_3Sel3Spin1Check::DlgRef_3Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Sel3Spin1Check::~DlgRef_3Sel3Spin1Check()
{
}
void DlgRef_3Sel3Spin1Check::ShowRows( int fromRow, int toRow, bool toShow )
{
const int maxRows = 7;
if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
int c = gridLayout1->count();
for ( int i = 0; i < c; i++ ) {
QWidget* w = gridLayout1->itemAt( i )->widget();
int row, col, rowspan, colspan;
gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
if ( w && row >= fromRow && row <= toRow )
2012-08-09 13:58:02 +06:00
w->setVisible( toShow );
}
}
}
//////////////////////////////////////////
// DlgRef_3Sel2Check3Spin
//////////////////////////////////////////
DlgRef_3Sel2Check3Spin::DlgRef_3Sel2Check3Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Sel2Check3Spin::~DlgRef_3Sel2Check3Spin()
{
}
void DlgRef_3Sel2Check3Spin::ShowRows( int fromRow, int toRow, bool toShow )
{
const int maxRows = 8;
if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
int c = gridLayout1->count();
for ( int i = 0; i < c; i++ ) {
QWidget* w = gridLayout1->itemAt( i )->widget();
int row, col, rowspan, colspan;
gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
if ( w && row >= fromRow && row <= toRow )
w->setVisible( toShow );
2009-02-13 17:16:39 +05:00
}
}
}
//////////////////////////////////////////
// DlgRef_3Sel3Spin2Check
//////////////////////////////////////////
DlgRef_3Sel3Spin2Check::DlgRef_3Sel3Spin2Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Sel3Spin2Check::~DlgRef_3Sel3Spin2Check()
{
}
void DlgRef_3Sel3Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
{
const int maxRows = 8;
if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
int c = gridLayout1->count();
for ( int i = 0; i < c; i++ ) {
QWidget* w = gridLayout1->itemAt( i )->widget();
int row, col, rowspan, colspan;
gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
if ( w && row >= fromRow && row <= toRow )
2012-08-09 13:58:02 +06:00
w->setVisible( toShow );
2009-02-13 17:16:39 +05:00
}
}
}
//////////////////////////////////////////
// DlgRef_3Sel4Spin2Check
//////////////////////////////////////////
DlgRef_3Sel4Spin2Check::DlgRef_3Sel4Spin2Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Sel4Spin2Check::~DlgRef_3Sel4Spin2Check()
{
}
//////////////////////////////////////////
// DlgRef_3Sel
//////////////////////////////////////////
DlgRef_3Sel::DlgRef_3Sel( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Sel::~DlgRef_3Sel()
{
}
//////////////////////////////////////////
// DlgRef_3Spin1Check
//////////////////////////////////////////
DlgRef_3Spin1Check::DlgRef_3Spin1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Spin1Check::~DlgRef_3Spin1Check()
{
}
//////////////////////////////////////////
// DlgRef_3Spin1CheckCyl
//////////////////////////////////////////
DlgRef_3Spin1CheckCyl::DlgRef_3Spin1CheckCyl( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Spin1CheckCyl::~DlgRef_3Spin1CheckCyl()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_3Spin
//////////////////////////////////////////
DlgRef_3Spin::DlgRef_3Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_3Spin::~DlgRef_3Spin()
{
}
2012-08-09 13:58:02 +06:00
//////////////////////////////////////////
// DlgRef_4Spin
//////////////////////////////////////////
DlgRef_4Spin::DlgRef_4Spin( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_4Spin::~DlgRef_4Spin()
{
}
2009-02-13 17:16:39 +05:00
//////////////////////////////////////////
// DlgRef_4Sel1List1Check
//////////////////////////////////////////
DlgRef_4Sel1List1Check::DlgRef_4Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_4Sel1List1Check::~DlgRef_4Sel1List1Check()
{
}
//////////////////////////////////////////
// DlgRef_4Sel1List
//////////////////////////////////////////
DlgRef_4Sel1List::DlgRef_4Sel1List( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_4Sel1List::~DlgRef_4Sel1List()
{
}
//////////////////////////////////////////
// DlgRef_4Sel1Spin2Check
//////////////////////////////////////////
DlgRef_4Sel1Spin2Check::DlgRef_4Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_4Sel1Spin2Check::~DlgRef_4Sel1Spin2Check()
{
}
void DlgRef_4Sel1Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
{
const int maxRows = 6;
if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
int c = gridLayout1->count();
for ( int i = 0; i < c; i++ ) {
QWidget* w = gridLayout1->itemAt( i )->widget();
int row, col, rowspan, colspan;
gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
if ( w && row >= fromRow && row <= toRow )
2012-08-09 13:58:02 +06:00
w->setVisible( toShow );
2009-02-13 17:16:39 +05:00
}
}
}
//////////////////////////////////////////
// DlgRef_4Sel1Spin3Check
//////////////////////////////////////////
DlgRef_4Sel1Spin3Check::DlgRef_4Sel1Spin3Check( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_4Sel1Spin3Check::~DlgRef_4Sel1Spin3Check()
{
}
//////////////////////////////////////////
// DlgRef_6Sel
//////////////////////////////////////////
DlgRef_6Sel::DlgRef_6Sel( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_6Sel::~DlgRef_6Sel()
{
}
//////////////////////////////////////////
// Utility functions
//////////////////////////////////////////
QString DlgRef::PrintDoubleValue( double theValue, int thePrecision )
{
const double prec = 1e-12;
2012-08-09 13:58:02 +06:00
if ( qAbs(theValue) < prec )
2009-02-13 17:16:39 +05:00
return "0";
QLocale loc = QLocale(); // default locale
if ( loc.name() == "C" ) loc.setNumberOptions( QLocale::OmitGroupSeparator );
QString aRes = loc.toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) );
2009-02-13 17:16:39 +05:00
if ( prec > 0 ) {
int p = 0;
while ( p < thePrecision ) {
QString aRes = loc.toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( p++ ) );
2009-02-13 17:16:39 +05:00
double v = aRes.toDouble();
double err = qAbs( theValue - v );
if ( err > 0 && err <= prec )
2012-08-09 13:58:02 +06:00
break;
2009-02-13 17:16:39 +05:00
}
}
// remove trailing zeroes
QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( loc.exponential().toLower(),
loc.exponential().toUpper() ) );
2009-02-13 17:16:39 +05:00
2012-08-09 13:58:02 +06:00
int idx = aRes.indexOf( expre );
QString aResExp = "";
if ( idx >= 0 ) {
aResExp = aRes.mid( idx );
aRes = aRes.left( idx );
}
2009-02-13 17:16:39 +05:00
if ( aRes.contains( loc.decimalPoint() ) )
2012-08-09 13:58:02 +06:00
aRes.remove( QRegExp( QString( "(\\%1|0)0*$" ).arg( QLocale().decimalPoint() ) ) );
2009-02-13 17:16:39 +05:00
2012-08-09 13:58:02 +06:00
return aRes == "-0" ? QString( "0" ) : aRes + aResExp;
2009-02-13 17:16:39 +05:00
}