Ejemplo n.º 1
0
void FontButton::fontDialog ()
{
  QFontDialog *dialog = new QFontDialog(_font, this);
  connect(dialog, SIGNAL(fontSelected(const QFont &)), this, SLOT(fontDialog2(QFont)));
  connect(dialog, SIGNAL(finished(int)), dialog, SLOT(deleteLater()));
  dialog->show();
}
Ejemplo n.º 2
0
void MadeupWindow::selectFont() {
  QFontDialog *picker = new QFontDialog(editor->font(), this); 
  picker->setOption(QFontDialog::NoButtons);
  connect(picker, &QFontDialog::currentFontChanged, [=](const QFont &font) {
    editor->setFont(font);
    console->setFont(font);
  });
  picker->setAttribute(Qt::WA_DeleteOnClose);
  picker->show();
}