mirror of
https://github.com/leozide/leocad
synced 2025-01-29 20:34:50 +01:00
Show color code on tooltips.
This commit is contained in:
parent
522f6fa6f2
commit
f5bb01f724
1 changed files with 3 additions and 2 deletions
|
@ -89,8 +89,9 @@ bool lcQColorList::event(QEvent *event)
|
|||
buffer.open(QIODevice::WriteOnly);
|
||||
image.save(&buffer, "PNG");
|
||||
|
||||
const char* format = "<table><tr><td style=\"vertical-align:middle\"><img height=16 src=\"data:image/png;base64,%1\"></td><td>%2</td></tr></table>";
|
||||
QString text = QString(format).arg(QString(buffer.data().toBase64()), gColorList[mCellColors[CellIdx]].Name);
|
||||
int colorIndex = mCellColors[CellIdx];
|
||||
const char* format = "<table><tr><td style=\"vertical-align:middle\"><img height=16 src=\"data:image/png;base64,%1\"></td><td>%2 (%3)</td></tr></table>";
|
||||
QString text = QString(format).arg(QString(buffer.data().toBase64()), gColorList[colorIndex].Name, QString::number(gColorList[colorIndex].Code));
|
||||
|
||||
QToolTip::showText(helpEvent->globalPos(), text);
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue