This commit is contained in:
gangphon 2023-04-24 16:35:58 +08:00
parent ec7c973d18
commit 78549a6307
3 changed files with 13 additions and 19 deletions

View File

@ -8,15 +8,15 @@
#ifdef _MSC_VER //MSVC编译器 #ifdef _MSC_VER //MSVC编译器
#include <Windows.h> #include <Windows.h>
#include <DbgHelp.h> #include <DbgHelp.h>
#if _MSC_VER >= 1600 #if _MSC_VER >= 1600
#pragma execution_character_set("utf-8") #pragma execution_character_set("utf-8")
#endif #endif
LONG WINAPI handleException(_EXCEPTION_POINTERS *excep) { LONG WINAPI handleException(_EXCEPTION_POINTERS *excep) {
QString errCode = QString::number(excep->ExceptionRecord->ExceptionCode, 16); auto errCode = QString::number(excep->ExceptionRecord->ExceptionCode, 16);
QString errAddr = QString::number((uint)excep->ExceptionRecord->ExceptionAddress, 16); auto errAddr = QString::number((uint)excep->ExceptionRecord->ExceptionAddress, 16);
HANDLE hDumpFile = CreateFile(L"c:/ledok-crash.dmp", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); auto hDumpFile = CreateFile(L"c:/ledok-crash.dmp", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if(hDumpFile == INVALID_HANDLE_VALUE) { if(hDumpFile == INVALID_HANDLE_VALUE) {
qDebug()<<"handleException hDumpFile INVALID"<<"ExceptionCode"<<errCode<<"ExceptionAddress"<<errAddr; qCritical()<<"handleException hDumpFile INVALID"<<"ExceptionCode"<<errCode<<"ExceptionAddress"<<errAddr;
return EXCEPTION_CONTINUE_SEARCH; return EXCEPTION_CONTINUE_SEARCH;
} }
MINIDUMP_EXCEPTION_INFORMATION dumpInfo{GetCurrentThreadId(), excep, TRUE}; MINIDUMP_EXCEPTION_INFORMATION dumpInfo{GetCurrentThreadId(), excep, TRUE};

View File

@ -23,8 +23,8 @@ PageEditor::PageEditor(QWidget *parent) : QWidget(parent) {
}); });
fdScale = new QLabel("100"); fdScale = new QLabel("100");
QPalette pal; auto pal = fdScale->palette();
pal.setBrush(QPalette::Window, Qt::white); pal.setBrush(QPalette::Button, Qt::white);
fdScale->setPalette(pal); fdScale->setPalette(pal);
fdScale->setAutoFillBackground(true); fdScale->setAutoFillBackground(true);
fdScale->setFixedWidth(32); fdScale->setFixedWidth(32);
@ -98,7 +98,10 @@ PageEditor::PageEditor(QWidget *parent) : QWidget(parent) {
vBox->addWidget(toolBar); vBox->addWidget(toolBar);
graphicsView = new QGraphicsView(this); graphicsView = new QGraphicsView(this);
graphicsView->setStyleSheet("QGraphicsView{background-color:transparent;}"); pal = graphicsView->palette();
pal.setBrush(QPalette::Base, QColor(0xbbbbbb));
graphicsView->setAutoFillBackground(true);
graphicsView->setPalette(pal);
vBox->addWidget(graphicsView); vBox->addWidget(graphicsView);
} }

View File

@ -43,9 +43,6 @@ ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : QDialog(pare
setAttribute(Qt::WA_AlwaysShowToolTips); setAttribute(Qt::WA_AlwaysShowToolTips);
if(parent && ! parent->isMaximized()) resize(parent->size()); if(parent && ! parent->isMaximized()) resize(parent->size());
else resize(1280, 720); else resize(1280, 720);
// auto plt = palette();
// plt.setBrush(QPalette::Window, QColor(0xdddddd));
// setPalette(plt);
setWindowTitle(progItem->mName); setWindowTitle(progItem->mName);
auto vBox = new QVBoxLayout(this); auto vBox = new QVBoxLayout(this);
@ -360,7 +357,7 @@ ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : QDialog(pare
vBoxPage->setContentsMargins(0, 0, 0, 0); vBoxPage->setContentsMargins(0, 0, 0, 0);
vBoxPage->setSpacing(0); vBoxPage->setSpacing(0);
auto lbName = new QLabel(tr("program")); auto lbName = new QLabel(tr("program"));
lbName->setStyleSheet("QLabel{background-color: #bbbbbb;}"); lbName->setStyleSheet("QLabel{background-color: #bbb;}");
lbName->setAlignment(Qt::AlignCenter); lbName->setAlignment(Qt::AlignCenter);
vBoxPage->addWidget(lbName); vBoxPage->addWidget(lbName);
@ -509,12 +506,6 @@ ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : QDialog(pare
vBox->addLayout(hBox); vBox->addLayout(hBox);
QGraphicsDropShadowEffect *shadow_effect = new QGraphicsDropShadowEffect(progEditorMid);
shadow_effect->setOffset(0, 0);
shadow_effect->setColor(QColor(38, 78, 119, 127));//阴影颜色
shadow_effect->setBlurRadius(8);//阴影半径
progEditorMid->setGraphicsEffect(shadow_effect);
QDir progQDir(mProgItem->mProgDir); QDir progQDir(mProgItem->mProgDir);
if(progQDir.exists()) { if(progQDir.exists()) {
QStringList pageNames = progQDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks); QStringList pageNames = progQDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);