本文整理汇总了C++中QClipboard::setText方法的典型用法代码示例。如果您正苦于以下问题:C++ QClipboard::setText方法的具体用法?C++ QClipboard::setText怎么用?C++ QClipboard::setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QClipboard
的用法示例。
在下文中一共展示了QClipboard::setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: editCopyHtml
void MainWindow::editCopyHtml()
{
QClipboard* clipboard = QApplication::clipboard();
clipboard->setText(ui->htmlSourceTextEdit->toPlainText());
}
示例2: slotCopySourceAddress
void ThunderPanel::slotCopySourceAddress()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(getUserDataByOffset(OFFSET_SOURCE));
}
示例3: slotSendToBuffer
void RequestDetailsDlg::slotSendToBuffer()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(m_request->toString().join("\n\n\n"));
}
示例4: copyToClipboard
/*
* Copies a string to the clipboard
*/
void FileEngine::copyToClipboard(const QString &string)
{
QClipboard *clipboard = QGuiApplication::clipboard();
clipboard->setText(string);
}
示例5: keyPressEvent
//.........这里部分代码省略.........
if ((charX % 3) == 0)
{
insert(posBa, char(0));
adjust();
}
// Change content
if (_data.size() > 0)
{
QByteArray hexValue = _data.mid(posBa, 1).toHex();
if ((charX % 3) == 0)
hexValue[0] = key;
else
hexValue[1] = key;
replace(posBa, 1, QByteArray().fromHex(hexValue));
setCursorPos(_cursorPosition + 1);
resetSelection(_cursorPosition);
}
}
/* Cut & Paste */
if (event->matches(QKeySequence::Cut))
{
QString result = QString();
for (int idx = getSelectionBegin(); idx < getSelectionEnd(); idx++)
{
result += _data.mid(idx, 1).toHex() + " ";
if ((idx % 16) == 15)
result.append("\n");
}
remove(getSelectionBegin(), getSelectionEnd());
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(result);
setCursorPos(getSelectionBegin());
resetSelection(getSelectionBegin());
}
if (event->matches(QKeySequence::Paste))
{
QClipboard *clipboard = QApplication::clipboard();
QByteArray ba = QByteArray().fromHex(clipboard->text().toLatin1());
insert(_cursorPosition / 2, ba);
setCursorPos((_cursorPosition + (2 * ba.length()) + 1) & 0xfffffffe);
resetSelection(getSelectionBegin());
}
/* Delete char */
if (event->matches(QKeySequence::Delete))
{
if (getSelectionBegin() != getSelectionEnd())
{
posBa = getSelectionBegin();
remove(posBa, getSelectionEnd() - posBa);
setCursorPos(2*posBa);
resetSelection(2*posBa);
}
else
{
remove(posBa);
}
}
/* Backspace */
if ((event->key() == Qt::Key_Backspace) && (event->modifiers() == Qt::NoModifier))
示例6: copyCell
/**
* Stores value and state of selected cell in variable.
*/
void DatasetEditWidget::copyCell(){
QClipboard* clipboard = QApplication::clipboard();
QModelIndex index = ui->tableView->currentIndex();
clipboard->setText(model->viewModel()->data(index, Qt::DisplayRole).toString());
ui->tableView->update(index);
}
示例7: slot_pbutton_copy
void MainWindow::slot_pbutton_copy()
{
QClipboard *cb = QApplication::clipboard();
cb->setText(ui->lineEdit->text());
}
示例8: copyPhoneToClipboard
void ContactInfoWindow::copyPhoneToClipboard()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(contact->phone);
QMaemo5InformationBox::information(this,"Phone number copied to clipboard");
}
示例9: on_btnToClipboard_clicked
void winHistory::on_btnToClipboard_clicked(){
QClipboard *cb = QApplication::clipboard();
cb->setText( ui->txtUrl->text(),
QClipboard::Clipboard );
}
示例10: copyToClipboard
void LocationChatWidgetItem::copyToClipboard() {
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(QString("Location: https://maps.google.com/?q=%1,%2 - %3").arg(latitude).arg(longitude).arg(description));
}
示例11: copyFilenameToClipboard
void DocumentFile::copyFilenameToClipboard()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(d->filename);
}
示例12: SaveToClipboard
void cSettings::SaveToClipboard()
{
WriteLog("Save settings to clipboard");
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(settingsText);
}
示例13: copyUrl
void DownloadItemViewModel::copyUrl()
{
QClipboard* clipboard = QApplication::clipboard();
clipboard->setText(m_url);
}
示例14: CopyTextToClipboard
void MythUITextEdit::CopyTextToClipboard()
{
QClipboard *clipboard = QApplication::clipboard();
if (clipboard)
clipboard->setText(m_Message);
}
示例15: slotCopyResourcePath
void QtResourceViewPrivate::slotCopyResourcePath()
{
const QString path = q_ptr->selectedResource();
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(path);
}