Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render icons #334

Merged
merged 9 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed qucs/bitmaps/ABCV.png
Binary file not shown.
Binary file removed qucs/bitmaps/ABV.png
Binary file not shown.
Binary file removed qucs/bitmaps/APBPCV.png
Binary file not shown.
Binary file removed qucs/bitmaps/APBV.png
Binary file not shown.
Binary file removed qucs/bitmaps/C_SPICE.png
Binary file not shown.
Binary file removed qucs/bitmaps/Cmeter_SPICE.png
Binary file not shown.
Binary file removed qucs/bitmaps/DE_V_amp.png
Binary file not shown.
Binary file removed qucs/bitmaps/DE_V_diff.png
Binary file not shown.
Binary file removed qucs/bitmaps/DE_V_int.png
Binary file not shown.
Binary file removed qucs/bitmaps/DE_V_limit.png
Binary file not shown.
Binary file removed qucs/bitmaps/DIODE_SPICE.png
Binary file not shown.
Binary file removed qucs/bitmaps/DLS_1ton.png
Binary file not shown.
Binary file removed qucs/bitmaps/DLS_nto1.png
Binary file not shown.
Binary file removed qucs/bitmaps/DivV.png
Binary file not shown.
Binary file removed qucs/bitmaps/EKV26nMOS.png
Binary file not shown.
Binary file removed qucs/bitmaps/EKV26pMOS.png
Binary file not shown.
Binary file removed qucs/bitmaps/Icouple.png
Binary file not shown.
Binary file removed qucs/bitmaps/K_SPICE.png
Binary file not shown.
Binary file removed qucs/bitmaps/LTL_SPICE.png
Binary file not shown.
Binary file removed qucs/bitmaps/LTRA_SPICE.png
Binary file not shown.
Binary file removed qucs/bitmaps/L_SPICE.png
Binary file not shown.
Binary file removed qucs/bitmaps/MESFET.png
Binary file not shown.
Binary file removed qucs/bitmaps/MESFET_SPICE.png
Binary file not shown.
Binary file removed qucs/bitmaps/NJF_SPICE.png
Binary file not shown.
Binary file removed qucs/bitmaps/NMOS_SPICE.png
Binary file not shown.
Binary file removed qucs/bitmaps/NMOS_SPICE_3.png
Diff not rendered.
Binary file removed qucs/bitmaps/NPN4_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/NPN5_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/NPN_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/PJF_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/PMF_MESFET_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/PMOS_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/PMOS_SPICE_3.png
Diff not rendered.
Binary file removed qucs/bitmaps/PNP4_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/PNP5_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/PNP_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/R_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/S4Q_I.png
Diff not rendered.
Binary file removed qucs/bitmaps/S4Q_Ieqndef.png
Diff not rendered.
Binary file removed qucs/bitmaps/S4Q_S.png
Diff not rendered.
Binary file removed qucs/bitmaps/S4Q_V.png
Diff not rendered.
Binary file removed qucs/bitmaps/S4Q_W.png
Diff not rendered.
Binary file removed qucs/bitmaps/SDTF.png
Diff not rendered.
Binary file removed qucs/bitmaps/SE_V_amp.png
Diff not rendered.
Binary file removed qucs/bitmaps/SE_V_diff.png
Diff not rendered.
Binary file removed qucs/bitmaps/SE_V_int.png
Diff not rendered.
Binary file removed qucs/bitmaps/SE_V_limit.png
Diff not rendered.
Binary file removed qucs/bitmaps/UDRCTL_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/Vac_SPICE.png
Diff not rendered.
Binary file removed qucs/bitmaps/XAPWL.png
Diff not rendered.
Binary file removed qucs/bitmaps/ac.png
Diff not rendered.
Binary file removed qucs/bitmaps/ac_current.png
Diff not rendered.
Binary file removed qucs/bitmaps/ac_voltage.png
Diff not rendered.
Binary file removed qucs/bitmaps/am_mod.png
Diff not rendered.
Binary file removed qucs/bitmaps/amplifier.png
Diff not rendered.
Binary file removed qucs/bitmaps/and.png
Diff not rendered.
Binary file removed qucs/bitmaps/andor4x2.png
Diff not rendered.
Binary file removed qucs/bitmaps/andor4x3.png
Diff not rendered.
Binary file removed qucs/bitmaps/andor4x4.png
Diff not rendered.
Binary file removed qucs/bitmaps/attenuator.png
Diff not rendered.
Binary file removed qucs/bitmaps/biast.png
Diff not rendered.
Binary file removed qucs/bitmaps/binarytogrey4bit.png
Diff not rendered.
Binary file removed qucs/bitmaps/bondwire.png
Diff not rendered.
Binary file removed qucs/bitmaps/buffer.png
Diff not rendered.
Binary file removed qucs/bitmaps/capacitor.png
Diff not rendered.
Binary file removed qucs/bitmaps/capq.png
Diff not rendered.
Binary file removed qucs/bitmaps/cccs.png
Diff not rendered.
Binary file removed qucs/bitmaps/ccvs.png
Diff not rendered.
Binary file removed qucs/bitmaps/circline.png
Diff not rendered.
Binary file removed qucs/bitmaps/circulator.png
Diff not rendered.
Binary file removed qucs/bitmaps/coaxial.png
Diff not rendered.
Binary file removed qucs/bitmaps/comp_1bit.png
Diff not rendered.
Binary file removed qucs/bitmaps/comp_2bit.png
Diff not rendered.
Binary file removed qucs/bitmaps/comp_4bit.png
Diff not rendered.
Binary file removed qucs/bitmaps/coplanar.png
Diff not rendered.
Binary file removed qucs/bitmaps/core.png
Diff not rendered.
Binary file removed qucs/bitmaps/coupler.png
Diff not rendered.
Binary file removed qucs/bitmaps/cpwgap.png
Diff not rendered.
Binary file removed qucs/bitmaps/cpwopen.png
Diff not rendered.
Binary file removed qucs/bitmaps/cpwshort.png
Diff not rendered.
Binary file removed qucs/bitmaps/cpwstep.png
Diff not rendered.
Binary file removed qucs/bitmaps/ctline.png
Diff not rendered.
Binary file removed qucs/bitmaps/curve.png
Diff not rendered.
Binary file removed qucs/bitmaps/dc.png
Diff not rendered.
Binary file removed qucs/bitmaps/dc_current.png
Diff not rendered.
Binary file removed qucs/bitmaps/dc_voltage.png
Diff not rendered.
Binary file removed qucs/bitmaps/dcblock.png
Diff not rendered.
Binary file removed qucs/bitmaps/dcfeed.png
Diff not rendered.
Binary file removed qucs/bitmaps/dff_SR.png
Diff not rendered.
Binary file removed qucs/bitmaps/dflipflop.png
Diff not rendered.
Binary file removed qucs/bitmaps/diac.png
Diff not rendered.
Binary file removed qucs/bitmaps/digi.png
Diff not rendered.
Binary file removed qucs/bitmaps/digi_source.png
Diff not rendered.
Binary file removed qucs/bitmaps/diode.png
Diff not rendered.
Binary file removed qucs/bitmaps/dmosfet.png
Diff not rendered.
Binary file removed qucs/bitmaps/dmosfet_sub.png
Diff not rendered.
Binary file removed qucs/bitmaps/dmux2to4.png
Diff not rendered.
Binary file removed qucs/bitmaps/dmux3to8.png
Diff not rendered.
Binary file removed qucs/bitmaps/dmux4to16.png
Diff not rendered.
Binary file removed qucs/bitmaps/eNL.png
Diff not rendered.
Binary file removed qucs/bitmaps/ecvs.png
Diff not rendered.
Binary file removed qucs/bitmaps/edd.png
Diff not rendered.
Binary file removed qucs/bitmaps/etran.png
Diff not rendered.
Binary file removed qucs/bitmaps/fa1b.png
Diff not rendered.
Binary file removed qucs/bitmaps/fa2b.png
Diff not rendered.
Binary file removed qucs/bitmaps/gNL.png
Diff not rendered.
Binary file removed qucs/bitmaps/gatedDlatch.png
Diff not rendered.
Binary file removed qucs/bitmaps/gnd.png
Diff not rendered.
Binary file removed qucs/bitmaps/greytobinary4bit.png
Diff not rendered.
Binary file removed qucs/bitmaps/ground.png
Diff not rendered.
Binary file removed qucs/bitmaps/gyrator.png
Diff not rendered.
Binary file removed qucs/bitmaps/ha1b.png
Diff not rendered.
Binary file removed qucs/bitmaps/hb.png
Diff not rendered.
Binary file removed qucs/bitmaps/hpribin4bit.png
Diff not rendered.
Binary file removed qucs/bitmaps/hybrid.png
Diff not rendered.
Binary file removed qucs/bitmaps/iAmpMod.png
Diff not rendered.
Binary file removed qucs/bitmaps/iPWL.png
Diff not rendered.
Binary file removed qucs/bitmaps/iTRNOISE.png
Diff not rendered.
Binary file removed qucs/bitmaps/iexp.png
Diff not rendered.
Binary file removed qucs/bitmaps/ifile.png
Diff not rendered.
Binary file removed qucs/bitmaps/incl_script.png
Diff not rendered.
Binary file removed qucs/bitmaps/indq.png
Diff not rendered.
Binary file removed qucs/bitmaps/inductor.png
Diff not rendered.
Binary file removed qucs/bitmaps/inverter.png
Diff not rendered.
Binary file removed qucs/bitmaps/iprobe.png
Diff not rendered.
Binary file removed qucs/bitmaps/ipulse.png
Diff not rendered.
Binary file removed qucs/bitmaps/irect.png
Diff not rendered.
Binary file removed qucs/bitmaps/isffm.png
Diff not rendered.
Binary file removed qucs/bitmaps/isolator.png
Diff not rendered.
Binary file removed qucs/bitmaps/jkff_SR.png
Diff not rendered.
Binary file removed qucs/bitmaps/jkflipflop.png
Diff not rendered.
Binary file removed qucs/bitmaps/log_amp.png
Diff not rendered.
Binary file removed qucs/bitmaps/logic_0.png
Diff not rendered.
Binary file removed qucs/bitmaps/logic_1.png
Diff not rendered.
Binary file removed qucs/bitmaps/mod_amp.png
Diff not rendered.
Binary file removed qucs/bitmaps/mscorner.png
Diff not rendered.
Binary file removed qucs/bitmaps/mscoupled.png
Diff not rendered.
Binary file removed qucs/bitmaps/mscross.png
Diff not rendered.
Binary file removed qucs/bitmaps/msgap.png
Diff not rendered.
Binary file removed qucs/bitmaps/mslange.png
Diff not rendered.
Binary file removed qucs/bitmaps/msline.png
Diff not rendered.
Binary file removed qucs/bitmaps/msmbend.png
Diff not rendered.
Binary file removed qucs/bitmaps/msopen.png
Diff not rendered.
Binary file removed qucs/bitmaps/msrstub.png
Diff not rendered.
Binary file removed qucs/bitmaps/msstep.png
Diff not rendered.
Binary file removed qucs/bitmaps/mstee.png
Diff not rendered.
Binary file removed qucs/bitmaps/msvia.png
Diff not rendered.
Binary file removed qucs/bitmaps/mutual.png
Diff not rendered.
Binary file removed qucs/bitmaps/mutual2.png
Diff not rendered.
Binary file removed qucs/bitmaps/mutualx.png
Diff not rendered.
Binary file removed qucs/bitmaps/mux2to1.png
Diff not rendered.
Binary file removed qucs/bitmaps/mux4to1.png
Diff not rendered.
Binary file removed qucs/bitmaps/mux8to1.png
Diff not rendered.
Binary file removed qucs/bitmaps/nand.png
Diff not rendered.
Binary file removed qucs/bitmaps/nfet.png
Diff not rendered.
Binary file removed qucs/bitmaps/nigbt.png
Diff not rendered.
Binary file removed qucs/bitmaps/nmosfet.png
Diff not rendered.
Binary file removed qucs/bitmaps/nmosfet_sub.png
Diff not rendered.
Binary file removed qucs/bitmaps/noise_current.png
Diff not rendered.
Binary file removed qucs/bitmaps/noise_ii.png
Diff not rendered.
Binary file removed qucs/bitmaps/noise_iv.png
Diff not rendered.
Binary file removed qucs/bitmaps/noise_volt.png
Diff not rendered.
Binary file removed qucs/bitmaps/noise_vv.png
Diff not rendered.
Binary file removed qucs/bitmaps/nor.png
Diff not rendered.
Binary file removed qucs/bitmaps/npn.png
Diff not rendered.
Binary file removed qucs/bitmaps/npn_therm.png
Diff not rendered.
Binary file removed qucs/bitmaps/npnsub.png
Diff not rendered.
Binary file removed qucs/bitmaps/npnsub_therm.png
Diff not rendered.
Binary file removed qucs/bitmaps/opamp.png
Diff not rendered.
Binary file removed qucs/bitmaps/or.png
Diff not rendered.
Binary file removed qucs/bitmaps/pad2bit.png
Diff not rendered.
Binary file removed qucs/bitmaps/pad3bit.png
Diff not rendered.
Binary file removed qucs/bitmaps/pad4bit.png
Diff not rendered.
Binary file removed qucs/bitmaps/pfet.png
Diff not rendered.
Binary file removed qucs/bitmaps/photodiode.png
Diff not rendered.
Binary file removed qucs/bitmaps/phototransistor.png
Diff not rendered.
Binary file removed qucs/bitmaps/pm_mod.png
Diff not rendered.
Binary file removed qucs/bitmaps/pmosfet.png
Diff not rendered.
Binary file removed qucs/bitmaps/pmosfet_sub.png
Diff not rendered.
Binary file removed qucs/bitmaps/pnp.png
Diff not rendered.
Binary file removed qucs/bitmaps/pnp_therm.png
Diff not rendered.
Binary file removed qucs/bitmaps/pnpsub.png
Diff not rendered.
Binary file removed qucs/bitmaps/pnpsub_therm.png
Diff not rendered.
Binary file removed qucs/bitmaps/port.png
Diff not rendered.
Binary file removed qucs/bitmaps/potentiometer.png
Diff not rendered.
Binary file removed qucs/bitmaps/previous.png
Diff not rendered.
Binary file removed qucs/bitmaps/pshifter.png
Diff not rendered.
Binary file removed qucs/bitmaps/rectline.png
Diff not rendered.
Binary file removed qucs/bitmaps/relais.png
Diff not rendered.
Binary file removed qucs/bitmaps/resistor.png
Diff not rendered.
Binary file removed qucs/bitmaps/resistor_us.png
Diff not rendered.
Binary file removed qucs/bitmaps/rfedd.png
Diff not rendered.
Binary file removed qucs/bitmaps/rlcg.png
Diff not rendered.
Binary file removed qucs/bitmaps/rsflipflop.png
Diff not rendered.
Binary file removed qucs/bitmaps/source.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_customsim.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_disto.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_fft.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_fourier.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_func.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_globpar.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_ic.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_include.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_lib.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_model.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_nodeset.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_noise.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_nutmeg.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_options.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_param.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_pz.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_sens.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_sens_ac.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_sens_tr_xyce.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_sens_xyce.png
Diff not rendered.
Binary file removed qucs/bitmaps/sp_spiceinit.png
Diff not rendered.
Binary file removed qucs/bitmaps/sparameter.png
Diff not rendered.
Binary file removed qucs/bitmaps/spfile1.png
Diff not rendered.
Binary file removed qucs/bitmaps/spfile2.png
Diff not rendered.
Binary file removed qucs/bitmaps/spfile3.png
Diff not rendered.
Binary file removed qucs/bitmaps/spicefile.png
Diff not rendered.
Binary file removed qucs/bitmaps/spicegeneric.png
Diff not rendered.
Binary file removed qucs/bitmaps/spicelibcomp.png
Diff not rendered.
Binary file removed qucs/bitmaps/src_eqndef.png
Diff not rendered.
Binary file removed qucs/bitmaps/subcircuit.png
Diff not rendered.
Binary file removed qucs/bitmaps/subport.png
Diff not rendered.
Binary file removed qucs/bitmaps/substrate.png
Diff not rendered.
102 changes: 102 additions & 0 deletions qucs/bitmaps/svg/gnd.svg
71 changes: 71 additions & 0 deletions qucs/bitmaps/svg/optimize.svg
85 changes: 85 additions & 0 deletions qucs/bitmaps/svg/subport.svg
Binary file removed qucs/bitmaps/sweep.png
Diff not rendered.
Binary file removed qucs/bitmaps/switch.png
Diff not rendered.
Binary file removed qucs/bitmaps/symtrans.png
Diff not rendered.
Binary file removed qucs/bitmaps/taperedline.png
Diff not rendered.
Binary file removed qucs/bitmaps/tff_SR.png
Diff not rendered.
Binary file removed qucs/bitmaps/thyristor.png
Diff not rendered.
Binary file removed qucs/bitmaps/tline.png
Diff not rendered.
Binary file removed qucs/bitmaps/tline_4port.png
Diff not rendered.
Binary file removed qucs/bitmaps/tran.png
Diff not rendered.
Binary file removed qucs/bitmaps/transformer.png
Diff not rendered.
Binary file removed qucs/bitmaps/triac.png
Diff not rendered.
Binary file removed qucs/bitmaps/tunneldiode.png
Diff not rendered.
Binary file removed qucs/bitmaps/twistedpair.png
Diff not rendered.
Binary file removed qucs/bitmaps/vAmpMod.png
Diff not rendered.
Binary file removed qucs/bitmaps/vPWL.png
Diff not rendered.
Binary file removed qucs/bitmaps/vTRNOISE.png
Diff not rendered.
Binary file removed qucs/bitmaps/vTRRANDOM.png
Diff not rendered.
Binary file removed qucs/bitmaps/vccs.png
Diff not rendered.
Binary file removed qucs/bitmaps/vcresistor.png
Diff not rendered.
Binary file removed qucs/bitmaps/vcvs.png
Diff not rendered.
Binary file removed qucs/bitmaps/vexp.png
Diff not rendered.
Binary file removed qucs/bitmaps/vfile.png
Diff not rendered.
Binary file removed qucs/bitmaps/vhdlfile.png
Diff not rendered.
Binary file removed qucs/bitmaps/vprobe.png
Diff not rendered.
Binary file removed qucs/bitmaps/vpulse.png
Diff not rendered.
Binary file removed qucs/bitmaps/vrect.png
Diff not rendered.
Binary file removed qucs/bitmaps/vsffm.png
Diff not rendered.
Binary file removed qucs/bitmaps/xnor.png
Diff not rendered.
Binary file removed qucs/bitmaps/xor.png
Diff not rendered.
Binary file removed qucs/bitmaps/xsp_cmlib.png
Diff not rendered.
Binary file removed qucs/bitmaps/xsp_cmod.png
Diff not rendered.
Binary file removed qucs/bitmaps/xspicegeneric.png
Diff not rendered.
Binary file removed qucs/bitmaps/xyce_script.png
Diff not rendered.
1 change: 1 addition & 0 deletions qucs/components/andor4x3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ andor4x3::andor4x3()
createSymbol ();
tx = x1 + 19;
ty = y2 + 4;
icon_dy = -32;
Model = "andor4x3";
Name = "Y";
}
Expand Down
1 change: 1 addition & 0 deletions qucs/components/binarytogrey4bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ binarytogrey4bit::binarytogrey4bit()
createSymbol ();
tx = x1 + 19;
ty = y2 + 4;
icon_dy = 8;
Model = "binarytogrey4bit";
Name = "Y";
}
Expand Down
1 change: 1 addition & 0 deletions qucs/components/comp_1bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ comp_1bit::comp_1bit()
createSymbol ();
tx = x1 + 19;
ty = y2 + 4;
icon_dy = 8;
Model = "comp_1bit";
Name = "Y";
}
Expand Down
77 changes: 77 additions & 0 deletions qucs/components/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,83 @@ void Component::paint(ViewPainter *p) {
}
}

// paint device icon for left panel list
void Component::paintIcon(QPixmap *pixmap)
{
pixmap->fill(Qt::white);
QPainter *pp = new QPainter(pixmap);
ViewPainter *p = new ViewPainter(pp);
int bx1,by1,bx2,by2;
Bounding(bx1,by1,bx2,by2);
int h = std::abs(bx1-bx2)+10;
int w = std::abs(by1-by2)+10;
int ph = pixmap->size().height();
p->Scale = (float) ph / std::max(w,h);

QFont f = p->Painter->font(); // save current font
QFont newFont = f;
int c_sc = ph / (2*p->Scale);
cx += c_sc + icon_dx*p->Scale;
cy += c_sc + icon_dy*p->Scale;
if (Model.at(0) != '.' && !isEquation) { // normal components go here
// paint all lines
for (auto pp: Ports) {
QPen pa;
pa.setWidth(3);
pa.setColor(Qt::red);
p->Painter->setPen(pa);
p->drawEllipse(cx+pp->x-4,cy+pp->y-4,8,8);
}

for (qucs::Line *p1: Lines) {
p1->style.setWidth(3);
p->Painter->setPen(p1->style);
p->drawLine(cx + p1->x1, cy + p1->y1, cx + p1->x2, cy + p1->y2);
}

// paint all arcs
for (qucs::Arc *p3: Arcs) {
p3->style.setWidth(3);
p->Painter->setPen(p3->style);
p->drawArc(cx + p3->x, cy + p3->y, p3->w, p3->h, p3->angle, p3->arclen);
}

// paint all rectangles
for (qucs::Area *pa: Rects) {
pa->Pen.setWidth(3);
p->Painter->setPen(pa->Pen);
p->Painter->setBrush(pa->Brush);
p->drawRect(cx + pa->x, cy + pa->y, pa->w, pa->h);
}

// paint all ellipses
for (qucs::Area *pa: Ellips) {
p->Painter->setPen(pa->Pen);
p->Painter->setBrush(pa->Brush);
p->drawEllipse(cx + pa->x, cy + pa->y, pa->w, pa->h);
}
p->Painter->setBrush(Qt::NoBrush);

newFont.setWeight(QFont::Light);

for (Text *pt: Texts) {
p->Painter->setWorldTransform(
QTransform(pt->mCos, -pt->mSin, pt->mSin, pt->mCos,
p->DX + float(cx + pt->x) * p->Scale,
p->DY + float(cy + pt->y) * p->Scale));
newFont.setPointSizeF(p->Scale * pt->Size);
newFont.setOverline(pt->over);
newFont.setUnderline(pt->under);
p->Painter->setFont(newFont);
p->Painter->setPen(pt->Color);
int w, h;
w = p->drawTextMapped(pt->s, 0, 0, &h);
Q_UNUSED(w)
Q_UNUSED(h)
}
}
}

// -------------------------------------------------------
// Paints the component when moved with the mouse.
void Component::paintScheme(Schematic *p) {
Expand Down
5 changes: 5 additions & 0 deletions qucs/components/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ class Component : public Element {
bool mirroredX; // is it mirrored about X axis or not
int rotated; // rotation angle divided by 90 degrees

int icon_dx = 0; // used to adjust icon position
int icon_dy = 0;

virtual QString getSubcircuitFile() { return ""; }
// set the pointer scematic associated with the component
virtual void setSchematic (Schematic* p) { containingSchematic = p; }
Expand Down Expand Up @@ -101,6 +104,8 @@ class Component : public Element {
QString SpiceModel;
QPen WrongSimulatorPen;

void paintIcon(QPixmap *pixmap);

protected:
virtual QString netlist();
virtual QString spice_netlist(bool isXyce = false);
Expand Down
2 changes: 2 additions & 0 deletions qucs/components/digi_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Digi_Source::Digi_Source()
Name = "S";
SpiceModel = "V";

icon_dx = 6;

// This property must stay in this order !
Props.append(new Property("Num", "1", true,
QObject::tr("number of the port")));
Expand Down
Loading