From b9aad1f15dc600e4dbe4c62d3fcced6363188ba3 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 26 Jun 2004 19:01:18 +0000 Subject: Initial revision --- (limited to 'microkde/kfontdialog.cpp') diff --git a/microkde/kfontdialog.cpp b/microkde/kfontdialog.cpp new file mode 100644 index 0000000..174123c --- a/dev/null +++ b/microkde/kfontdialog.cpp @@ -0,0 +1,32 @@ +#include "kfontdialog.h" +#ifndef DESKTOP_VERSION +#include "ofontselector.h" +#else +#include +#endif +#include +#include +#include +QFont KFontDialog::getFont( const QFont & f, bool & ok ) +{ +#ifndef DESKTOP_VERSION + QDialog d( 0, "fd", true );; + OFontSelector s ( true, &d, "fontsel"); + QVBoxLayout l ( &d ); + l.addWidget( &s ); + s.setSelectedFont ( f ); + QPushButton b ( "OK", &d ); + l.addWidget( &b ); + qDebug("size %d ", f.bold()); + QObject::connect( &b, SIGNAL( clicked () ), &d, SLOT ( accept () ) ); + d.show(); + ok = false; + if ( d.exec () ) { + ok = true; + return s.selectedFont ( ); + } + return f; +#else + return QFontDialog::getFont ( &ok, f, 0, "fontdialog" ); +#endif +} -- cgit v0.9.0.2