mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
don't need scale factor when render, we can scale the scene or the view.
This commit is contained in:
parent
b0f9cfb532
commit
fd45a1d277
@ -20,7 +20,6 @@
|
||||
BarcodeItem::BarcodeItem()
|
||||
: QGraphicsItem()
|
||||
{
|
||||
scaleFactor=1;
|
||||
w=400;
|
||||
h=400;
|
||||
}
|
||||
@ -37,7 +36,7 @@ QRectF BarcodeItem::boundingRect() const
|
||||
|
||||
void BarcodeItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
||||
{
|
||||
bc.render(*painter,boundingRect(),Zint::QZint::IgnoreAspectRatio,scaleFactor);
|
||||
bc.render(*painter,boundingRect(),Zint::QZint::IgnoreAspectRatio);
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,6 @@ public:
|
||||
|
||||
public:
|
||||
mutable Zint::QZint bc;
|
||||
int scaleFactor;
|
||||
int w,h;
|
||||
};
|
||||
|
||||
|
@ -276,7 +276,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item rowspan="8" row="5" column="4" colspan="4" >
|
||||
<item rowspan="7" row="5" column="4" colspan="4" >
|
||||
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2" >
|
||||
@ -302,33 +302,6 @@ p, li { white-space: pre-wrap; }
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="4" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7" >
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7" >
|
||||
<property name="text" >
|
||||
<string>Scale factor:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="scaleFactor" >
|
||||
<property name="minimum" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum" >
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="value" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="4" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8" >
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8" >
|
||||
@ -355,7 +328,7 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="4" >
|
||||
<item row="7" column="0" colspan="4" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10" >
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9" >
|
||||
@ -388,7 +361,7 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="4" >
|
||||
<item row="8" column="0" colspan="4" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11" >
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10" >
|
||||
@ -415,7 +388,7 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="4" >
|
||||
<item row="9" column="0" colspan="4" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_14" >
|
||||
<item>
|
||||
<widget class="QLabel" name="label_13" >
|
||||
@ -458,7 +431,7 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="4" >
|
||||
<item row="10" column="0" colspan="4" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_15" >
|
||||
<item>
|
||||
<widget class="QLabel" name="label_14" >
|
||||
@ -486,7 +459,7 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="4" >
|
||||
<item row="11" column="0" colspan="4" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9" >
|
||||
<item>
|
||||
<widget class="QPushButton" name="fgcolor" >
|
||||
@ -504,7 +477,7 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="13" column="0" colspan="8" >
|
||||
<item row="12" column="0" colspan="8" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" >
|
||||
<item>
|
||||
<spacer name="horizontalSpacer" >
|
||||
|
@ -59,7 +59,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
|
||||
connect(heightb, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
||||
connect(widthb, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
||||
connect(security, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
||||
connect(scaleFactor, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
||||
connect(bwidth, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
||||
connect(codewords, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
||||
connect(iwidth, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
||||
@ -89,7 +88,6 @@ void MainWindow::on_bgcolor_clicked()
|
||||
void MainWindow::on_generate_clicked()
|
||||
{
|
||||
QString error;
|
||||
m_bc.scaleFactor=scaleFactor->value();
|
||||
m_bc.w=iwidth->value();
|
||||
m_bc.h=iheight->value();
|
||||
m_bc.bc.setText(text->toPlainText());
|
||||
|
Loading…
Reference in New Issue
Block a user