Skip to content

Instantly share code, notes, and snippets.

View SC-One's full-sized avatar
✌️
GoingOn

Heydar Mahmoodi SC-One

✌️
GoingOn
View GitHub Profile
.bglrtl
{
font-size:17px;
margin-right:137px;
margin-left:157px;
}
//IconLabel is subclass of QLabel
//Note: if you wanna keep Quality , you should create pixmap for all sizes (so override resizeEvent !)
// this method is working normally
QPixmap IconLabel::FromSvgToPixmap(const QString &SvgFile,
const QSize &ImageSize) {
QSvgRenderer SvgRenderer(SvgFile);
QPixmap Image(ImageSize);
QPainter Painter;
Image.fill(Qt::transparent);
QFileDialog *f = new QFileDialog();
f->setOption(QFileDialog::DontUseNativeDialog, true); // we need qt layout
QGridLayout *layout = static_cast<QGridLayout *>(f->layout());
QList<QPair<QLayoutItem *, QList<int> > > moved_items;
f->show();
for (int i = 0; i < layout->count(); i++) {
int row, column, rowSpan, columnSpan;
layout->getItemPosition(i, &row, &column, &rowSpan, &columnSpan);