天嵌 ARM开发社区

 找回密码
 注册
查看: 2021|回复: 2

TextEdit显示问题

[复制链接]
mercury20102013 发表于 2012-8-24 07:51:54 | 显示全部楼层 |阅读模式
本人遇到一个问题,其实很简单,就是在同一个界面上一个textedit输入内容,另外一个textedit负责显示内容。功能很简单,但是显示不管怎么样就是显示不出数据。麻烦帮我看下哪里存在问题。谢谢了。
file:///C:/Documents%20and%20Settings/Administrator/Application%20Data/Tencent/Users/609496715/QQ/WinTemp/RichOle/IZNKK2GIGCWNEO%60LUJD3Q_Y.jpg
以下是我的部分代码:
mainwindow.cpp:
#include "mainwindow.h"#include "ui_mainwindow.h"#include "mainwindow.h"MainWindow::MainWindow(QWidget *parent) :    QMainWindow(parent),    ui(new Ui::MainWindow){    ui->setupUi(this);    connect(ui->send_btn,SIGNAL(clicked()),this,SLOT(process()));}MainWindow::~MainWindow(){    delete ui;}void MainWindow::setSend(QString str){    sendTo = str;}QString MainWindow::getReceive(){    return sendTo;}void MainWindow::process(){    qDebug() << "left - textedit input -->" << ui->textEdit1->toPlainText()<<endl;    this->setSend(ui->textEdit1->toPlainText());    QString show;    show = this->getReceive();    ui->textEdit2->toPlainText() = show;    qDebug() << "right - textedit show -->" << show << endl;} main.cpp:#include <QtGui/QApplication>#include <QTextCodec>#include "mainwindow.h"int main(int argc, char *argv[]){    QApplication a(argc, argv);    QTextCodec::setCodecForTr(QTextCodec::codecForName("gb18030"));    //Q_RESOURCE(hello);    MainWindow w;    w.show();    return a.exec();}   
Jangel 发表于 2012-8-24 09:01:09 | 显示全部楼层

回帖奖励 +3

麻烦你重新排版一下吧 这样的程序没办法看啊
 楼主| mercury20102013 发表于 2012-8-24 19:29:36 | 显示全部楼层
解决了,谢谢啊。我后来补了一个帖子,叫“补充”。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-6-11 10:17 , Processed in 1.031250 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表