qt中解决不同平台间编码问题以及登录窗口写法

#include <QtGui/QApplication> #include "logindialog.h" #include "mainwindow.h" #include <QTextCodec> int main(int argc, char *argv[]) { QTextCodec *codec = QTextCodec::codecForName("utf8"); QTextCodec::setCodecForLocale(codec); QTextCodec::setCodecForCStrings(codec); QTextCodec::setCodecForTr(codec); QApplication a(argc, argv); LoginDialog w; MainWindow mw; mw.setWindowFlags(Qt::WindowMinMaxButtonsHint&Qt::WindowCloseButtonHint); w.setWindowFlags((Qt::WindowCloseButtonHint)&(Qt::WindowMinimizeButtonHint)); w.setMinimumSize(400,280); w.setMaximumSize(400,280); QPalette pal; pal.setBrush(QPalette::Window,QBrush(QPixmap("./images/bg.png"))); w.setPalette(pal); if(w.exec()==QDialog::Accepted) { mw.show(); return a.exec(); } else return 0; }  

你可能感兴趣的:(qt,include,平台,Codec)