fix: 修复元数据可视化问题以及再次编辑空颜色为黑色问题;
This commit is contained in:
parent
fecbcf821e
commit
5a83a68465
|
@ -1993,27 +1993,27 @@
|
||||||
<context>
|
<context>
|
||||||
<name>MetaDataModel</name>
|
<name>MetaDataModel</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/model/metadatamodel.cpp" line="99"/>
|
<location filename="../../src/model/metadatamodel.cpp" line="102"/>
|
||||||
<source>Begin</source>
|
<source>Begin</source>
|
||||||
<translation>开始</translation>
|
<translation>开始</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/model/metadatamodel.cpp" line="101"/>
|
<location filename="../../src/model/metadatamodel.cpp" line="104"/>
|
||||||
<source>End</source>
|
<source>End</source>
|
||||||
<translation>结束</translation>
|
<translation>结束</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/model/metadatamodel.cpp" line="103"/>
|
<location filename="../../src/model/metadatamodel.cpp" line="106"/>
|
||||||
<source>Foreground</source>
|
<source>Foreground</source>
|
||||||
<translation>前景色</translation>
|
<translation>前景色</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/model/metadatamodel.cpp" line="105"/>
|
<location filename="../../src/model/metadatamodel.cpp" line="108"/>
|
||||||
<source>Background</source>
|
<source>Background</source>
|
||||||
<translation>背景色</translation>
|
<translation>背景色</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/model/metadatamodel.cpp" line="107"/>
|
<location filename="../../src/model/metadatamodel.cpp" line="110"/>
|
||||||
<source>Comment</source>
|
<source>Comment</source>
|
||||||
<translation>批注</translation>
|
<translation>批注</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -1993,27 +1993,27 @@
|
||||||
<context>
|
<context>
|
||||||
<name>MetaDataModel</name>
|
<name>MetaDataModel</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/model/metadatamodel.cpp" line="99"/>
|
<location filename="../../src/model/metadatamodel.cpp" line="102"/>
|
||||||
<source>Begin</source>
|
<source>Begin</source>
|
||||||
<translation>開始</translation>
|
<translation>開始</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/model/metadatamodel.cpp" line="101"/>
|
<location filename="../../src/model/metadatamodel.cpp" line="104"/>
|
||||||
<source>End</source>
|
<source>End</source>
|
||||||
<translation>結束</translation>
|
<translation>結束</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/model/metadatamodel.cpp" line="103"/>
|
<location filename="../../src/model/metadatamodel.cpp" line="106"/>
|
||||||
<source>Foreground</source>
|
<source>Foreground</source>
|
||||||
<translation>前景色</translation>
|
<translation>前景色</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/model/metadatamodel.cpp" line="105"/>
|
<location filename="../../src/model/metadatamodel.cpp" line="108"/>
|
||||||
<source>Background</source>
|
<source>Background</source>
|
||||||
<translation>背景色</translation>
|
<translation>背景色</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../src/model/metadatamodel.cpp" line="107"/>
|
<location filename="../../src/model/metadatamodel.cpp" line="110"/>
|
||||||
<source>Comment</source>
|
<source>Comment</source>
|
||||||
<translation>批註</translation>
|
<translation>批註</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -39,7 +39,6 @@ void CrashHandler::init() {
|
||||||
std::signal(SIGABRT, signalHandler);
|
std::signal(SIGABRT, signalHandler);
|
||||||
std::signal(SIGSEGV, signalHandler);
|
std::signal(SIGSEGV, signalHandler);
|
||||||
std::signal(SIGILL, signalHandler);
|
std::signal(SIGILL, signalHandler);
|
||||||
std::signal(SIGABRT, signalHandler);
|
|
||||||
std::signal(SIGFPE, signalHandler);
|
std::signal(SIGFPE, signalHandler);
|
||||||
#else
|
#else
|
||||||
::signal(SIGSEGV, signalHandler);
|
::signal(SIGSEGV, signalHandler);
|
||||||
|
|
|
@ -142,7 +142,7 @@ void MetaDialog::setComment(QString comment) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetaDialog::setBackGroundColor(QColor color) {
|
void MetaDialog::setBackGroundColor(QColor color) {
|
||||||
if (color.rgba()) {
|
if (color.isValid()) {
|
||||||
cbackground->setChecked(true);
|
cbackground->setChecked(true);
|
||||||
emit cbackground->clicked(true);
|
emit cbackground->clicked(true);
|
||||||
_background = color;
|
_background = color;
|
||||||
|
@ -151,7 +151,7 @@ void MetaDialog::setBackGroundColor(QColor color) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetaDialog::setForeGroundColor(QColor color) {
|
void MetaDialog::setForeGroundColor(QColor color) {
|
||||||
if (color.rgba()) {
|
if (color.isValid()) {
|
||||||
cforeground->setChecked(true);
|
cforeground->setChecked(true);
|
||||||
emit cforeground->clicked(true);
|
emit cforeground->clicked(true);
|
||||||
_foreground = color;
|
_foreground = color;
|
||||||
|
|
|
@ -58,7 +58,7 @@ QVariant MetaDataModel::data(const QModelIndex &index, int role) const {
|
||||||
case 4:
|
case 4:
|
||||||
return d.comment;
|
return d.comment;
|
||||||
}
|
}
|
||||||
}
|
} break;
|
||||||
case Qt::DecorationRole: {
|
case Qt::DecorationRole: {
|
||||||
auto r = index.row();
|
auto r = index.row();
|
||||||
const auto &b = _doc->metadata()->getAllMetadata();
|
const auto &b = _doc->metadata()->getAllMetadata();
|
||||||
|
@ -67,9 +67,11 @@ QVariant MetaDataModel::data(const QModelIndex &index, int role) const {
|
||||||
case 2:
|
case 2:
|
||||||
if (d.foreground.isValid())
|
if (d.foreground.isValid())
|
||||||
return d.foreground;
|
return d.foreground;
|
||||||
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (d.background.isValid())
|
if (d.background.isValid())
|
||||||
return d.background;
|
return d.background;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -86,6 +88,7 @@ QVariant MetaDataModel::data(const QModelIndex &index, int role) const {
|
||||||
case 1: // end
|
case 1: // end
|
||||||
return d.end;
|
return d.end;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue