当前位置: 首页>>代码示例>>C++>>正文


C++ QWidget::isA方法代码示例

本文整理汇总了C++中QWidget::isA方法的典型用法代码示例。如果您正苦于以下问题:C++ QWidget::isA方法的具体用法?C++ QWidget::isA怎么用?C++ QWidget::isA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QWidget的用法示例。


在下文中一共展示了QWidget::isA方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: resizeBarDragged

void ReportSection::resizeBarDragged(int delta) {
    if(canvasview->document() && canvasview->document()->pageOptions
        && canvasview->document()->pageOptions->getPageSize() == "Labels") {
        return; // we don't want to allow this on reports that are for labels
    }

    int h = canvas->height() + delta;
    if(h < 1) h = 1;
    if(grid->isSnap()) {
        int incr = (int)(grid->yInterval() * dpiY);
        int nh = (h / incr) * incr;
        if(nh == 0) nh = incr;
        h = nh;
    }
    canvas->resize(canvas->width(), h);

    //resize(width(), h + title->height() + 5);
    if(canvasview->document()) canvasview->document()->setModified(TRUE);

    adjustSize();
    QWidget * w = parentWidget();
    if(w)
    {
      w->adjustSize();
      if(w->isA("ReportSectionDetail"))
        w->parentWidget()->adjustSize();
    }
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:28,代码来源:reportsection.cpp

示例2: raiseTab

void ZLQtOptionsDialog::raiseTab(int i) {
	myTabWidget->raiseWidget(i);
	QWidget *title = getTitleBarWidget();
	if(title->isA("QLabel")) {
		QString s = ::qtString(ZLOptionsDialog::caption());
		s.append(" - ");
		s.append(::qtString((*myTabs[i]).displayName()));
		s.replace(QRegExp("[<]"), "&lt;");
		s.replace(QRegExp("[>]"), "&gt;");
		((QLabel *)title)->setText(s);
	}
}
开发者ID:justsoso8,项目名称:fbreader,代码行数:12,代码来源:ZLQtOptionsDialog.cpp

示例3: f

ZLQtOptionsDialog::ZLQtOptionsDialog(const ZLResource &resource, shared_ptr<ZLRunnable> applyAction) : ZLFullScreenDialog(std::string("X3")), ZLOptionsDialog(resource, applyAction) {
	QWidget *title = getTitleBarWidget();
	if (title->isA("QLabel")) {
		((QLabel *)title)->setText(::qtString(ZLOptionsDialog::caption()));
	}

	myTabWidget = new MyQTabWidget(this);
	setContentWidget(myTabWidget);

	UTIL_CST *cst = (UTIL_CST*)getCSTWidget();
	myMenu = new QPopupMenu(cst);
	QFont f(qApp->font());
	f.setPointSize(15);
	myMenu->setFont(f);
	connect(myMenu, SIGNAL(activated(int)), this, SLOT(selectTab(int)));
	cst->getLeftBtn()->setEnabled(true);
	cst->getLeftBtn()->setPopup(myMenu);
}
开发者ID:justsoso8,项目名称:fbreader,代码行数:18,代码来源:ZLQtOptionsDialog.cpp

示例4: set


//.........这里部分代码省略.........

//  Start to create the new Poitem
          ParameterList newItemParams;
          newItemParams.append("mode", "new");
          newItemParams.append("pohead_id", _poheadid);
          newItemParams.append("itemsrc_id", itemsrcid);

          if (qty > 0.0)
            newItemParams.append("qty", qty);

          if (!dueDate.isNull())
            newItemParams.append("dueDate", dueDate);

          if (parentwo != -1)
            newItemParams.append("parentWo", parentwo);

          if (parentso != -1)
            newItemParams.append("parentSo", parentso);

          if (prjid != -1)
            newItemParams.append("prj_id", prjid);

          purchaseOrderItem poItem(this, "", TRUE);
          poItem.set(newItemParams);
          if (poItem.exec() != XDialog::Rejected)
          {
            if(_mode == cEdit)
            {
              // check for another open window
              QWidgetList list = omfgThis->windowList();
              for(int i = 0; i < list.size(); i++)
              {
                QWidget * w = list.at(i);
                if(w->isA("purchaseOrder") && w != this)
                {
                  purchaseOrder *other = (purchaseOrder*)w;
                  if(_poheadid == other->_poheadid)
                  {
                    if(_prid != -1 && cEdit == other->_mode)
                    {
                      q.prepare("SELECT deletePr(:pr_id) AS _result;");
                      q.bindValue(":pr_id", _prid);
                      q.exec();
                      omfgThis->sPurchaseRequestsUpdated();
                    }
                    other->sFillList();
                    other->setFocus();
                    return UndefinedError;
                  }
                }
              }
            }
            sFillList();
          }
          else
            _prid = -1;
        }
      }
      else
//  This is a new P/O without a chosen Itemsite Line Item
        createHeader();
    }
    else if (param.toString() == "edit")
    {
      _mode = cEdit;
开发者ID:,项目名称:,代码行数:66,代码来源:

示例5: commandCallback

void toMain::commandCallback ( int cmd )
{
    QWidget * focus = qApp->focusWidget();

    if ( focus ) {
        toEditWidget * edit = findEdit ( focus );
        if ( edit && edit != Edit )
            setEditWidget ( edit );
        else if ( focus->inherits ( "QLineEdit" ) ||
                  focus->isA ( "QSpinBox" ) )
            editDisable ( Edit );
    }

    if ( Tools[cmd] )
        Tools[cmd]->createWindow();
    else if ( cmd >= TO_TOOL_ABOUT_ID && cmd <= TO_TOOL_ABOUT_ID_END ) {
        if ( Tools[cmd-TO_ABOUT_ID_OFFSET] )
            Tools[cmd-TO_ABOUT_ID_OFFSET]->about ( this );
    } else if ( cmd >= TO_WINDOWS_WINDOWS && cmd <= TO_WINDOWS_END ) {
        if ( cmd - TO_WINDOWS_WINDOWS < int ( workspace() ->windowList().count() ) )
            workspace() ->windowList().at ( cmd - TO_WINDOWS_WINDOWS ) ->setFocus();
    } else if ( cmd >= TO_STATUS_ID && cmd <= TO_STATUS_ID_END ) {
        QString str = StatusMenu->text ( cmd );
        new toMemoEditor ( this, str );
    } else {
        QWidget *currWidget = qApp->focusWidget();
        toEditWidget *edit = NULL;
        while ( currWidget && !edit ) {
            edit = dynamic_cast<toEditWidget *> ( currWidget );
            currWidget = currWidget->parentWidget();
        }
        if ( edit ) {
            switch ( cmd ) {
            case TO_EDIT_REDO:
                edit->editRedo();
                break;
            case TO_EDIT_UNDO:
                edit->editUndo();
                break;
            case TO_EDIT_COPY:
                edit->editCopy();
                break;
            case TO_EDIT_PASTE:
                edit->editPaste();
                break;
            case TO_EDIT_CUT:
                edit->editCut();
                break;
            case TO_EDIT_SELECT_ALL:
                edit->editSelectAll();;
                break;
            case TO_EDIT_READ_ALL:
                edit->editReadAll();
                break;
            case TO_EDIT_SEARCH:
                if ( !Search )
                    Search = new toSearchReplace ( this );
                edit->editSearch ( Search );
                break;
            case TO_FILE_OPEN:
                edit->editOpen();
                break;
            case TO_FILE_SAVE_AS:
                edit->editSave ( true );
                break;
            case TO_FILE_SAVE:
                edit->editSave ( false );
                break;
            case TO_FILE_PRINT:
                edit->editPrint();
                break;
            }
        }
        switch ( cmd ) {
        case TO_FILE_COMMIT:
            try {
                toConnection & conn = currentConnection();
                emit willCommit ( conn, true );
                conn.commit();
                setNeedCommit ( conn, false );
            }
            TOCATCH
            break;
        case TO_FILE_CLEARCACHE:
            try {
                currentConnection().rereadCache();
            }
            TOCATCH
            toMainWidget() ->checkCaching();
            break;
        case TO_FILE_ROLLBACK:
            try {
                toConnection &conn = currentConnection();
                emit willCommit ( conn, false );
                conn.rollback();
                setNeedCommit ( conn, false );
            }
            TOCATCH
            break;
        case TO_FILE_CURRENT:
//.........这里部分代码省略.........
开发者ID:JustDevZero,项目名称:bulmages,代码行数:101,代码来源:tomain.cpp


注:本文中的QWidget::isA方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。