示例#1
0
lc_Sampledlg::lc_Sampledlg(QWidget *parent) :  QDialog(parent)
{
    setWindowTitle(tr("Draw line"));
    QLabel *label;

    QDoubleValidator *val = new QDoubleValidator(0);
    QGridLayout *mainLayout = new QGridLayout;

    label = new QLabel(tr("Start X:"));
    mainLayout->addWidget(label, 0, 0);
    startxedit = new QLineEdit();
    startxedit->setValidator(val);
    mainLayout->addWidget(startxedit, 1, 0);

    label = new QLabel(tr("Start Y:"));
    mainLayout->addWidget(label, 0, 1);
    startyedit = new QLineEdit();
    startyedit->setValidator(val);
    mainLayout->addWidget(startyedit, 1, 1);

    label = new QLabel(tr("End X:"));
    mainLayout->addWidget(label, 2, 0);
    endxedit = new QLineEdit();
    endxedit->setValidator(val);
    mainLayout->addWidget(endxedit, 3, 0);

    label = new QLabel(tr("End Y:"));
    mainLayout->addWidget(label, 2, 1);
    endyedit = new QLineEdit();
    endyedit->setValidator(val);
    mainLayout->addWidget(endyedit, 3, 1);


    QHBoxLayout *loaccept = new QHBoxLayout;
    QPushButton *acceptbut = new QPushButton(tr("Accept"));
    loaccept->addStretch();
    loaccept->addWidget(acceptbut);
    mainLayout->addLayout(loaccept, 4, 0);

    QPushButton *cancelbut = new QPushButton(tr("Cancel"));
    QHBoxLayout *locancel = new QHBoxLayout;
    locancel->addWidget(cancelbut);
    locancel->addStretch();
    mainLayout->addLayout(locancel, 4, 1);

    setLayout(mainLayout);
    readSettings();

    connect(cancelbut, SIGNAL(clicked()), this, SLOT(reject()));
    connect(acceptbut, SIGNAL(clicked()), this, SLOT(checkAccept()));
}
示例#2
0
void LedgerMaster::switchLedgers(Ledger::ref lastClosed, Ledger::ref current)
{
	assert(lastClosed && current);

	{
		boost::recursive_mutex::scoped_lock ml(mLock);
		mFinalizedLedger = lastClosed;
		mFinalizedLedger->setClosed();
		mFinalizedLedger->setAccepted();
		mCurrentLedger = current;
	}

	assert(!mCurrentLedger->isClosed());
	mEngine.setLedger(mCurrentLedger);
	checkAccept(lastClosed->getHash(), lastClosed->getLedgerSeq());
}
示例#3
0
void LedgerMaster::pushLedger(Ledger::ref newLCL, Ledger::ref newOL, bool fromConsensus)
{
	assert(newLCL->isClosed() && newLCL->isAccepted());
	assert(!newOL->isClosed() && !newOL->isAccepted());

	if (newLCL->isAccepted())
	{
		assert(newLCL->isClosed());
		assert(newLCL->isImmutable());
		mLedgerHistory.addAcceptedLedger(newLCL, fromConsensus);
		cLog(lsINFO) << "StashAccepted: " << newLCL->getHash();
	}

	{
		boost::recursive_mutex::scoped_lock ml(mLock);
		mFinalizedLedger = newLCL;
		mCurrentLedger = newOL;
		mEngine.setLedger(newOL);
	}
	checkAccept(newLCL->getHash(), newLCL->getLedgerSeq());
}
示例#4
0
picPunto::picPunto(QWidget *parent) :  QDialog(parent)
{
    cnt = 0;    
    QStringList txtformats;

    QGridLayout *mainLayout = new QGridLayout;
//readSettings();

    QPushButton *filebut = new QPushButton(tr("File..."));
    fileedit = new QLineEdit();

    QDoubleValidator *val = new QDoubleValidator(0);
    val->setBottom ( 0.0 );
    scaleedit = new QLineEdit();
    scaleedit->setValidator(val);

    QFormLayout *flo = new QFormLayout;
    flo->addRow( filebut, fileedit);
    flo->addRow( tr("Scale:"), scaleedit);
    mainLayout->addLayout(flo, 0, 0);

    QHBoxLayout *loacceptcancel = new QHBoxLayout;
    QPushButton *acceptbut = new QPushButton(tr("Accept"));
    loacceptcancel->addStretch();
    loacceptcancel->addWidget(acceptbut);

    QPushButton *cancelbut = new QPushButton(tr("Cancel"));
    loacceptcancel->addWidget(cancelbut);
    mainLayout->addLayout(loacceptcancel, 1, 0);

    setLayout(mainLayout);
    readSettings();

    connect(cancelbut, SIGNAL(clicked()), this, SLOT(reject()));
    connect(acceptbut, SIGNAL(clicked()), this, SLOT(checkAccept()));

    connect(filebut, SIGNAL(clicked()), this, SLOT(dptFile()));
}
示例#5
0
dibPunto::dibPunto(QWidget *parent) :  QDialog(parent)
{
//    setParent(parent);
    setWindowTitle(tr("Read ascii points"));
    QStringList txtformats;

    QGridLayout *mainLayout = new QGridLayout;
//readSettings();

    QPushButton *filebut = new QPushButton(tr("File..."));
    fileedit = new QLineEdit();
    QHBoxLayout *lofile = new QHBoxLayout;
    lofile->addWidget(filebut);
    lofile->addWidget(fileedit);
    mainLayout->addLayout(lofile, 0, 0);

    QLabel *formatlabel = new QLabel(tr("Format:"));
    formatedit = new QComboBox();
    txtformats << tr("Space Separator") << tr("Tab Separator") << tr("Comma Separator") << tr("Space in Columns") << tr("*.odb for Psion 2");
    formatedit->addItems(txtformats);
    connectPoints = new QCheckBox(tr("Connect points"));

    QHBoxLayout *loformat = new QHBoxLayout;
    loformat->addWidget(formatlabel);
    loformat->addWidget(formatedit);
    loformat->addWidget(connectPoints);
    mainLayout->addLayout(loformat, 0, 1);

    pt2d = new pointBox(tr("2D Point"),tr("Draw 2D Point"));
    pt3d = new pointBox(tr("3D Point"),tr("Draw 3D Point"));
    ptnumber = new textBox(tr("Point Number"),tr("Draw point number"));
    ptelev = new textBox(tr("Point Elevation"),tr("Draw point elevation"));
    ptcode = new textBox(tr("Point Code"),tr("Draw point code"));
    ptnumber->setPos(DPT::NO);

    QVBoxLayout *lo2d3d = new QVBoxLayout;

    lo2d3d->addWidget(pt2d);
    lo2d3d->addWidget(pt3d);
    mainLayout->addLayout(lo2d3d, 1, 0);

    mainLayout->addWidget(ptnumber, 1, 1);
    mainLayout->addWidget(ptelev, 2, 0);
    mainLayout->addWidget(ptcode, 2, 1);

    QHBoxLayout *loaccept = new QHBoxLayout;
    QPushButton *acceptbut = new QPushButton(tr("Accept"));
    loaccept->addStretch();
    loaccept->addWidget(acceptbut);
    mainLayout->addLayout(loaccept, 3, 0);

    QPushButton *cancelbut = new QPushButton(tr("Cancel"));
    QHBoxLayout *locancel = new QHBoxLayout;
    locancel->addWidget(cancelbut);
    locancel->addStretch();
    mainLayout->addLayout(locancel, 3, 1);

    setLayout(mainLayout);
    readSettings();

    connect(cancelbut, SIGNAL(clicked()), this, SLOT(reject()));
    connect(acceptbut, SIGNAL(clicked()), this, SLOT(checkAccept()));

    connect(filebut, SIGNAL(clicked()), this, SLOT(dptFile()));
}
示例#6
0
lc_tankdlg::lc_tankdlg(QWidget *parent) :  QDialog(parent)
{
    setWindowTitle(tr("3 Views of Cuboid having tank"));
    QLabel *label;

    QDoubleValidator *val = new QDoubleValidator(0);
    QGridLayout *mainLayout = new QGridLayout;


         label = new QLabel(tr("Enter Start x Coordinate:"));
         mainLayout->addWidget(label, 0, 0);
         startxedit = new QLineEdit();
         startxedit->setValidator(val);
         mainLayout->addWidget(startxedit, 0, 1);


         label = new QLabel(tr("Enter Start y Coordinate:"));
         mainLayout->addWidget(label, 1, 0);
         startyedit = new QLineEdit();
         startyedit->setValidator(val);
         mainLayout->addWidget(startyedit, 1, 1);

         label = new QLabel(tr("Top View Layer:"));
         mainLayout->addWidget(label, 0, 2);
         topedit = new QLineEdit();
        // startxedit->setValidator(val);
         mainLayout->addWidget(topedit, 0, 3);

         label = new QLabel(tr("Color:"));
         mainLayout->addWidget(label, 0,5);
         topcoloredit = new QComboBox();
         QStringList txtstyles;
         txtstyles << "Red" << "Blue" << "Green"<<"White";
         topcoloredit->addItems(txtstyles);
         mainLayout->addWidget(topcoloredit, 0,6);

         label = new QLabel(tr("Front View Layer:"));
         mainLayout->addWidget(label, 1, 2);
         frontedit = new QLineEdit();
        // startxedit->setValidator(val);
         mainLayout->addWidget(frontedit, 1, 3);

         label = new QLabel(tr("Color:"));
         mainLayout->addWidget(label, 1,5);
         frontcoloredit = new QComboBox();
         frontcoloredit->addItems(txtstyles);
         mainLayout->addWidget(frontcoloredit, 1,6);

         label = new QLabel(tr("Side View Layer"));
         mainLayout->addWidget(label, 2, 2);
         sideedit = new QLineEdit();
        // startxedit->setValidator(val);
         mainLayout->addWidget(sideedit, 2, 3);

         label = new QLabel(tr("Color:"));
         mainLayout->addWidget(label, 2,5);
         sidecoloredit = new QComboBox();
         sidecoloredit->addItems(txtstyles);
         mainLayout->addWidget(sidecoloredit, 2,6);

         label = new QLabel(tr("Length:"));
         mainLayout->addWidget(label, 2, 0);
         lengthedit = new QLineEdit();
         lengthedit->setValidator(val);
         mainLayout->addWidget(lengthedit, 2, 1);

        label = new QLabel(tr("Height:"));
        mainLayout->addWidget(label, 3,0);
        heightedit = new QLineEdit();
        heightedit->setValidator(val);
        mainLayout->addWidget(heightedit, 3, 1);

        label = new QLabel(tr("Width:"));
        mainLayout->addWidget(label, 4, 0);
        widthedit = new QLineEdit();
        widthedit->setValidator(val);
        mainLayout->addWidget(widthedit, 4, 1);


        label = new QLabel(tr("Cylinder Height:"));
        mainLayout->addWidget(label, 5, 0);
        cycheight = new QLineEdit();
        cycheight->setValidator(val);
        mainLayout->addWidget(cycheight,5, 1);

        label = new QLabel(tr("Cylinder Radius:"));
        mainLayout->addWidget(label, 6, 0);
        cycradius = new QLineEdit();
        cycradius->setValidator(val);
        mainLayout->addWidget(cycradius, 6, 1);

        label = new QLabel(tr("Spacing between views"));
        mainLayout->addWidget(label, 7, 0);
        spaceedit = new QLineEdit();
        spaceedit->setValidator(val);
        mainLayout->addWidget(spaceedit, 7, 1);


        QHBoxLayout *loaccept = new QHBoxLayout;
        QPushButton *acceptbut = new QPushButton(tr("Accept"));
        loaccept->addStretch();
        loaccept->addWidget(acceptbut);
        mainLayout->addLayout(loaccept, 8, 0);

        QPushButton *cancelbut = new QPushButton(tr("Cancel"));
        QHBoxLayout *locancel = new QHBoxLayout;
        locancel->addWidget(cancelbut);
        locancel->addStretch();
        mainLayout->addLayout(locancel, 8, 1);

        setLayout(mainLayout);
        readSettings();

        connect(cancelbut, SIGNAL(clicked()), this, SLOT(reject()));
        connect(acceptbut, SIGNAL(clicked()), this, SLOT(checkAccept()));
    }
示例#7
0
文件: text.cpp 项目: lenovo15/abc
lc_Sampledlg::lc_Sampledlg(QWidget *parent) :  QDialog(parent)
{
    setWindowTitle(tr("Text Display"));
    QLabel *label;

    QDoubleValidator *val = new QDoubleValidator(0);
    QGridLayout *mainLayout = new QGridLayout;

   /* QLabel *alignmentLabel = new QLabel(tr("Verical Alignment"));
    QComboBox *alignmentComboBox = new QComboBox;
    alignmentComboBox->addItem(tr("Left"));
    alignmentComboBox->addItem(tr("Centered"));
    alignmentComboBox->addItem(tr("Right"));
*/
  /*  mainLayout->addWidget(alignmentLabel, 0, 1);
    mainLayout>addWidget(alignmentComboBox, 0, 1);

    mainLayout-> setLayout(alignmentLayout);
  */
    label= new QLabel("Enter text");
    mainLayout->addWidget(label, 0, 0);
    textedit = new QLineEdit();
    //textedit->setValidator(val);
    mainLayout->addWidget(textedit, 1, 0);

    label = new QLabel(tr("Enter X:"));
    mainLayout->addWidget(label, 2, 0);
    startxedit = new QLineEdit();
    startxedit->setValidator(val);
    mainLayout->addWidget(startxedit, 3, 0);

    label = new QLabel(tr("Start Y:"));
    mainLayout->addWidget(label, 2, 1);
    startyedit = new QLineEdit();
    startyedit->setValidator(val);
    mainLayout->addWidget(startyedit, 3, 1);

    label = new QLabel(tr("Enter height"));
    mainLayout->addWidget(label, 4, 0);
    heightedit = new QLineEdit();
    heightedit->setValidator(val);
    mainLayout->addWidget(heightedit, 5, 0);

    label = new QLabel(tr("Enter angle"));
    mainLayout->addWidget(label, 4, 1);
    angleedit = new QLineEdit();
    angleedit->setValidator(val);
    mainLayout->addWidget(angleedit, 5, 1);



    QHBoxLayout *loaccept = new QHBoxLayout;
    QPushButton *acceptbut = new QPushButton(tr("Accept"));
    loaccept->addStretch();
    loaccept->addWidget(acceptbut);
    mainLayout->addLayout(loaccept, 6, 0);

    QPushButton *cancelbut = new QPushButton(tr("Cancel"));
    QHBoxLayout *locancel = new QHBoxLayout;
    locancel->addWidget(cancelbut);
    locancel->addStretch();
    mainLayout->addLayout(locancel, 6, 1);

    setLayout(mainLayout);
    readSettings();

    connect(cancelbut, SIGNAL(clicked()), this, SLOT(reject()));
    connect(acceptbut, SIGNAL(clicked()), this, SLOT(checkAccept()));
   // connect(alignmentComboBox, SIGNAL(activated(int)),this, SLOT(alignmentChanged(int)));
}
示例#8
0
dibSHP::dibSHP(QWidget *parent) :  QDialog(parent)
{
    QVBoxLayout *mainLayout = new QVBoxLayout;

    QPushButton *filebut = new QPushButton(tr("File..."));
    fileedit = new QLineEdit();
    QHBoxLayout *lofile = new QHBoxLayout;
    lofile->addWidget(filebut);
    lofile->addWidget(fileedit);
    lofile->setSizeConstraint(QLayout::SetFixedSize);//ni caso
    mainLayout->addLayout(lofile);

    QLabel *formatlabel = new QLabel(tr("File type:"));
    formattype = new QLabel(tr("Unknoun"));
    QHBoxLayout *loformat = new QHBoxLayout;
    loformat->addWidget(formatlabel);
    loformat->addWidget(formattype);
    loformat->addStretch();
    mainLayout->addLayout(loformat);

    QGroupBox *laybox = new QGroupBox(tr("Layer"));
    radiolay1 = new QRadioButton(tr("Current"));
    QRadioButton *radiolay2 = new QRadioButton(tr("From data:"));
    layerdata = new QComboBox();
    radiolay1->setChecked(true);
    QHBoxLayout *laylayout = new QHBoxLayout;
    laylayout->addWidget(radiolay1);
    laylayout->addWidget(radiolay2);
    laylayout->addWidget(layerdata);
    laylayout->addStretch(0);
    laybox->setLayout(laylayout);
    mainLayout->addWidget(laybox);

    QGroupBox *colbox = new QGroupBox(tr("Color"));
    radiocol1 = new QRadioButton(tr("Current"));
    QRadioButton *radiocol2 = new QRadioButton(tr("From data:"));
    colordata = new QComboBox();
    radiocol1->setChecked(true);
    QHBoxLayout *collayout = new QHBoxLayout;
    collayout->addWidget(radiocol1);
    collayout->addWidget(radiocol2);
    collayout->addWidget(colordata);
    collayout->addStretch(1);
    colbox->setLayout(collayout);
    mainLayout->addWidget(colbox);

    QGroupBox *ltypebox = new QGroupBox(tr("Line type"));
    radioltype1 = new QRadioButton(tr("Current"));
    QRadioButton *radioltype2 = new QRadioButton(tr("From data:"));
    ltypedata = new QComboBox();
    radioltype1->setChecked(true);
    QHBoxLayout *ltypelayout = new QHBoxLayout;
    ltypelayout->addWidget(radioltype1);
    ltypelayout->addWidget(radioltype2);
    ltypelayout->addWidget(ltypedata);
    ltypelayout->addStretch(1);
    ltypebox->setLayout(ltypelayout);
    mainLayout->addWidget(ltypebox);

    QGroupBox *lwidthbox = new QGroupBox(tr("Width"));
    radiolwidth1 = new QRadioButton(tr("Current"));
    QRadioButton *radiolwidth2 = new QRadioButton(tr("From data:"));
    lwidthdata = new QComboBox();
    radiolwidth1->setChecked(true);
    QHBoxLayout *lwidthlayout = new QHBoxLayout;
    lwidthlayout->addWidget(radiolwidth1);
    lwidthlayout->addWidget(radiolwidth2);
    lwidthlayout->addWidget(lwidthdata);
    lwidthlayout->addStretch(1);
    lwidthbox->setLayout(lwidthlayout);
    mainLayout->addWidget(lwidthbox);

    pointbox = new QGroupBox(tr("Point"));
    radiopoint1 = new QRadioButton(tr("as Point"));
    QRadioButton *radiopoint2 = new QRadioButton(tr("as Label:"));
    pointdata = new QComboBox();
    radiopoint1->setChecked(true);
    QHBoxLayout *pointlayout = new QHBoxLayout;
    pointlayout->addWidget(radiopoint1);
    pointlayout->addWidget(radiopoint2);
    pointlayout->addWidget(pointdata);
    pointlayout->addStretch(1);
    pointbox->setLayout(pointlayout);
    mainLayout->addWidget(pointbox);

    QHBoxLayout *loaccept = new QHBoxLayout;
    QPushButton *acceptbut = new QPushButton(tr("Accept"));
    QPushButton *cancelbut = new QPushButton(tr("Cancel"));
    loaccept->addStretch();
    loaccept->addWidget(acceptbut);
    loaccept->addWidget(cancelbut);
    loaccept->addStretch();
    mainLayout->addLayout(loaccept);

    setLayout(mainLayout);
    readSettings();
    updateFile();

    connect(cancelbut, SIGNAL(clicked()), this, SLOT(reject()));
    connect(acceptbut, SIGNAL(clicked()), this, SLOT(checkAccept()));
    connect(filebut, SIGNAL(clicked()), this, SLOT(getFile()));
    connect(fileedit, SIGNAL(editingFinished()), this, SLOT(updateFile()));
}