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()
|
BarcodeItem::BarcodeItem()
|
||||||
: QGraphicsItem()
|
: QGraphicsItem()
|
||||||
{
|
{
|
||||||
scaleFactor=1;
|
|
||||||
w=400;
|
w=400;
|
||||||
h=400;
|
h=400;
|
||||||
}
|
}
|
||||||
@ -37,7 +36,7 @@ QRectF BarcodeItem::boundingRect() const
|
|||||||
|
|
||||||
void BarcodeItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
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:
|
public:
|
||||||
mutable Zint::QZint bc;
|
mutable Zint::QZint bc;
|
||||||
int scaleFactor;
|
|
||||||
int w,h;
|
int w,h;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item rowspan="8" row="5" column="4" colspan="4" >
|
<item rowspan="7" row="5" column="4" colspan="4" >
|
||||||
<layout class="QVBoxLayout" name="verticalLayout" >
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2" >
|
<widget class="QLabel" name="label_2" >
|
||||||
@ -302,33 +302,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0" colspan="4" >
|
<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" >
|
<layout class="QHBoxLayout" name="horizontalLayout_8" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_8" >
|
<widget class="QLabel" name="label_8" >
|
||||||
@ -355,7 +328,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0" colspan="4" >
|
<item row="7" column="0" colspan="4" >
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_10" >
|
<layout class="QHBoxLayout" name="horizontalLayout_10" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_9" >
|
<widget class="QLabel" name="label_9" >
|
||||||
@ -388,7 +361,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0" colspan="4" >
|
<item row="8" column="0" colspan="4" >
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_11" >
|
<layout class="QHBoxLayout" name="horizontalLayout_11" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_10" >
|
<widget class="QLabel" name="label_10" >
|
||||||
@ -415,7 +388,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0" colspan="4" >
|
<item row="9" column="0" colspan="4" >
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_14" >
|
<layout class="QHBoxLayout" name="horizontalLayout_14" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_13" >
|
<widget class="QLabel" name="label_13" >
|
||||||
@ -458,7 +431,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0" colspan="4" >
|
<item row="10" column="0" colspan="4" >
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_15" >
|
<layout class="QHBoxLayout" name="horizontalLayout_15" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_14" >
|
<widget class="QLabel" name="label_14" >
|
||||||
@ -486,7 +459,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="0" colspan="4" >
|
<item row="11" column="0" colspan="4" >
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_9" >
|
<layout class="QHBoxLayout" name="horizontalLayout_9" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="fgcolor" >
|
<widget class="QPushButton" name="fgcolor" >
|
||||||
@ -504,7 +477,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="13" column="0" colspan="8" >
|
<item row="12" column="0" colspan="8" >
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" >
|
<layout class="QHBoxLayout" name="horizontalLayout" >
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer" >
|
<spacer name="horizontalSpacer" >
|
||||||
|
@ -59,7 +59,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
|
|||||||
connect(heightb, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
connect(heightb, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
||||||
connect(widthb, 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(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(bwidth, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
||||||
connect(codewords, 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()));
|
connect(iwidth, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked()));
|
||||||
@ -89,7 +88,6 @@ void MainWindow::on_bgcolor_clicked()
|
|||||||
void MainWindow::on_generate_clicked()
|
void MainWindow::on_generate_clicked()
|
||||||
{
|
{
|
||||||
QString error;
|
QString error;
|
||||||
m_bc.scaleFactor=scaleFactor->value();
|
|
||||||
m_bc.w=iwidth->value();
|
m_bc.w=iwidth->value();
|
||||||
m_bc.h=iheight->value();
|
m_bc.h=iheight->value();
|
||||||
m_bc.bc.setText(text->toPlainText());
|
m_bc.bc.setText(text->toPlainText());
|
||||||
|
Loading…
Reference in New Issue
Block a user