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


C++ QTextEdit::setAttribute方法代码示例

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


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

示例1: showFullExifInfo

  void FQTermImageOrigin::showFullExifInfo() {

    QString exifInfo = QString::fromStdString(exifExtractor_->extractExifInfo(model_->filePath(tree_->currentIndex()).toLocal8Bit().data()));
    QString comment;

    if ((*exifExtractor_)["UserComment"].length() > 8) {

      QString commentEncoding = QString::fromStdString((*exifExtractor_)["UserComment"].substr(0, 8));

      if (commentEncoding.startsWith("UNICODE")) {
        //UTF-16
        QTextCodec* c = QTextCodec::codecForName("UTF-16");
        comment = c->toUnicode((*exifExtractor_)["UserComment"].substr(8).c_str());
      } else if (commentEncoding.startsWith("JIS")) {
        //JIS X 0208
        QTextCodec* c = QTextCodec::codecForName("JIS X 0208");
        comment = c->toUnicode((*exifExtractor_)["UserComment"].substr(8).c_str());
      } else {
        comment = QString::fromStdString((*exifExtractor_)["UserComment"].substr(8));
      }
    }


    QTextEdit* info = new QTextEdit;
    info->setText(exifInfo + tr("Comment : ") + comment + "\n");
    info->setWindowFlags(Qt::Dialog);
    info->setAttribute(Qt::WA_DeleteOnClose);
    info->setAttribute(Qt::WA_ShowModal);
    //  info->setLineWrapMode(QTextEdit::NoWrap);
    info->setReadOnly(true);
    QFontMetrics fm(font());
    info->resize(fm.width("Orientation : 1st row - 1st col : top - left side    "), fm.height() * 20);
    info->show();
  }
开发者ID:minyoad,项目名称:fqterm,代码行数:34,代码来源:imageviewer_origin.cpp

示例2: slotSourceDownloaded

void MainWindow::slotSourceDownloaded()
{
    QNetworkReply* reply = qobject_cast<QNetworkReply*>(const_cast<QObject*>(sender()));
    QTextEdit* textEdit = new QTextEdit(NULL);
    textEdit->setAttribute(Qt::WA_DeleteOnClose);
    textEdit->show();
    textEdit->setPlainText(reply->readAll());
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:8,代码来源:mainwindow.cpp

示例3: viewSource

void MainWindow::viewSource()
{
    QTextEdit* textEdit = new QTextEdit(NULL);
    textEdit->setAttribute(Qt::WA_DeleteOnClose);
    textEdit->adjustSize();
    textEdit->move(this->geometry().center() - textEdit->rect().center());
    textEdit->show();

    view->page()->toHtml(invoke(textEdit, &QTextEdit::setPlainText));
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:10,代码来源:mainwindow.cpp

示例4: handleLicenseClicked

void QtAboutWidget::handleLicenseClicked() {
	QTextEdit* text = new QTextEdit();
	text->setAttribute(Qt::WA_DeleteOnClose);
	text->setReadOnly(true);
	QFile file(":/COPYING");
	file.open(QIODevice::ReadOnly);
	QTextStream in(&file);
	in.setCodec("UTF-8");
	text->setPlainText(in.readAll());
	file.close();
	text->resize(500, 600);
	text->show();
	text->activateWindow();
}
开发者ID:scopeInfinity,项目名称:swift,代码行数:14,代码来源:QtAboutWidget.cpp

示例5: file

ConfigPage::ConfigPage(Context *context) : context(context)
{
    QTextEdit *text = new QTextEdit(this);
    text->setAutoFillBackground(false);
#ifdef Q_OS_MAC
    text->setAttribute(Qt::WA_MacShowFocusRect, 0);
#endif
    text->setFrameStyle(QFrame::NoFrame);
    text->setContentsMargins(0,0,0,0);

    QFile file(":gcconfig.pri");
    file.open(QFile::ReadOnly);
    QTextStream stream(&file);
    QString contents = stream.readAll();
    file.close();
    text->setText(contents);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->addWidget(text);

    setLayout(mainLayout);
}
开发者ID:AndyBryson,项目名称:GoldenCheetah,代码行数:24,代码来源:AboutDialog.cpp


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