本文整理汇总了C++中TextWidget::setIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ TextWidget::setIcon方法的具体用法?C++ TextWidget::setIcon怎么用?C++ TextWidget::setIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextWidget
的用法示例。
在下文中一共展示了TextWidget::setIcon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char **argv )
{
int i;
QString m1,n1,o1;
struct args pargs;
QApplication *a;
InitWidget *b;
ScreenWidget *c;
TextWidget *textOut;
QProgressDialog *qProg;
QPixmap *qpxMeshIcon=NULL;
struct model_error model1,model2;
int rcode;
struct outbuf *log;
struct prog_reporter pr;
/* Initialize application */
a = NULL;
b = NULL;
c = NULL;
qProg = NULL;
memset(&model1,0,sizeof(model1));
memset(&model2,0,sizeof(model2));
memset(&pr,0,sizeof(pr));
log = NULL;
i = 0;
while (i<argc) {
if (strcmp(argv[i],"-t") == 0) /* text version requested */
break;
if (strcmp(argv[i],"-h") == 0) /* just asked for command line help */
break;
i++;
}
if (i == argc) { /* no text version requested, initialize QT */
a = new QApplication( argc, argv );
/* Load pixmap for icon */
qpxMeshIcon = new QPixmap((const char**)meshIcon);
if (a != NULL) a->connect( a, SIGNAL(lastWindowClosed()),
a, SLOT(quit()) );
} else {
a = NULL; /* No QT app needed */
}
/* Parse arguments */
parse_args(argc,argv,&pargs);
/* Display starting dialog if insufficient arguments */
if (pargs.m1_fname != NULL || pargs.m2_fname != NULL) {
if (pargs.m1_fname == NULL || pargs.m2_fname == NULL) {
fprintf(stderr,"ERROR: missing file name(s) in command line\n");
exit(1);
}
if (!pargs.do_wlog) {
log = outbuf_new(stdio_puts,stdout);
}
else {
textOut = new TextWidget();
textOut->setIcon(*qpxMeshIcon);
log = outbuf_new(TextWidget_puts,textOut);
textOut->show();
}
if (pargs.no_gui) {
pr.prog = stdio_prog;
pr.cb_out = stdout;
} else {
qProg = new QProgressDialog("Calculating distance",0,100);
qProg->setIcon(*qpxMeshIcon);
qProg->setMinimumDuration(1500);
pr.prog = QT_prog;
pr.cb_out = qProg;
}
mesh_run(&pargs, &model1, &model2, log, &pr);
} else {
b = new InitWidget(pargs, &model1, &model2);
b->setIcon(*qpxMeshIcon);
b->show();
}
if (a != NULL) {
if (pargs.m1_fname != NULL || pargs.m2_fname != NULL) {
c = new ScreenWidget(&model1, &model2, &pargs);
c->setIcon(*qpxMeshIcon);
a->setMainWidget(c);
c->show();
}
rcode = a->exec();
} else {
rcode = 0;
}
/* Free widgets */
outbuf_delete(log);
delete qProg;
delete qpxMeshIcon;
delete b;
delete c;
delete a; // QApplication must be last QT thing to delete
/* Free model data */
if (model1.mesh != NULL) __free_raw_model(model1.mesh);
free(model1.verror);
free(model1.info);
//.........这里部分代码省略.........