Warning, file /rolisteam/rolisteam/src/libraries/rwidgets/editors/noteeditor/format_OO_oasis_/FoColorName.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 
0002 
0003 #include "FoColorName.h"
0004 #include <QDomDocument>
0005 #include <QTextDocument>
0006 #include <QTextTableFormat>
0007 
0008 FopColor::FopColor(const QString colorchunk, FopColor::AlternateColor col)
0009 {
0010     foplist.clear();
0011 
0012     record("aliceblue", QColor(240, 248, 255, 255));
0013     record("authoren", QColor(240, 255, 255, 255));
0014     record("scribe", QColor(240, 255, 255, 255));
0015     record("antiquewhite", QColor(250, 235, 215, 255));
0016     record("aqua", QColor(0, 255, 255, 255));
0017     record("aquamarine", QColor(127, 255, 212, 255));
0018     record("azure", QColor(240, 255, 255, 255));
0019     record("beige", QColor(245, 245, 220, 255));
0020     record("bisque", QColor(255, 228, 196, 255));
0021     record("black", QColor(0, 0, 0, 255));
0022     record("blanchedalmond", QColor(255, 235, 205, 255));
0023     record("blue", QColor(0, 0, 255, 255));
0024     record("blueviolet", QColor(138, 43, 226, 255));
0025     record("brown", QColor(165, 42, 42, 255));
0026     record("burlywood", QColor(222, 184, 135, 255));
0027     record("cadetblue", QColor(95, 158, 160, 255));
0028     record("chartreuse", QColor(127, 255, 0, 255));
0029     record("chocolate", QColor(210, 105, 30, 255));
0030     record("coral", QColor(255, 127, 80, 255));
0031     record("cornflowerblue", QColor(100, 149, 237, 255));
0032     record("cornsilk", QColor(255, 248, 220, 255));
0033     record("crimson", QColor(220, 20, 60, 255));
0034     record("cyan", QColor(0, 255, 255, 255));
0035     record("darkblue", QColor(0, 0, 139, 255));
0036     record("darkcyan", QColor(0, 139, 139, 255));
0037     record("darkgoldenrod", QColor(184, 134, 11, 255));
0038     record("darkgray", QColor(169, 169, 169, 255));
0039     record("darkgreen", QColor(0, 100, 0, 255));
0040     record("darkgrey", QColor(169, 169, 169, 255));
0041     record("darkkhaki", QColor(189, 183, 107, 255));
0042     record("darkmagenta", QColor(139, 0, 139, 255));
0043     record("darkolivegreen", QColor(85, 107, 47, 255));
0044     record("darkorange", QColor(255, 140, 0, 255));
0045     record("darkorchid", QColor(153, 50, 204, 255));
0046     record("darkred", QColor(139, 0, 0, 255));
0047     record("darksalmon", QColor(233, 150, 122, 255));
0048     record("darkseagreen", QColor(143, 188, 143, 255));
0049     record("darkslateblue", QColor(72, 61, 139, 255));
0050     record("darkslategray", QColor(47, 79, 79, 255));
0051     record("darkslategrey", QColor(47, 79, 79, 255));
0052     record("darkturquoise", QColor(0, 206, 209, 255));
0053     record("darkviolet", QColor(148, 0, 211, 255));
0054     record("deeppink", QColor(255, 20, 147, 255));
0055     record("deepskyblue", QColor(0, 191, 255, 255));
0056     record("dimgray", QColor(105, 105, 105, 255));
0057     record("dimgrey", QColor(105, 105, 105, 255));
0058     record("dodgerblue", QColor(30, 144, 255, 255));
0059     record("firebrick", QColor(178, 34, 34, 255));
0060     record("floralwhite", QColor(255, 250, 240, 255));
0061     record("forestgreen", QColor(34, 139, 34, 255));
0062     record("fuchsia", QColor(255, 0, 255, 255));
0063     record("gainsboro", QColor(220, 220, 220, 255));
0064     record("ghostwhite", QColor(248, 248, 255, 255));
0065     record("gold", QColor(255, 215, 0, 255));
0066     record("goldenrod", QColor(218, 165, 32, 255));
0067     record("gray", QColor(128, 128, 128, 255));
0068     record("grey", QColor(128, 128, 128, 255));
0069     record("green", QColor(0, 128, 0, 255));
0070     record("greenyellow", QColor(173, 255, 47, 255));
0071     record("honeydew", QColor(240, 255, 240, 255));
0072     record("hotpink", QColor(255, 105, 180, 255));
0073     record("indianred", QColor(205, 92, 92, 255));
0074     record("indigo", QColor(75, 0, 130, 255));
0075     record("ivory", QColor(255, 255, 240, 255));
0076     record("khaki", QColor(240, 230, 140, 255));
0077     record("lavender", QColor(230, 230, 250, 255));
0078     record("lavenderblush", QColor(255, 240, 245, 255));
0079     record("lawngreen", QColor(124, 252, 0, 255));
0080     record("lemonchiffon", QColor(255, 250, 205, 255));
0081     record("lightblue", QColor(173, 216, 230, 255));
0082     record("lightcoral", QColor(240, 128, 128, 255));
0083     record("lightcyan", QColor(224, 255, 255, 255));
0084     record("lightgoldenrodyellow", QColor(250, 250, 210, 255));
0085     record("lightgray", QColor(211, 211, 211, 255));
0086     record("lightgreen", QColor(144, 238, 144, 255));
0087     record("lightgrey", QColor(211, 211, 211, 255));
0088     record("lightpink", QColor(255, 182, 193, 255));
0089     record("lightsalmon", QColor(255, 160, 122, 255));
0090     record("lightseagreen", QColor(32, 178, 170, 255));
0091     record("lightskyblue", QColor(135, 206, 250, 255));
0092     record("lightslategray", QColor(119, 136, 153, 255));
0093     record("lightslategrey", QColor(119, 136, 153, 255));
0094     record("lightsteelblue", QColor(176, 196, 222, 255));
0095     record("lightyellow", QColor(255, 255, 224, 255));
0096     record("lime", QColor(0, 255, 0, 255));
0097     record("limegreen", QColor(50, 205, 50, 255));
0098     record("linen", QColor(250, 240, 230, 255));
0099     record("magenta", QColor(255, 0, 255, 255));
0100     record("maroon", QColor(128, 0, 0, 255));
0101     record("mediumaquamarine", QColor(102, 205, 170, 255));
0102     record("mediumblue", QColor(0, 0, 205, 255));
0103     record("mediumorchid", QColor(186, 85, 211, 255));
0104     record("mediumpurple", QColor(147, 112, 219, 255));
0105     record("mediumseagreen", QColor(60, 179, 113, 255));
0106     record("mediumslateblue", QColor(123, 104, 238, 255));
0107     record("mediumspringgreen", QColor(0, 250, 154, 255));
0108     record("mediumturquoise", QColor(72, 209, 204, 255));
0109     record("mediumvioletred", QColor(199, 21, 133, 255));
0110     record("midnightblue", QColor(25, 25, 112, 255));
0111     record("mintcream", QColor(245, 255, 250, 255));
0112     record("mistyrose", QColor(255, 228, 225, 255));
0113     record("moccasin", QColor(255, 228, 181, 255));
0114     record("navajowhite", QColor(255, 222, 173, 255));
0115     record("navy", QColor(0, 0, 128, 255));
0116     record("oldlace", QColor(253, 245, 230, 255));
0117     record("olive", QColor(128, 128, 0, 255));
0118     record("olivedrab", QColor(107, 142, 35, 255));
0119     record("orange", QColor(255, 165, 0, 255));
0120     record("orangered", QColor(255, 69, 0, 255));
0121     record("orchid", QColor(218, 112, 214, 255));
0122     record("palegoldenrod", QColor(238, 232, 170, 255));
0123     record("palegreen", QColor(152, 251, 152, 255));
0124     record("paleturquoise", QColor(175, 238, 238, 255));
0125     record("palevioletred", QColor(219, 112, 147, 255));
0126     record("papayawhip", QColor(255, 239, 213, 255));
0127     record("peachpuff", QColor(255, 218, 185, 255));
0128     record("peru", QColor(205, 133, 63, 255));
0129     record("pink", QColor(255, 192, 203, 255));
0130     record("plum", QColor(221, 160, 221, 255));
0131     record("powderblue", QColor(176, 224, 230, 255));
0132     record("purple", QColor(128, 0, 128, 255));
0133     record("red", QColor(255, 0, 0, 255));
0134     record("rosybrown", QColor(188, 143, 143, 255));
0135     record("royalblue", QColor(65, 105, 225, 255));
0136     record("saddlebrown", QColor(139, 69, 19, 255));
0137     record("salmon", QColor(250, 128, 114, 255));
0138     record("sandybrown", QColor(244, 164, 96, 255));
0139     record("seagreen", QColor(46, 139, 87, 255));
0140     record("seashell", QColor(255, 245, 238, 255));
0141     record("sienna", QColor(160, 82, 45, 255));
0142     record("silver", QColor(192, 192, 192, 255));
0143     record("skyblue", QColor(135, 206, 235, 255));
0144     record("slateblue", QColor(106, 90, 205, 255));
0145     record("slategray", QColor(112, 128, 144, 255));
0146     record("slategrey", QColor(112, 128, 144, 255));
0147     record("snow", QColor(255, 250, 250, 255));
0148     record("springgreen", QColor(0, 255, 127, 255));
0149     record("steelblue", QColor(70, 130, 180, 255));
0150     record("tan", QColor(210, 180, 140, 255));
0151     record("teal", QColor(0, 128, 128, 255));
0152     record("thistle", QColor(216, 191, 216, 255));
0153     record("tomato", QColor(255, 99, 71, 255));
0154     record("turquoise", QColor(64, 224, 208, 255));
0155     record("violet", QColor(238, 130, 238, 255));
0156     record("wheat", QColor(245, 222, 179, 255));
0157     record("white", QColor(255, 255, 255, 255));
0158     record("whitesmoke", QColor(245, 245, 245, 255));
0159     record("yellow", QColor(255, 255, 0, 255));
0160     record("yellowgreen", QColor(154, 205, 50, 255));
0161 
0162     QStringList colorNames= QColor::colorNames();
0163     for(QString& name : colorNames)
0164     {
0165         record(name, QColor(name));
0166         /*  qt overwrite color ? */
0167     }
0168 
0169     fopcolorNames.clear();
0170     QMapIterator<QString, QColor> i(foplist);
0171 
0172     while(i.hasNext())
0173     {
0174         i.next();
0175         fopcolorNames.append(i.key()); ///// i.value()
0176     }
0177 
0178     fopcolorNames.sort(); /* sort names */
0179 
0180     avaiablelist.clear();
0181 
0182     for(int i= 0; i < fopcolorNames.size(); ++i)
0183     {
0184         const QString humanname= fopcolorNames.at(i).toLower().trimmed();
0185         QColor iter= foplist[humanname];
0186         avaiablelist.insert(humanname, iter);
0187     }
0188     foplist.clear();
0189 
0190     currentcolor= foColor(colorchunk, col);
0191 }
0192 
0193 QString FopColor::foName(const QColor e)
0194 {
0195     ////////QColor
0196     QStringList icoli= fopListColor();
0197     for(QString name : icoli)
0198     {
0199         const QColor runn= foColor(name);
0200         if(e.rgba() == runn.rgba())
0201         {
0202             return name;
0203         }
0204     }
0205 
0206     return QString("transparent");
0207 }
0208 
0209 QColor FopColor::foColor(const QString colorchunk, FopColor::AlternateColor col)
0210 {
0211     QString wandedcolor= colorchunk;
0212     QString fcol= wandedcolor.trimmed().toLower();
0213 
0214     if(fopcolorNames.contains(fcol))
0215     {
0216         return avaiablelist[fcol];
0217     }
0218     if(fcol.size() < 2)
0219     {
0220         return alternateColor(col);
0221     }
0222 
0223     if(fcol.startsWith("rgb("))
0224     {
0225         QString grep= fcol.mid(4, fcol.size() - 5);
0226         grep= grep.replace(")", "");
0227         QStringList v= grep.split(",");
0228 
0229         if(v.size() == 3)
0230         {
0231             const int R1= v.at(0).toInt();
0232             const int R2= v.at(1).toInt();
0233             const int R3= v.at(2).toInt();
0234             return QColor(R1, R2, R3, 255);
0235         }
0236         else if(v.size() >= 4)
0237         {
0238             const int Rt1= v.at(0).toInt();
0239             const int Rt2= v.at(1).toInt();
0240             const int Rt3= v.at(2).toInt();
0241             const int Ralph= v.at(3).toInt();
0242             QColor cctra(Rt1, Rt2, Rt3);
0243             cctra.setAlpha(Ralph);
0244             return cctra;
0245         }
0246         else
0247         {
0248             return alternateColor(col);
0249         }
0250     }
0251     if(fcol.startsWith("#"))
0252     {
0253         return QColor(fcol);
0254     }
0255     return alternateColor(col);
0256 }
0257 
0258 QColor FopColor::alternateColor(FopColor::AlternateColor col)
0259 {
0260     if(col == LightColor)
0261     {
0262         return QColor(Qt::white);
0263     }
0264     else if(col == Transparent)
0265     {
0266         return QColor(Qt::transparent);
0267     }
0268     else
0269     {
0270         return QColor(Qt::black);
0271     }
0272 }
0273 
0274 QPixmap FopColor::createColorMap(const QString colorchunk)
0275 {
0276     QColor pc= foColor(colorchunk, DarkColor);
0277 
0278     QPixmap pixmap(50, 50);
0279     pixmap.fill(pc);
0280     return pixmap;
0281 }
0282 
0283 void FopColor::record(const QString colorchunk, QColor item)
0284 {
0285     foplist.insert(colorchunk, item);
0286 }
0287 
0288 QString metrics(const qreal screenpoint)
0289 {
0290     return QString("%1mm").arg(Pointo(screenpoint, "mm"));
0291 }
0292 
0293 qreal Unit(const QString datain)
0294 {
0295     QString ctmp= datain;
0296     const QString data= ctmp.replace(" ", "").trimmed();
0297     qreal points= -1;
0298 
0299     if(data.size() < 1)
0300     {
0301         return points;
0302     }
0303 
0304     if(data.endsWith("%"))
0305     {
0306         return 100;
0307     }
0308 
0309     if(datain == "0")
0310     {
0311         return 0;
0312     }
0313     if(data.endsWith("pt") || data.endsWith("px"))
0314     {
0315         points= QStringView{data}.left(data.length() - 2).toDouble();
0316         return points;
0317     }
0318     else if(data.endsWith("cm"))
0319     {
0320         double value= QStringView{data}.left(data.length() - 2).toDouble();
0321         points= CM_TO_POINT(value);
0322     }
0323     else if(data.endsWith("em"))
0324     {
0325         points= QStringView{data}.left(data.length() - 2).toDouble();
0326     }
0327     else if(data.endsWith("mm"))
0328     {
0329         double value= QStringView{data}.left(data.length() - 2).toDouble();
0330         points= MM_TO_POINT(value);
0331     }
0332     else if(data.endsWith("dm"))
0333     {
0334         double value= QStringView{data}.left(data.length() - 2).toDouble();
0335         points= DM_TO_POINT(value);
0336     }
0337     else if(data.endsWith("in"))
0338     {
0339         double value= QStringView{data}.left(data.length() - 2).toDouble();
0340         points= INCH_TO_POINT(value);
0341     }
0342     else if(data.endsWith("inch"))
0343     {
0344         double value= QStringView{data}.left(data.length() - 4).toDouble();
0345         points= INCH_TO_POINT(value);
0346     }
0347     else if(data.endsWith("pi"))
0348     {
0349         double value= QStringView{data}.left(data.length() - 4).toDouble();
0350         points= PI_TO_POINT(value);
0351     }
0352     else if(data.endsWith("dd"))
0353     {
0354         double value= QStringView{data}.left(data.length() - 4).toDouble();
0355         points= DD_TO_POINT(value);
0356     }
0357     else if(data.endsWith("cc"))
0358     {
0359         double value= QStringView{data}.left(data.length() - 4).toDouble();
0360         points= CC_TO_POINT(value);
0361     }
0362     else
0363     {
0364         points= -1;
0365     }
0366 
0367     return PDIFIX(points);
0368 }
0369 
0370 qreal Pointo(qreal unit, const QString unita)
0371 {
0372     qreal ri= -1;
0373     if(unita == "cm")
0374     {
0375         ri= POINT_TO_CM(unit);
0376     }
0377     else if(unita == "pt" || unita == "px")
0378     {
0379         ri= unit;
0380         return ri;
0381     }
0382     else if(unita == "mm")
0383     {
0384         ri= POINT_TO_MM(unit);
0385     }
0386     else if(unita == "dm")
0387     {
0388         ri= POINT_TO_DM(unit);
0389     }
0390     else if(unita == "inch")
0391     {
0392         ri= POINT_TO_INCH(unit);
0393     }
0394     else if(unita == "pi")
0395     {
0396         ri= POINT_TO_PI(unit);
0397     }
0398     else if(unita == "dd")
0399     {
0400         ri= POINT_TO_DD(unit);
0401     }
0402     else if(unita == "cc")
0403     {
0404         ri= POINT_TO_CC(unit);
0405     }
0406     else
0407     {
0408         ri= -1;
0409     }
0410     return ri;
0411 }
0412 
0413 qreal ToUnit(qreal unit, const QString unita)
0414 {
0415     return Pointo(unit, unita);
0416 }
0417 
0418 qreal ToPoint(qreal unit, const QString unita)
0419 {
0420     qreal ri= -1;
0421     if(unita == "cm")
0422     {
0423         ri= CM_TO_POINT(unit);
0424     }
0425     else if(unita == "pt" || unita == "px")
0426     {
0427         ri= unit;
0428         return ri;
0429     }
0430     else if(unita == "mm")
0431     {
0432         ri= MM_TO_POINT(unit);
0433     }
0434     else if(unita == "dm")
0435     {
0436         ri= DM_TO_POINT(unit);
0437     }
0438     else if(unita == "inch")
0439     {
0440         ri= INCH_TO_POINT(unit);
0441     }
0442     else if(unita == "pi")
0443     {
0444         ri= PI_TO_POINT(unit);
0445     }
0446     else if(unita == "dd")
0447     {
0448         ri= DD_TO_POINT(unit);
0449     }
0450     else if(unita == "cc")
0451     {
0452         ri= CC_TO_POINT(unit);
0453     }
0454     else
0455     {
0456         ri= -1;
0457     }
0458     return ri;
0459 }
0460 
0461 FoRegion::FoRegion()
0462 {
0463     /* default param region */
0464     margin_top= CM_TO_POINT(2.5);
0465     margin_bottom= CM_TO_POINT(2.5);
0466     margin_left= CM_TO_POINT(2.5);
0467     margin_right= CM_TO_POINT(1.5);
0468     bg= QColor(Qt::white);
0469     bog= QColor(Qt::transparent);
0470     edom= QByteArray("<scribe/>");
0471     border= 0.; /* border > 0 draw */
0472     padding= CM_TO_POINT(0.2);
0473     rpen= QPen(Qt::NoPen);
0474     enable= false;
0475 }
0476 void FoRegion::marginNoBody()
0477 {
0478     toAll(CM_TO_POINT(0.1));
0479     padding= CM_TO_POINT(0.1);
0480     border= 0.;
0481 }
0482 
0483 QMap<QString, QPen> FoRegion::penstyle()
0484 {
0485     QMap<QString, QPen> plist;
0486     plist.insert(QString("0.0mm empty border"), QPen(Qt::NoPen));
0487     plist.insert(QString("0.5mm solid"), QPen(Qt::black, MM_TO_POINT(0.5), Qt::SolidLine));
0488     plist.insert(QString("0.5mm dotline"), QPen(Qt::black, MM_TO_POINT(0.5), Qt::DotLine));
0489     for(int i= 1; i < 9; ++i)
0490     {
0491         plist.insert(QString("%1mm solid").arg(i), QPen(Qt::black, MM_TO_POINT(i), Qt::SolidLine));
0492         plist.insert(QString("%1mm dotline").arg(i), QPen(Qt::black, MM_TO_POINT(i), Qt::DotLine));
0493         plist.insert(QString("%1mm dashline").arg(i), QPen(Qt::black, MM_TO_POINT(i), Qt::DashLine));
0494     }
0495     return plist;
0496 }
0497 /*  fo:block-container or other frame apache not on region */
0498 void FoRegion::styleContainer(QDomElement e, const qreal height)
0499 {
0500     FopColor hc;
0501     e.setAttribute("background-color", hc.foName(bg));
0502     if(rpen != QPen(Qt::NoPen))
0503     {
0504         e.setAttribute("border-width", metrics(rpen.width()));
0505         Qt::PenStyle ds= rpen.style();
0506         if(ds == Qt::DotLine)
0507         {
0508             e.setAttribute("border-style", "dotted");
0509         }
0510         else if(ds == Qt::DashLine)
0511         {
0512             e.setAttribute("border-style", "dashed");
0513         }
0514         else
0515         {
0516             /* solid */
0517             e.setAttribute("border-style", "solid");
0518         }
0519         e.setAttribute("border-color", hc.foName(bog));
0520     }
0521 
0522     e.setAttribute("margin-top", metrics(margin_top));
0523     e.setAttribute("margin-bottom", metrics(margin_bottom));
0524     e.setAttribute("margin-left", metrics(margin_left));
0525     e.setAttribute("margin-right", metrics(margin_right));
0526     e.setAttribute("padding", metrics(padding));
0527     e.setAttribute("overflow", "hidden");
0528 
0529     if(height != 0)
0530     {
0531         e.setAttribute("height", metrics(qAbs(height - margin_top - padding - margin_bottom)));
0532     }
0533     // delete &hc;
0534 }
0535 
0536 /* form qtexdocument to this margin an papersize */
0537 void FoRegion::styleSmallDocument(QTextDocument* doc)
0538 {
0539     QTextFrame* Tframe= doc->rootFrame();
0540     QTextFrameFormat Ftf= Tframe->frameFormat();
0541     Ftf.setLeftMargin(margin_left);
0542     Ftf.setBottomMargin(margin_bottom);
0543     Ftf.setTopMargin(margin_top);
0544     Ftf.setBackground(QBrush(bg));
0545     Ftf.setRightMargin(margin_right);
0546     Ftf.setPadding(padding);
0547     Tframe->setFrameFormat(Ftf);
0548 }
0549 
0550 void FoRegion::styleReadDocument(const QTextDocument* doc)
0551 {
0552     QTextFrame* Tframe= doc->rootFrame();
0553     QTextFrameFormat formatibb= Tframe->frameFormat();
0554     margin_top= formatibb.topMargin();
0555     margin_bottom= formatibb.bottomMargin();
0556     margin_left= formatibb.leftMargin();
0557     margin_right= formatibb.rightMargin();
0558     padding= formatibb.padding();
0559 }
0560 
0561 QString FoRegion::hash() const
0562 {
0563     QByteArray unique("Hash-Forerin:");
0564     const QString header= QString("%1|%2|%3|%4|").arg(margin_top).arg(margin_bottom).arg(margin_right).arg(margin_left);
0565     const QString margin= QString("%1|%2|%3").arg(bg.name(), bog.name()).arg(border);
0566     QString position= "Disable";
0567     if(enable)
0568     {
0569         position= "Enable";
0570     }
0571     unique.append(position.toUtf8());
0572     unique.append(header.toUtf8());
0573     unique.append(margin.toUtf8());
0574     QCryptographicHash enmd5(QCryptographicHash::Sha1);
0575     enmd5.addData(unique);
0576     const QByteArray chunkha= enmd5.result();
0577     return QString(chunkha.toHex());
0578 }
0579 
0580 FoRegion& FoRegion::operator=(const FoRegion& d)
0581 {
0582     bg= d.bg;
0583     bog= d.bog;
0584     margin_top= d.margin_top;
0585     margin_bottom= d.margin_bottom;
0586     margin_left= d.margin_left;
0587     margin_right= d.margin_right;
0588     edom= d.edom;
0589     border= d.border;
0590     enable= d.enable;
0591     padding= d.padding;
0592     rpen= d.rpen;
0593     return *this;
0594 }
0595 
0596 /*  1 init / 2 master */
0597 void FoRegion::fomax(FoRegion& m, FoRegion& d)
0598 {
0599     bg= d.bg;
0600     bog= d.bog;
0601     margin_top= qMax(d.margin_top, m.margin_top);
0602     margin_bottom= qMax(d.margin_bottom, m.margin_bottom);
0603     margin_left= qMax(d.margin_left, m.margin_left);
0604     margin_right= qMax(d.margin_right, m.margin_right);
0605     edom= d.edom;
0606     border= d.border;
0607     enable= d.enable;
0608     padding= d.padding;
0609     rpen= d.rpen;
0610 }
0611 
0612 void FoRegion::toAll(const qreal unique)
0613 {
0614     margin_top= unique;
0615     margin_bottom= unique;
0616     margin_left= unique;
0617     margin_right= unique;
0618 }