Ejemplo n.º 1
0
QString FileTransferInstance::wrapIntoForm(const QString& content, const QString &type, const QString &imgAstr, const QString &imgBstr)
{
    QString w = QString::number(QImage(":/ui/fileTransferInstance/emptyLRedFileButton.png").size().width());
    QString imgLeftA, imgLeftB;

    if (type == "green")
    {
        imgLeftA = "<img src=\"data:placeholder/png;base64," + QImage2base64(QImage(":/ui/fileTransferInstance/emptyLGreenFileButton.png").mirrored(true,false)) + "\">";
        imgLeftB = "<img src=\"data:placeholder/png;base64," + QImage2base64(QImage(":/ui/fileTransferInstance/emptyLGreenFileButton.png").mirrored(true,true)) + "\">";
    }

    if (type == "silver")
    {
        imgLeftA = "<img src=\"data:placeholder/png;base64," + QImage2base64(QImage(":/ui/fileTransferInstance/sliverRTEdge.png").mirrored(true,false)) + "\">";
        imgLeftB = "<img src=\"data:placeholder/png;base64," + QImage2base64(QImage(":/ui/fileTransferInstance/sliverRTEdge.png").mirrored(true,true)) + "\">";
    }

    if (type == "red")
    {
        imgLeftA = "<img src=\"data:placeholder/png;base64," + QImage2base64(QImage(":/ui/fileTransferInstance/emptyLRedFileButton.png").mirrored(true,false)) + "\">";
        imgLeftB = "<img src=\"data:placeholder/png;base64," + QImage2base64(QImage(":/ui/fileTransferInstance/emptyLRedFileButton.png").mirrored(true,true)) + "\">";
    }

    QString res;
    res =  "<table cellspacing=\"0\">\n";
    res += "<tr valign=middle>\n";
    res += "<td width=" + w + ">\n";
    res += "<div class=button>" + imgLeftA + "<br>" + imgLeftB + "</div>\n";
    res += "</td>\n";
    res += insertMiniature(type);
    res += "<td width=" + QString::number(contentPrefWidth) + ">\n";
    res += "<div class=" + type + ">";
    res += content;
    res += "</div>\n";
    res += "</td>\n";
    res += "<td width=3>\n";
    res += "<div class=" + type + "></div>\n";
    res += "</td>\n";
    res += "<td>\n";
    res += "<div class=button>" + imgAstr + "<br>" + imgBstr + "</div>\n";
    res += "</td>\n";
    res += "</tr>\n";
    res += "</table>\n";

    return res;
}
Ejemplo n.º 2
0
QString FileTransferInstance::wrapIntoForm(const QString& content, const QString &type, const QString &imgAstr, const QString &imgBstr)
{
    QString res;

    res =  "<table widht=100% cellspacing=\"0\">\n";
    res += "<tr valign=middle>\n";
    res += insertMiniature(type);
    res += "<td width=100%>\n";
    res += "<div class=" + type + ">";
    res += content;
    res += "</div>\n";
    res += "</td>\n";
    res += "<td>\n";
    res += "<div class=button>" + imgAstr + "<br>" + imgBstr+ "</div>\n";
    res += "</td>\n";
    res += "</tr>\n";
    res += "</table>\n";

    return res;
}