int QTextFormat::leading() const { if ( !pntr || !pntr->isActive() ) return fm.leading(); applyFont( fn ); return pntr_ldg; }
int QTextFormat::ascent() const { if ( !pntr || !pntr->isActive() ) return asc; applyFont( fn ); return pntr_asc; }
int QTextFormat::height() const { if ( !pntr || !pntr->isActive() ) return hei; applyFont( fn ); return pntr_hei; }
int QTextFormat::minRightBearing() const { if ( !pntr || !pntr->isActive() ) return rightBearing; applyFont( fn ); return pntr_fm->minRightBearing(); }
int QTextFormat::descent() const { if ( !pntr || !pntr->isActive() ) return dsc; applyFont( fn ); if ( pntr_dsc < 0 ) pntr_dsc = pntr_fm->descent(); return pntr_dsc; }
bool VisibleOptioinFont::accept() { if (m_currentFont != font()) { setFont(m_currentFont); applyFont(m_currentFont); } return true; }
void DeviceProfile::apply(const QDesignerFormEditorInterface *core, QWidget *widget, ApplyMode am) const { if (isEmpty()) return; const DeviceProfileData &d = *m_d; if (!d.m_fontFamily.isEmpty()) applyFont(d.m_fontFamily, d.m_fontPointSize, am, widget); applyDPI(d.m_dpiX, d.m_dpiY, widget); if (!d.m_style.isEmpty()) { if (WidgetFactory *wf = qobject_cast<qdesigner_internal::WidgetFactory *>(core->widgetFactory())) wf->applyStyleTopLevel(d.m_style, widget); } }
CQFontChooser:: CQFontChooser(QWidget *parent) : QWidget(parent), style_(FontButton), fixedWidth_(false), exampleText_("Abc") { setObjectName("fontChooser"); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); font_ = font(); fontName_ = font_.toString(); //----- QHBoxLayout *layout = new QHBoxLayout(this); layout->setMargin(0); layout->setSpacing(0); cedit_ = new QLineEdit (this); cedit_ ->setObjectName("cedit"); cbutton_ = new QToolButton(this); cbutton_->setObjectName("cbutton"); clabel_ = new QLabel (this); clabel_ ->setObjectName("clabel"); button_ = new QToolButton(this); button_ ->setObjectName("button"); ncombo_ = new QFontComboBox(this); ncombo_->setObjectName("ncombo"); scombo_ = new QComboBox (this); scombo_->setObjectName("scombo"); zcombo_ = new QComboBox (this); zcombo_->setObjectName("zcombo"); button_->setIcon(CQPixmapCacheInst->getIcon("FONT_DIALOG")); ncombo_->setWritingSystem(QFontDatabase::Latin); //cbutton_->setFixedSize(QSize(24,24)); //clabel_ ->setFixedSize(QSize(24,24)); //button_ ->setFixedSize(QSize(24,24)); cbutton_->setText(exampleText_); clabel_ ->setText(exampleText_); layout->addWidget(cedit_ ); layout->addWidget(cbutton_); layout->addWidget(clabel_ ); layout->addWidget(button_ ); layout->addWidget(ncombo_ ); layout->addWidget(scombo_ ); layout->addWidget(zcombo_ ); // TODO: add strecth widget and hide if any of the stretchable widgets are visible //layout->addStretch(); cedit_ ->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); cbutton_->setSizePolicy(QSizePolicy::Fixed , QSizePolicy::Fixed); clabel_ ->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); button_ ->setSizePolicy(QSizePolicy::Fixed , QSizePolicy::Fixed); ncombo_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); scombo_->setSizePolicy(QSizePolicy::Fixed , QSizePolicy::Fixed); zcombo_->setSizePolicy(QSizePolicy::Fixed , QSizePolicy::Fixed); connect(cedit_ , SIGNAL(editingFinished()), this, SLOT(editFont ())); connect(cbutton_, SIGNAL(clicked() ), this, SLOT(applyFont ())); connect(button_ , SIGNAL(clicked() ), this, SLOT(chooseFont())); connect(ncombo_ , SIGNAL(activated(int)), this, SLOT(nameChanged ())); connect(scombo_ , SIGNAL(activated(int)), this, SLOT(styleChanged())); connect(zcombo_ , SIGNAL(activated(int)), this, SLOT(sizeChanged ())); setStyle(FontEdit); setFixedWidth(false); //----- updateWidgets(); setFocusProxy(cedit_); }