summaryrefslogtreecommitdiffabout
path: root/microkde/kfontdialog.cpp
blob: 174123c7bda45c3df04240a7582f289b64231aad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "kfontdialog.h"
#ifndef DESKTOP_VERSION
#include "ofontselector.h"
#else
#include <qfontdialog.h>
#endif
#include <qdialog.h>
#include <qlayout.h>
#include <qpushbutton.h>
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
}