summaryrefslogtreecommitdiffabout
path: root/microkde/kfontdialog.cpp
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /microkde/kfontdialog.cpp
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'microkde/kfontdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kfontdialog.cpp32
1 files changed, 32 insertions, 0 deletions
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 @@
1#include "kfontdialog.h"
2#ifndef DESKTOP_VERSION
3#include "ofontselector.h"
4#else
5#include <qfontdialog.h>
6#endif
7#include <qdialog.h>
8#include <qlayout.h>
9#include <qpushbutton.h>
10QFont KFontDialog::getFont( const QFont & f, bool & ok )
11{
12#ifndef DESKTOP_VERSION
13 QDialog d( 0, "fd", true );;
14 OFontSelector s ( true, &d, "fontsel");
15 QVBoxLayout l ( &d );
16 l.addWidget( &s );
17 s.setSelectedFont ( f );
18 QPushButton b ( "OK", &d );
19 l.addWidget( &b );
20 qDebug("size %d ", f.bold());
21 QObject::connect( &b, SIGNAL( clicked () ), &d, SLOT ( accept () ) );
22 d.show();
23 ok = false;
24 if ( d.exec () ) {
25 ok = true;
26 return s.selectedFont ( );
27 }
28 return f;
29#else
30 return QFontDialog::getFont ( &ok, f, 0, "fontdialog" );
31#endif
32}