本文整理汇总了C++中QC_ApplicationWindow::getMDIWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ QC_ApplicationWindow::getMDIWindow方法的具体用法?C++ QC_ApplicationWindow::getMDIWindow怎么用?C++ QC_ApplicationWindow::getMDIWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QC_ApplicationWindow
的用法示例。
在下文中一共展示了QC_ApplicationWindow::getMDIWindow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trigger
void RS_ActionBlocksSave::trigger() {
RS_DEBUG->print("save block to file");
QC_ApplicationWindow* appWindow = QC_ApplicationWindow::getAppWindow();
if(!appWindow) {
finish(false);
return;
}
RS_BlockList* bList = appWindow->getBlockWidget() -> getBlockList();
if (bList) {
auto b=bList->getActive();
if(b) {
RS_Graphic g(nullptr);
g.setOwner(false);
g.clearLayers();
// g.addLayer(b->getLayer());
for (RS_Entity* e=b->firstEntity(RS2::ResolveNone);
e;
e = b->nextEntity(RS2::ResolveNone)) {
g.addEntity(e);
if (e->rtti() == RS2::EntityInsert) {
RS_Insert *in = static_cast<RS_Insert *>(e);
g.addBlock(in->getBlockForInsert());
addBlock(in,&g);
}
// std::cout<<__FILE__<<" : "<<__func__<<" : line: "<<__LINE__<<" : "<<e->rtti()<<std::endl;
// g.addLayer(e->getLayer());
// std::cout<<__FILE__<<" : "<<__func__<<" : line: "<<__LINE__<<" : "<<e->rtti()<<std::endl;
}
// std::cout<<__FILE__<<" : "<<__func__<<" : line: "<<__LINE__<<std::endl;
// std::cout<<"add layer name="<<qPrintable(b->getLayer()->getName())<<std::endl;
RS2::FormatType t = RS2::FormatDXFRW;
QG_FileDialog dlg(appWindow->getMDIWindow(),0, QG_FileDialog::BlockFile);
QString const& fn = dlg.getSaveFile(&t);
QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) );
// g.setModified(true);
g.saveAs(fn, t);
QApplication::restoreOverrideCursor();
} else {
if (RS_DIALOGFACTORY) {
RS_DIALOGFACTORY->commandMessage(tr("No block activated to save"));
}
}
} else {
RS_DEBUG->print(RS_Debug::D_WARNING,
"RS_ActionBlocksSave::trigger(): blockList is NULL");
}
finish(false);
}
示例2: requestEditBlockWindow
/**
* Provides a new window for editing the active block.
*/
void QC_DialogFactory::requestEditBlockWindow(RS_BlockList* blockList) {
RS_DEBUG->print("QC_DialogFactory::requestEditBlockWindow()");
QC_ApplicationWindow* appWindow = QC_ApplicationWindow::getAppWindow();
QC_MDIWindow* parent = appWindow->getMDIWindow();
if (parent!=NULL) {
//RS_BlockList* blist = blockWidget->getBlockList();
if (blockList!=NULL) {
RS_Block* blk = blockList->getActive();
if (blk!=NULL) {
QC_MDIWindow* w = appWindow->slotFileNew(blk);
// the parent needs a pointer to the block window and
// vice versa
parent->addChildWindow(w);
w->getGraphicView()->zoomAuto(false);
}
}
}
}
示例3: requestEditBlockWindow
/**
* Provides a new window for editing the active block.
*/
void QC_DialogFactory::requestEditBlockWindow(RS_BlockList* /*blockList*/) {
RS_DEBUG->print("QC_DialogFactory::requestEditBlockWindow()");
QC_ApplicationWindow* appWindow = QC_ApplicationWindow::getAppWindow();
QC_MDIWindow* parent = appWindow->getMDIWindow();
if (parent!=NULL) {
//get blocklist from block widget, bug#3497154
RS_BlockList* blist = appWindow->getBlockWidget() -> getBlockList();
if (blist !=NULL) {
RS_Block* blk = blist->getActive();
// std::cout<<"QC_DialogFactory::requestEditBlockWindow(): size()="<<((blk==NULL)?0:blk->count() )<<std::endl;
if (blk!=NULL) {
QC_MDIWindow* w = appWindow->slotFileNew(blk);
// the parent needs a pointer to the block window and
// vice versa
parent->addChildWindow(w);
w->getGraphicView()->zoomAuto(false);
//update grid settings, bug#3443293
w->getGraphicView()->getGrid()->updatePointArray();
}
}
}
}