Version: 9.16.0
QtxFontEdit.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20// File: QtxFontEdit.h
21// Author: Sergey TELKOV
22//
23#ifndef QTXFONTEDIT_H
24#define QTXFONTEDIT_H
25
26#include "Qtx.h"
27
28#include <QFrame>
29
30class QtxComboBox;
31class QComboBox;
32class QToolButton;
33class QFontComboBox;
34
36{
37 Q_OBJECT
38
39public:
41 typedef enum {
42 Family = 0x01,
43 Size = 0x02,
44 UserSize = 0x04,
45 Bold = 0x08,
46 Italic = 0x10,
47 Underline = 0x20,
48 Shadow = 0x40,
49 Preview = 0x80,
50 Scripting = Bold | Italic | Underline,
51 All = Family | Size | UserSize | Scripting | Preview
52 } Features;
53
54 typedef enum
55 {
57 Custom
58 } Mode;
59
60public:
61 QtxFontEdit( const int, QWidget* = 0 );
62 QtxFontEdit( QWidget* = 0 );
63 virtual ~QtxFontEdit();
64
65 QFont currentFont() const;
66 void setCurrentFont( const QFont& );
67
68 int fontSize() const;
69 QString fontFamily() const;
70 int fontScripting() const;
71
72 void setFontSize( const int );
73 void setFontFamily( const QString& );
74 void setFontScripting( const int );
75
76 int features() const;
77 void setFeatures( const int );
78
79 void setMode( const int );
80 int mode() const;
81
82 void setFonts( const QStringList& );
83 QStringList fonts() const;
84
85 void setSizes( const QList<int>& = QList<int>() );
86 QList<int> sizes() const;
87
88signals:
89 void changed( const QFont& );
90
91private slots:
92 void onPreview( bool );
93 void onFontChanged( const QFont& );
94 void onPropertyChanged();
95
96private:
97 void initialize();
98 void updateState();
99
100private:
102 QFontComboBox* myFamily;
105 QToolButton *myB, *myI, *myU, *myS;
108};
109
110#endif // QTXFONTEDIT_H
static void setSizes(QIntList &szList, const int item_ind, const int new_near, const int new_this, const int new_farr)
Calculate sizes of the splitter widget for the workarea.
Definition: QtxWorkstack.cxx:2079
#define QTX_EXPORT
Definition: Qtx.h:36
Enhanced version of Qt combo box class.
Definition: QtxComboBox.h:39
The QtxFontEdit class represents a widget for font preference items editing.
Definition: QtxFontEdit.h:36
@ Native
Native mode intended for working with system fonts.
Definition: QtxFontEdit.h:56
QComboBox * myCustomFams
Definition: QtxFontEdit.h:107
QtxComboBox * mySize
Definition: QtxFontEdit.h:101
int myMode
Definition: QtxFontEdit.h:106
QToolButton * myPreview
Definition: QtxFontEdit.h:103
void changed(const QFont &)
int myFeatures
Definition: QtxFontEdit.h:104
QToolButton * myB
Definition: QtxFontEdit.h:105
QFontComboBox * myFamily
Definition: QtxFontEdit.h:102