qg_blockdialog.ui.h

来自「Linux下一个开源的CAD软件」· C头文件 代码 · 共 60 行

H
60
字号
/****************************************************************************** ui.h extension file, included from the uic-generated form implementation.**** If you wish to add, delete or rename slots use Qt Designer which will** update this file, preserving your code. Create an init() slot in place of** a constructor, and a destroy() slot in place of a destructor.*****************************************************************************/void QG_BlockDialog::setBlockList(RS_BlockList* l) {	RS_DEBUG->print("QG_BlockDialog::setBlockList");	    blockList = l;    if (blockList!=NULL) {        RS_Block* block = blockList->getActive();        if (block!=NULL) {            leName->setText(block->getName());        } else {            RS_DEBUG->print(RS_Debug::D_ERROR, 				"QG_BlockDialog::setBlockList: No block active.");        }    }}RS_BlockData QG_BlockDialog::getBlockData() {    /*if (blockList!=NULL) {      RS_Block* block = blockList->getActive();        if (block!=NULL) {           return blockList->rename(block, leName->text().latin1());        }}    return false;*/    return RS_BlockData(leName->text(), RS_Vector(0.0,0.0), false);}void QG_BlockDialog::validate() {    QString name = leName->text();    if (!name.isEmpty()) {        if (blockList!=NULL && blockList->find(name)==NULL) {            accept();        } else {            QMessageBox::warning( this, tr("Renaming Block"),                                  tr("Could not name block. A block named \"%1\" "                                     "already exists.").arg(leName->text()),                                  QMessageBox::Ok,                                  QMessageBox::NoButton);        }    }    //else {    //reject();    //}}void QG_BlockDialog::cancel() {    leName->setText("");    reject();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?