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


C++ QClipboard::setImage方法代码示例

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


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

示例1: setImage

	QScriptValue Clipboard::setImage(const QScriptValue &data) const
	{
		QClipboard *clipboard = QApplication::clipboard();

		QObject *object = data.toQObject();
		if(Code::Image *image = qobject_cast<Code::Image*>(object))
			clipboard->setImage(image->image(), mMode);
		else
			clipboard->setImage(data.toVariant().value<QImage>(), mMode);
	
		return thisObject();
	}
开发者ID:sakazuki,项目名称:actiona,代码行数:12,代码来源:clipboard.cpp

示例2: copyImage

void ImageWindow::copyImage(){
    QImage img = _imageView->widget()->convertImage(_displayImg);
    QClipboard *clipboard = QApplication::clipboard();
    if(_selectButton->isChecked()){
        QRect rect(_selectWidget->getX()->value(),_selectWidget->getY()->value(),_selectWidget->getWidth()->value(),_selectWidget->getHeight()->value());
        QImage image = img.copy(rect);
        clipboard->setImage(image);
    }
    else
    {
        clipboard->setImage(img);
    }
}
开发者ID:eiimage,项目名称:detiq-t,代码行数:13,代码来源:ImageWindow.cpp

示例3: snapshotToClipboard

void locWmGlDisplay::snapshotToClipboard()
{
    paintGL(); // Redraw the scene in case it needs to be updated.
    QClipboard *cb = QApplication::clipboard(); // get the clipboard
    QImage tempPicture(this->grabFrameBuffer(false)); // grab current image
    cb->setImage(tempPicture); // put current image on the clipboard.
}
开发者ID:josiahw,项目名称:robocup,代码行数:7,代码来源:locWmGlDisplay.cpp

示例4: test1

void test1()
{
	QAxObject excel( "Excel.Application", 0);
	excel.setProperty("Visible", true);

	QAxObjectPtr workbooks(excel.querySubObject("Workbooks"));
	QAxObjectPtr workbook(workbooks->querySubObject("Add()"));
	QAxObjectPtr sheets(workbook->querySubObject("Worksheets"));
	sheets->dynamicCall("Add()");
	QAxObjectPtr sheet(sheets->querySubObject( "Item( int )", 1 ));
	// sheet->setProperty("Name","Nova Planilha");

	QAxObjectPtr range(sheet->querySubObject("Cells(int,int)",1,1));
	range->setProperty("Value", QVariant(1234));

	QImage image("c:/Users/jhlee/Dropbox/orgwiki/img/class01.png");
	QClipboard* clip = QApplication::clipboard();
	clip->setImage(image);
	QAxObjectPtr shapes(sheet->querySubObject("Shapes"));
	sheet->dynamicCall("Paste()");
	int shapeCount = shapes->property("Count").toInt();
	QAxObjectPtr shape(shapes->querySubObject(QString::fromLatin1("Item(%1)").arg(shapeCount).toAscii()));

	// shapes->dynamicCall("AddPicture( QString&, bool, bool, double, double, double, double","c:\\Users\\jhlee\\Dropbox\\orgwiki\\img\\class01.png",true,true,100,100,70,70);

	excel.setProperty("DisplayAlerts", false);
	workbook->dynamicCall("SaveAs(QString&)", "c:\\temp\\testexcel.xlsx");
	// //workbook->dynamicCall("Close()");
	// //excel.dynamicCall("Quit()");
	// workbook->dynamicCall("Close (Boolean)", true);
	excel.dynamicCall("Quit()");
}
开发者ID:joonhwan,项目名称:study,代码行数:32,代码来源:main.cpp

示例5: CopyToClipboard

//clipboard
void SliceEditView::CopyToClipboard()
{
	if(supportMode)
		return;
	QClipboard *clipboard = QApplication::clipboard();
	clipboard->setImage(topImg);
}
开发者ID:denisoft,项目名称:B9Creator,代码行数:8,代码来源:SliceEditView.cpp

示例6: copyImage

void ViewWidget::copyImage()
{
	_generator.repaintImage();
	const QImage& image = _generator.getImage();

	QClipboard* clipboard = QApplication::clipboard();
	clipboard->setImage(image, QClipboard::Clipboard);
}
开发者ID:BackupTheBerlios,项目名称:myfrac,代码行数:8,代码来源:view2d.cpp

示例7: copyImage

void PFSViewMainWin::copyImage()
{
  QClipboard *cb = QApplication::clipboard();

  const QImage *image = pfsView->getDisplayedImage();
  cb->setImage( *image, QClipboard::Clipboard );
  statusBar()->showMessage( "Image copied to clipboard", 2000 );
}
开发者ID:TriggerHappyRemote,项目名称:TriggerHappyRemote-iOS,代码行数:8,代码来源:main.cpp

示例8: on_copy_clicked

void itemdetail::on_copy_clicked()
{
    //ui->templete_view->selectAll();
    //ui->templete_view->copy();
    QImage img("temp.jpg");
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setImage(img);
    emit log_changed("已复制商品图片到剪切板...\r\n");
    log_ch("复制成功\r\n");
}
开发者ID:yangyang0312,项目名称:C-,代码行数:10,代码来源:itemdetail.cpp

示例9: on_saveToClipboardCommandLinkButton_clicked

    void SaveScreenshotWizardPage::on_saveToClipboardCommandLinkButton_clicked()
    {
        QClipboard *clipboard = QApplication::clipboard();

        clipboard->setImage(capturePixmap().toImage());

        screenshotWizard()->mSaveTarget = ScreenshotWizard::ClipboardSaveTarget;

        wizard()->accept();
    }
开发者ID:WeDo30,项目名称:actiona,代码行数:10,代码来源:savescreenshotwizardpage.cpp

示例10: wdclipwriteimage

// ---------------------------------------------------------------------
int wdclipwriteimage(char *s)
{
  QClipboard *clipboard = app->clipboard();
  if (!clipboard) return 1;
  if (!s || !strlen(s)) clipboard->clear();
  else {
    QImage image(s2q(s));
    if (image.isNull()) return 1;
    clipboard->setImage(image);
  }
  return 0;
}
开发者ID:0branch,项目名称:qtide,代码行数:13,代码来源:clipboard.cpp

示例11: wdclipwriteimagedata

// ---------------------------------------------------------------------
int wdclipwriteimagedata(const uchar *data,int len)
{
  QClipboard *clipboard = app->clipboard();
  if (!clipboard) return 1;
  if (!data || len<=0) clipboard->clear();
  else {
    QImage image=QImage();
    if (image.loadFromData(data, len) && !image.isNull()) {
      clipboard->setImage(image);
    } else return 1;
  }
  return 0;
}
开发者ID:0branch,项目名称:qtide,代码行数:14,代码来源:clipboard.cpp

示例12: takeSnapshot

void OverviewWindow::takeSnapshot()
{
   View* pView = dynamic_cast<View*>(mpOverview);
   if (pView != NULL)
   {
      QImage image;
      pView->getCurrentImage(image);
      if (image.isNull() == false)
      {
         QClipboard* pClipboard = QApplication::clipboard();
         pClipboard->setImage(image);
      }
   }
}
开发者ID:Siddharthk,项目名称:opticks,代码行数:14,代码来源:OverviewWindow.cpp

示例13: onActionTriggered

//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RicSnapshotViewToClipboardFeature::onActionTriggered(bool isChecked)
{
    RimViewWindow* viewWindow = RiaApplication::activeViewWindow();

    if (viewWindow)
    {
        QClipboard* clipboard = QApplication::clipboard();
        if (clipboard)
        {
            QImage image = viewWindow->snapshotWindowContent();
            if (!image.isNull())
            {
                clipboard->setImage(image);
            }
        }
    }
}
开发者ID:magnesj,项目名称:ResInsight,代码行数:20,代码来源:RicSnapshotViewToClipboardFeature.cpp

示例14: copyToClipboard

void RenderView::copyToClipboard()
{
	if ((luxStatistics("sceneIsReady") || luxStatistics("filmIsReady")) && luxfb->isVisible()) {
		QImage image = getFramebufferImage(overlayStats, showAlpha);
		if (image.isNull()) {
			LOG(LUX_ERROR, LUX_SYSTEM) << tr("Error getting framebuffer").toLatin1().data();
			return;
		}

		QClipboard *clipboard = QApplication::clipboard();
		// QT assumes 32bpp images for clipboard (DIBs)
		if (!clipboard) {
			LOG(LUX_ERROR, LUX_SYSTEM) << tr("Copy to clipboard failed, unable to open clipboard").toLatin1().data();
			return;
		}
		clipboard->setImage(image.convertToFormat(QImage::Format_ARGB32));
	}
}
开发者ID:marwan-abdellah,项目名称:luxrender-lux,代码行数:18,代码来源:renderview.cpp

示例15: queuedSetClipboardData

void ClipboardSingleton::queuedSetClipboardData(const QVariant& data, ClipboardType type)
{
    // work with clipboard in main thread
    QClipboard *clipboard = QApplication::clipboard();

    switch (type)
    {
    case TEXT:
        {
            QString plainText = data.toString();
            Q_ASSERT(plainText.isEmpty());

            clipboard->setText(plainText);
        }
        break;

    case RICHTEXT:
        {
            QString richText = data.toString();
            Q_ASSERT(richText.isEmpty());

            QMimeData mime;
            mime.setHtml(richText);
            clipboard->setMimeData(&mime);
        }
        break;

    case IMAGE:
        {
            QImage image = data.value<QImage>();
            Q_ASSERT(image.isNull());

            clipboard->setImage(image);
        }
        break;

    default:
        Q_ASSERT("You sould't be here" && false);
        break;
    }
}
开发者ID:Mikhalevich,项目名称:watcher,代码行数:41,代码来源:clipboardsingleton.cpp


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