##效果

##源码
##//mymainwindow.cpp
#include "mymainwindow.h"
#include "ui_mymainwindow.h"
#include <QString>
#include <qDebug>
#include <QPalette>
myMainWindow::myMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::myMainWindow)
{
ui->setupUi(this);
QPalette pe;
QFont font("Arial",16);
}
myMainWindow::~myMainWindow()
{
delete ui;
}
void myMainWindow::on_pushButton_clicked()
{
//获取数字
QString str;
QString res;
QChar ch;
str = ui->lineEdit->text();
for(int i=0;i<str.size();i++)
{
ch = str.at(i);
if(ch.toLatin1() <'0'||ch > '9')
continue;
if(((ch.toLatin1()-'0')%2)!=0||((ch.toLatin1()-'0')%2)!=1)
res.append(ch);
}
QPalette pe;
QFont font("Microsoft YaHei",16,75);

最低0.47元/天 解锁文章
8582

被折叠的 条评论
为什么被折叠?



