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


C++ QAction::parentWidget方法代码示例

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


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

示例1:

QWidget *QActionProto::parentWidget() const
{
  QAction *item = qscriptvalue_cast<QAction*>(thisObject());
  if (item)
    return item->parentWidget();
  return 0;
}
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:7,代码来源:qactionproto.cpp

示例2: insertText

void EditStringCell::insertText()
{
    QAction *menuItem = qobject_cast<QAction *>(sender());
    if (menuItem->parentWidget()->objectName() == kGenderNumberMenuName)
        ui.stringEdit->insertPlainText(menuItem->text().left(4));
    else
        ui.stringEdit->insertPlainText(menuItem->text());
}
开发者ID:kambala-decapitator,项目名称:QTblEditor,代码行数:8,代码来源:editstringcell.cpp

示例3: convolutionDialog

void MainWindow::convolutionDCTDialog()
{
	if (activeImageDisplay())
	{
		ConvolutionDialog convolutionDialog(this);

		connect(&convolutionDialog, SIGNAL(finalSelected(ImageDisplay *)),
		        this, SLOT(performConvolutionDCT(ImageDisplay *)));

		QImage currentImage = activeImageDisplay()->getImage();

		int imageHeight = currentImage.height();
		int imageWidth = currentImage.width();

		int newHeightAndWidth = ImageOperations::firstPowerOfTwoOfLargerDimension(imageWidth, imageHeight);
		int newHeight = newHeightAndWidth;
		int newWidth = newHeightAndWidth;

		QList<QAction*> list = windowActionGroup->actions();

		QList<QAction*>::const_iterator stlIter1;
		for ( stlIter1 = list.begin(); stlIter1 != list.end(); ++stlIter1 )
		{
			QAction* action = (*stlIter1);

			//QWidget * QAction::parentWidget ()
			QWidget *widget = action->parentWidget();
			ImageDisplay *imageDisplay = (ImageDisplay*) widget;

			if (activeImageDisplay() != imageDisplay)
			{
				QImage image = imageDisplay->getImage();

				int maskHeight = image.height();
				int maskWidth = image.width();

				if (newHeight > 0 && newWidth > 0 && maskHeight > 0 && maskWidth > 0 &&
				        newHeight == maskHeight && newWidth == maskWidth)
				{
					convolutionDialog.addSelectCandidate(imageDisplay);
				}
			}
		}

		convolutionDialog.defineTargetMaskSize(newHeight, newWidth);
		convolutionDialog.refreshComboBox();
		int result = convolutionDialog.exec();

		if (result == QDialog::Rejected)
			return;
	}
}
开发者ID:bpoje,项目名称:dct,代码行数:52,代码来源:MainWindow.cpp

示例4: updateDescriptionMenuItem

void TikzCommandInserter::updateDescriptionMenuItem()
{
	QAction *action = qobject_cast<QAction*>(sender());
	if (action)
	{
		const int num = action->data().toInt();
		const TikzCommand cmd = m_tikzCommandsList.at(num);
		QList<QAction*> menuActions = qobject_cast<QMenu*>(action->parentWidget())->actions();
		QString description = cmd.description;
		description.replace(QLatin1Char('&'), QLatin1String("&&")); // don't use ampersands in the description to create a keyboard accelerator
		menuActions[menuActions.size()-1]->setText(description);
		menuActions[menuActions.size()-1]->setData(cmd.number);
	}
}
开发者ID:KarateSnowMachine,项目名称:qtikz-svn,代码行数:14,代码来源:tikzcommandinserter.cpp

示例5: sendKeyEvent

void QSoftKeyManager::sendKeyEvent()
{
    Q_D(QSoftKeyManager);
    QAction *action = qobject_cast<QAction*>(sender());

    if (!action)
        return;

    Qt::Key keyToSend = d->keyedActions.value(action, Qt::Key_unknown);

    if (keyToSend != Qt::Key_unknown)
        QApplication::postEvent(action->parentWidget(),
                                new QKeyEvent(QEvent::KeyPress, keyToSend, Qt::NoModifier));
}
开发者ID:Nacto1,项目名称:qt-everywhere-opensource-src-4.6.2,代码行数:14,代码来源:qsoftkeymanager.cpp

示例6: activeContextStateChanged

void KviIrcContextDisplayAction::activeContextStateChanged()
{
	if(m_pActionList)
	{
		for(QAction * a = m_pActionList->first();a;a = m_pActionList->next())
		{
			QToolBar *t = (QToolBar*) a->parentWidget();
			if(t)
			{
				KviIrcContextDisplay * w = (KviIrcContextDisplay *) t->widgetForAction(a);
				if(w)
					w->update();
			}
		}
	}
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:16,代码来源:KviCoreActions.cpp

示例7: contextMenu

void MashStepTableModel::contextMenu(const QPoint &point)
{
   QObject* calledBy = sender();
   QHeaderView* hView = qobject_cast<QHeaderView*>(calledBy);

   int selected = hView->logicalIndexAt(point);
   unitDisplay currentUnit;
   unitScale  currentScale;

   // Since we need to call generateVolumeMenu() two different ways, we need
   // to figure out the currentUnit and Scale here

   currentUnit  = displayUnit(selected);
   currentScale = displayScale(selected);

   QMenu* menu;
   QAction* invoked;

   switch(selected)
   {
      case MASHSTEPAMOUNTCOL:
         menu = Brewtarget::setupVolumeMenu(parentTableWidget,currentUnit, currentScale);
         break;
      case MASHSTEPTEMPCOL:
      case MASHSTEPTARGETTEMPCOL:
         menu = Brewtarget::setupTemperatureMenu(parentTableWidget,currentUnit);
         break;
      case MASHSTEPTIMECOL:
         menu = Brewtarget::setupTimeMenu(parentTableWidget,currentScale);
         break;
      default:
         return;
   }

   invoked = menu->exec(hView->mapToGlobal(point));
   if ( invoked == 0 )
      return;

   QWidget* pMenu = invoked->parentWidget();
   if ( pMenu == menu )
      setDisplayUnit(selected,(unitDisplay)invoked->data().toInt());
   else
      setDisplayScale(selected,(unitScale)invoked->data().toInt());
}
开发者ID:Mackanzx,项目名称:brewtarget,代码行数:44,代码来源:MashStepTableModel.cpp

示例8: execute

  void execute() override {
    QAction *act = CommandManager::instance()->getAction(MI_LoadRecentImage);

    /*--- 右クリックで呼ばれないとここにWidgetが入らない ---*/
    FlipBook *flip = qobject_cast<FlipBook *>(act->parentWidget());
    if (!flip) return;

    DVMenuAction *menu = dynamic_cast<DVMenuAction *>(act->menu());
    int index          = menu->getTriggeredActionIndex();
    QString path =
        RecentFiles::instance()->getFilePath(index, RecentFiles::Flip);

    TFilePath fp(path.toStdWString());

    /*--- shrinkは1でロードする ---*/
    ::viewFile(fp, -1, -1, -1, 1, 0, flip, false);

    RecentFiles::instance()->moveFilePath(index, 0, RecentFiles::Flip);
  }
开发者ID:janisozaur,项目名称:opentoonz,代码行数:19,代码来源:imageviewer.cpp

示例9: parentWidget

int Action::parentWidget(lua_State * L) // const : QWidget
{
    QAction* obj = QtObject<QAction>::check( L, 1);
    QtObject<QWidget>::create( L, obj->parentWidget());
	return 1;
}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:6,代码来源:QtlAction.cpp


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