• 大小: 10.16M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-07
  • 语言: 其他
  • 标签: 其他  

资源简介

FeiQ发布版源代码(修复版)(QT5).zip

资源截图

代码片段和文件信息

#include “antiforget.h“
#include “ui_antiforget.h“


Widget2::Widget2(QWidget *parent) :
    QWidget(parent)
    ui(new Ui::widget)
{
    ui->setupUi(this);
    this->setstyleSheet(“background-image:url(:/image/6.jpg);“);
    ui->textEdit->setstyleSheet(“border-image:url(:/image/6.jpg);“);
    ui->dateEdit->setstyleSheet(“border-image:url(:/image/6.jpg);“);
    ui->themeEdit->setstyleSheet(“border-image:url(:/image/6.jpg);“);
    Qobject::connect(ui->calendarButtonSIGNAL(clicked())thisSLOT(showcalendar()));
    Qobject::connect(ui->saveButtonSIGNAL(clicked())thisSLOT(onsave()));
}

Widget2::~Widget2()
{
    delete ui;
}

//在lineedit中显示所选择的日期
void Widget2::showcalendar()
{
    QDate date=ui->calendarWidget->selectedDate();
    QString datestr=date.toString(“yyyy-MM-dd“); //设置输出格式
    //ui->calendarWidget=new QCalendarWidget(this);

    //QDate date=ui->calendarWidget->selectedDate();
    //QString datestr=date.toString(“yyyy/MM/dd“); //设置输出格式
    //QString datestr=(“123“);
    /*ui->calendarWidget->setLocale(QLocale(QLocale::ChineseQLocale::China));
    ui->calendarWidget->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);
    ui->calendarWidget->setSelectionMode(QCalendarWidget::SingleSelection);
    ui->calendarWidget->setFirstDayOfWeek(Qt::Sunday);
    QTextCharFormat weekdays;
    weekdays.setBackground(QColor(255255255));
    ui->calendarWidget->setWeekdayTextFormat(Qt::Saturdayweekdays);
    ui->calendarWidget->setWeekdayTextFormat(Qt::Sundayweekdays);
    ui->calendarWidget->setGridVisible(true);*/
    //ui->lineEdit->setText(datestr);
    ui->dateEdit->setText(datestr);
    QString filename=“date/“+datestr+“.txt“;
    QFile file( filename );
    if ( file.exists())
    {
//        QFile *file1=new QFile( filename );  //file.setFileName( “xx.txt“ );
//        file1->open(QIODevice::ReadOnly|QIODevice::Text);
//        //QString line = QString(file1->readLine());
//        char *line1;
//        line1 = file1->readLine().data();
//        ui->textEdit->setText(line1);
//        while(!file1.atEnd()){
//            line1 = file1->readLine().data();

//            ui->textEdit->setText(line1);
//        }
////         char *line2 = file1->readAll().data();

////        ui->textEdit->setText(line2);
//        file1->close(); QString line;
        QTextCodec *code=QTextCodec::codecForName(“UTF-8“);//本人采用的是UTF8格式显示的
        //QFile file(“/file.txt“);
        file.open(QIODevice::ReadOnly);
        QTextStream stream(&file);
        stream.setCodec(code);//输出流的设置--------必须嘀
        ui->themeEdit->setText(stream.readLine());
        while(stream.atEnd()==0)
        {
           ui->textEdit ->append(stream.readLine());
        }
        return;
    }
}


//保存所填备忘内容
void Widget2::onsave()
{
    QTextCodec::setCodecForLocale(QTextCodec::codecForName(“UTF-8“));
    QString str1=ui->dateEdit->text();
    QString str2=ui->themeEdit->text();
    //QStr

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-07-16 17:53  FinalVersioncpp02\
     文件        4804  2015-07-16 17:53  FinalVersioncpp02\antiforget.cpp
     文件         830  2015-07-16 17:53  FinalVersioncpp02\antiforget.h
     文件        4020  2015-07-16 17:53  FinalVersioncpp02\antiforget.ui
     文件        1892  2015-07-16 17:53  FinalVersioncpp02\changegroup.ui
     文件        2014  2015-07-16 17:53  FinalVersioncpp02\ChatVersion01.pro
     文件        2084  2015-07-16 17:53  FinalVersioncpp02\clickrightbutton.cpp
     文件         726  2015-07-16 17:53  FinalVersioncpp02\clickrightbutton.h
     文件       24108  2015-07-16 17:53  FinalVersioncpp02\clickrightbutton.ui
     文件         240  2015-07-16 17:53  FinalVersioncpp02\clientcode.cpp
     文件         263  2015-07-16 17:53  FinalVersioncpp02\clientcode.h
     文件        2208  2015-07-16 17:53  FinalVersioncpp02\clientinfo.cpp
     文件        1051  2015-07-16 17:53  FinalVersioncpp02\clientinfo.h
     文件        2050  2015-07-16 17:53  FinalVersioncpp02\face.cpp
     文件         746  2015-07-16 17:53  FinalVersioncpp02\face.h
     文件        4205  2015-07-16 17:53  FinalVersioncpp02\face.ui
     文件          62  2015-07-16 17:53  FinalVersioncpp02\filepackage.cpp
     文件         246  2015-07-16 17:53  FinalVersioncpp02\filepackage.h
     文件        2166  2015-07-16 17:53  FinalVersioncpp02\fileshareclient.cpp
     文件         951  2015-07-16 17:53  FinalVersioncpp02\fileshareclient.h
     文件        1004  2015-07-16 17:53  FinalVersioncpp02\fileshareclient.ui
     文件       11517  2015-07-16 17:53  FinalVersioncpp02\fileshareserver.cpp
     文件        1879  2015-07-16 17:53  FinalVersioncpp02\fileshareserver.h
     文件        2610  2015-07-16 17:53  FinalVersioncpp02\fileshareserver.ui
     文件        3643  2015-07-16 17:53  FinalVersioncpp02\friendpart.cpp
     文件         894  2015-07-16 17:53  FinalVersioncpp02\friendpart.h
     文件         255  2015-07-16 17:53  FinalVersioncpp02\girl.qrc
     文件         891  2015-07-16 17:53  FinalVersioncpp02\groupinfo.cpp
     文件         453  2015-07-16 17:53  FinalVersioncpp02\groupinfo.h
     文件        1739  2015-07-16 17:53  FinalVersioncpp02\help.cpp
     文件         875  2015-07-16 17:53  FinalVersioncpp02\help.h
............此处省略443个文件信息

评论

共有 条评论