mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-14 00:51:48 +08:00
has been completed.
This commit is contained in:
21
main.cpp
21
main.cpp
@ -6,10 +6,25 @@
|
||||
#include "loginwidget.h"
|
||||
#include "model/datacenter.h"
|
||||
|
||||
FILE* output = nullptr;
|
||||
|
||||
void msgHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg) {
|
||||
(void)type;
|
||||
(void)context;
|
||||
const QByteArray& log = msg.toUtf8();
|
||||
fprintf(output, "%s\n", log.constData());
|
||||
fflush(output);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
#if DEPOLY
|
||||
output = fopen("./log.txt", "a");
|
||||
qInstallMessageHandler(msgHandler);
|
||||
#endif
|
||||
|
||||
qputenv("QT_QPA_PLATFORM", "windows:darkmode=0");
|
||||
|
||||
LOG() << "Hello";
|
||||
@ -31,7 +46,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#if TEST_SKIP_LOGIN
|
||||
|
||||
QPalette palette;
|
||||
QPalette palette;
|
||||
palette.setColor(QPalette::WindowText, Qt::black);// 窗口文字颜色
|
||||
QApplication::setPalette(palette);
|
||||
|
||||
@ -39,6 +54,10 @@ int main(int argc, char *argv[])
|
||||
MainWidget* w = MainWidget::getInstance();
|
||||
w->show();
|
||||
#else
|
||||
QPalette palette;
|
||||
palette.setColor(QPalette::WindowText, Qt::black);// 窗口文字颜色
|
||||
QApplication::setPalette(palette);
|
||||
|
||||
LoginWidget* loginWidget = new LoginWidget(nullptr);
|
||||
loginWidget->show();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user