예제 #1
0
            << qMakePair(tr("Diagonal Cross"), Qt::DiagCrossPattern))
        brushStyleComboBox->addItem(brushSwatch(pair.second, color),
                                                pair.first, pair.second);
    brushStyleComboBox->setCurrentIndex(brushStyleComboBox->findData(
                brush.style()));

    penStyleComboBox = new QComboBox;
    typedef QPair<QString, Qt::PenStyle> PenPair;
    foreach (const PenPair &pair, QList<PenPair>()
            << qMakePair(tr("No Pen"), Qt::NoPen)
            << qMakePair(tr("Solid"), Qt::SolidLine)
            << qMakePair(tr("Dashed"), Qt::DashLine)
            << qMakePair(tr("Dotted"), Qt::DotLine)
            << qMakePair(tr("Dash-Dotted"), Qt::DashDotLine)
            << qMakePair(tr("Dash-Dot-Dotted"), Qt::DashDotDotLine))
        penStyleComboBox->addItem(penStyleSwatch(pair.second, color),
                                  pair.first, pair.second);
    penStyleComboBox->setCurrentIndex(penStyleComboBox->findData(
                pen.style()));

    alphaSpinBox = new QSpinBox;
    alphaSpinBox->setRange(1, 100);
    alphaSpinBox->setValue(*m_alpha);
    alphaSpinBox->setSuffix(tr(" %"));
    alphaSpinBox->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
    alphaSpinBox->setToolTip(tr("<p>How opaque the highlighting "
            "color is. The default is 13%"));

    squareSizeSpinBox = new QSpinBox;
    squareSizeSpinBox->setRange(2, 40);
    squareSizeSpinBox->setValue(*m_squareSize);
예제 #2
0
    widthSpinBox = new QSpinBox;
    widthSpinBox->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
    widthSpinBox->setRange(0, 20);
    widthSpinBox->setSuffix(tr(" px"));
    widthSpinBox->setSpecialValueText(tr("1 px (fine)"));

    lineStyleComboBox = new QComboBox;
    typedef QPair<QString, Qt::PenStyle> PenPair;
    foreach (const PenPair &pair, QList<PenPair>()
            << qMakePair(tr("No Pen"), Qt::NoPen)
            << qMakePair(tr("Solid"), Qt::SolidLine)
            << qMakePair(tr("Dashed"), Qt::DashLine)
            << qMakePair(tr("Dotted"), Qt::DotLine)
            << qMakePair(tr("Dash-Dotted"), Qt::DashDotLine)
            << qMakePair(tr("Dash-Dot-Dotted"), Qt::DashDotDotLine))
        lineStyleComboBox->addItem(penStyleSwatch(pair.second),
                                   pair.first, pair.second);
    capStyleComboBox = new QComboBox;
    capStyleComboBox->addItem(penCapSwatch(Qt::FlatCap),
                              tr("Flat"), Qt::FlatCap);
    capStyleComboBox->addItem(penCapSwatch(Qt::RoundCap),
                              tr("Round"), Qt::RoundCap);
    capStyleComboBox->addItem(penCapSwatch(Qt::SquareCap),
                              tr("Square"), Qt::SquareCap);

    joinStyleComboBox = new QComboBox;
    joinStyleComboBox->addItem(penJoinSwatch(Qt::BevelJoin),
                               tr("Join"), Qt::BevelJoin);
    joinStyleComboBox->addItem(penJoinSwatch(Qt::MiterJoin),
                               tr("Miter"), Qt::MiterJoin);
    joinStyleComboBox->addItem(penJoinSwatch(Qt::RoundJoin),