本文整理汇总了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();
}
示例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);
}
}
示例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.
}
示例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()");
}
示例5: CopyToClipboard
//clipboard
void SliceEditView::CopyToClipboard()
{
if(supportMode)
return;
QClipboard *clipboard = QApplication::clipboard();
clipboard->setImage(topImg);
}
示例6: copyImage
void ViewWidget::copyImage()
{
_generator.repaintImage();
const QImage& image = _generator.getImage();
QClipboard* clipboard = QApplication::clipboard();
clipboard->setImage(image, QClipboard::Clipboard);
}
示例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 );
}
示例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");
}
示例9: on_saveToClipboardCommandLinkButton_clicked
void SaveScreenshotWizardPage::on_saveToClipboardCommandLinkButton_clicked()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setImage(capturePixmap().toImage());
screenshotWizard()->mSaveTarget = ScreenshotWizard::ClipboardSaveTarget;
wizard()->accept();
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
}
}
示例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));
}
}
示例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;
}
}