zoukankan      html  css  js  c++  java
  • Qt常用UI控件读取、写入方法

    本文用途:快速备忘,方便调用,写熟了自然就记下了。

    【1、标签label】

    读取:ui->label->text()
    写入:ui->label->setText("poi");

    【2、单行文本框lineEdit】
    读取:ui->lineEdit->text()

    写入:ui->lineEdit->setText("poi");

    【3、单行文本框textEdit】
    读取(文本):ui->textEdit->toPlainText()
    读取(富文本):ui->textedit->toHtml()
    写入:ui->textEdit->setText("poi");

    追加:ui->textEdit->append("jfz");

    【4、spinBox】

    读取:ui->spinBox->text()

    【5、doubleSpinBox】

    读取:ui->doubleSpinBox->text()

    【6、comboBox】

    读取:ui->comboBox->currentText()

    【7、radioButton】

    读取:ui->radioButton->isChecked()

    【8、checkBox】

    读取:checkBox->checkState() == Qt::Checked

  • 相关阅读:
    Promise
    replace
    mongogogog
    sh back mongo
    mongodb 备份 还原 导出 导入
    mongo virtual
    openssl
    isMobile
    google api autocomplete
    npm
  • 原文地址:https://www.cnblogs.com/sandeepin/p/12236535.html
Copyright © 2011-2022 走看看