QT编程中如何获取lednumuber的值,如何获取用户界面从Qeditline输入的text的值

QT编程中如何获取lednumuber的值,如何获取用户界面从Qeditline输入的text的值,第1张

string str1=文本框的名字texttrim(;//将文本框的内容获取到变量str1中

在超链接中传递的字段的名字我先假设为name,herf="XXXaspxname='"+ str1 +"'");

用QFtp应该可以做到吧, 摘自Qt的帮助文档, QFtp::get()时将次二哥参数设置为0,之后收到 readyRead()后可以通过read()或readAll()读取到内存里。

int QFtp::get ( const QString & file, QIODevice dev = 0, TransferType type = Binary )

If dev is 0, then the readyRead() signal is emitted when there is data available to read You can then read the data with the read() or readAll() functions

给你说下大概的流程吧 textedit按行读取 然后建立一个qstring的容器 读取各行数据 按钮点击后进行排序 然后把数据输出到textbrowser 其实没必要这样用 直接建立一个qtablewidget 输入内容后点击headeritem 应该直接就可以排序的

错误代码都没有呢?估计是你定义的SLOT有问题。

你看看我写的这段代码吧,是选取QComboBox控件中的文本内容的。

intmain(intargc,charargv)

{

QApplicationapp(argc,argv);

QComboBoxcomboBox=newQComboBox;

QTextEdittextEdit=new QTextEdit;

QVBoxLayoutlayout=new QVBoxLayout;

layout->addWidget(textEdit);

layout->addWidget(comboBox);

comboBox->addItem(QObject::tr("ComboBoxItem01"));

comboBox->addItem(QObject::tr("ComboBoxItem02"));

comboBox-addItem(QObject::tr("ComboBoxItem03"));

QObject::connect(comboBox,SIGNAL(activated(QString)),textEdit,SLOT(insertPlainText(QString)));

QWidget mainWin;

mainWinsetLayout(layout);

mainWinresize(770,550);

mainWinshow();

returnappexec();

}

逐行读取

QFile file("/home/administrator/testdir/testtxt");    

if(!fileopen(QIODevice::ReadOnly | QIODevice::Text)) {    

    qDebug()<<"Can't open the file!"<<endl;    

}    

while(!fileatEnd()) {    

    QByteArray line = filereadLine();    

    QString str(line);    

    qDebug()<< str;    

}

QT中提取QTextEdit文本框中的内容,代码如下

int a[100];

QString str = ui->textEdit->toPlainText();

int len = strlength();

for(int i = 0; i < len; ++i)

{

QChar t = strat(i);

a[i] = ttoAscii() - '0';

}

'textEdit的数据合理性以及数组大小自己去设定

以上就是关于QT编程中如何获取lednumuber的值,如何获取用户界面从Qeditline输入的text的值全部的内容,包括:QT编程中如何获取lednumuber的值,如何获取用户界面从Qeditline输入的text的值、qt能否直接从ftp服务器上读取文本文件内容、Qt中如何在第一个文本框获取内容,然后在第二个文本框输出等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/9333017.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-27
下一篇2023-04-27

发表评论

登录后才能评论

评论列表(0条)

    保存