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


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

本文整理汇总了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());
}
开发者ID:blacky-i,项目名称:CuteMarkEd,代码行数:5,代码来源:mainwindow.cpp

示例2: slotCopySourceAddress

void ThunderPanel::slotCopySourceAddress()
{
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setText(getUserDataByOffset(OFFSET_SOURCE));
}
开发者ID:slimbloody,项目名称:XLCloudClient,代码行数:5,代码来源:thunderpanel.cpp

示例3: slotSendToBuffer

void RequestDetailsDlg::slotSendToBuffer()
{
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setText(m_request->toString().join("\n\n\n"));
}
开发者ID:jacmoe,项目名称:qrestclient,代码行数:5,代码来源:requestdetailsdlg.cpp

示例4: copyToClipboard

/*
 *  Copies a string to the clipboard
 */
void FileEngine::copyToClipboard(const QString &string)
{
    QClipboard *clipboard = QGuiApplication::clipboard();

    clipboard->setText(string);
}
开发者ID:Matoking,项目名称:Filetug,代码行数:9,代码来源:fileengine.cpp

示例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))
开发者ID:TigerSecurity,项目名称:PassiveNetwork,代码行数:67,代码来源:qhexedit_p.cpp

示例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);
}
开发者ID:kacerpetr,项目名称:NNCreator,代码行数:9,代码来源:DatasetEditWidget.cpp

示例7: slot_pbutton_copy

void MainWindow::slot_pbutton_copy()
{
    QClipboard *cb = QApplication::clipboard();
    cb->setText(ui->lineEdit->text());
}
开发者ID:Jacob-jiangbo,项目名称:my-test,代码行数:5,代码来源:mainwindow.cpp

示例8: copyPhoneToClipboard

void ContactInfoWindow::copyPhoneToClipboard()
{
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setText(contact->phone);
    QMaemo5InformationBox::information(this,"Phone number copied to clipboard");
}
开发者ID:0xaaa,项目名称:yappari,代码行数:6,代码来源:contactinfowindow.cpp

示例9: on_btnToClipboard_clicked

void winHistory::on_btnToClipboard_clicked(){
    QClipboard *cb = QApplication::clipboard();
    cb->setText( ui->txtUrl->text(),
             QClipboard::Clipboard );
}
开发者ID:shiftplanning,项目名称:spgrab,代码行数:5,代码来源:winhistory.cpp

示例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));
}
开发者ID:Blinket,项目名称:openMittsu,代码行数:4,代码来源:LocationChatWidgetItem.cpp

示例11: copyFilenameToClipboard

void DocumentFile::copyFilenameToClipboard()
{
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setText(d->filename);
}
开发者ID:KDE,项目名称:kreenshot-editor,代码行数:5,代码来源:documentfile.cpp

示例12: SaveToClipboard

void cSettings::SaveToClipboard()
{
	WriteLog("Save settings to clipboard");
	QClipboard *clipboard = QApplication::clipboard();
	clipboard->setText(settingsText);
}
开发者ID:hwinkler,项目名称:mandelbulber2,代码行数:6,代码来源:settings.cpp

示例13: copyUrl

void DownloadItemViewModel::copyUrl()
{
    QClipboard* clipboard = QApplication::clipboard();
    clipboard->setText(m_url);
}
开发者ID:TechLord-Forever,项目名称:four-k-download,代码行数:5,代码来源:downloaditemviewmodel.cpp

示例14: CopyTextToClipboard

void MythUITextEdit::CopyTextToClipboard()
{
    QClipboard *clipboard = QApplication::clipboard();
    if (clipboard)
        clipboard->setText(m_Message);
}
开发者ID:Openivo,项目名称:mythtv,代码行数:6,代码来源:mythuitextedit.cpp

示例15: slotCopyResourcePath

void QtResourceViewPrivate::slotCopyResourcePath()
{
    const QString path = q_ptr->selectedResource();
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setText(path);
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:6,代码来源:qtresourceview.cpp


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