diff --git a/backend_qt/qzint.cpp b/backend_qt/qzint.cpp index 65d386f1..e22b5b44 100644 --- a/backend_qt/qzint.cpp +++ b/backend_qt/qzint.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2008 by BogDan Vatra * * bogdan@licentia.eu * - * Copyright (C) 2010-2017 Robin Stuart * + * Copyright (C) 2010-2020 Robin Stuart * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -333,7 +333,36 @@ namespace Zint { // Plot rectangles rect = m_zintSymbol->vector->rectangles; while (rect) { - painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(m_fgColor)); + if (rect->colour == -1) { + painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(m_fgColor)); + } else { + switch(rect->colour) { + case 0: // White + painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::white)); + break; + case 1: // Cyan + painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::cyan)); + break; + case 2: // Blue + painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::blue)); + break; + case 3: // Magenta + painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::magenta)); + break; + case 4: // Red + painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::red)); + break; + case 5: // Yellow + painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::yellow)); + break; + case 6: // Green + painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::green)); + break; + default: + painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::black)); + break; + } + } rect = rect->next; } diff --git a/frontend_qt/mainwindow.cpp b/frontend_qt/mainwindow.cpp index f97586e3..183fcc85 100644 --- a/frontend_qt/mainwindow.cpp +++ b/frontend_qt/mainwindow.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2008 by BogDan Vatra * - * Copyright (C) 2009-2019 by Robin Stuart * + * Copyright (C) 2009-2020 by Robin Stuart * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -107,6 +107,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl) "Telepen", "Telepen Numeric", "UK Plessey", + "Ultracode", "UPNQR", "Universal Product Code (UPC-A)", "Universal Product Code (UPC-E)", diff --git a/frontend_qt/mainwindow.h b/frontend_qt/mainwindow.h index 0da976d4..f1c67601 100644 --- a/frontend_qt/mainwindow.h +++ b/frontend_qt/mainwindow.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2008 by BogDan Vatra * - * Copyright (C) 2009-2019 by Robin Stuart * + * Copyright (C) 2009-2020 by Robin Stuart * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -102,6 +102,7 @@ public: TELEPEN = 32, TELEPEN_NUM = 87, PLESSEY = 86, + ULTRA = 144, UPNQR = 143, UPCA = 34, UPCE = 37,