Qt 4.8
qdialogsbinarycompat_win.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include <qglobal.h>
43 
44 // ### Qt 5: eliminate this file
45 
46 /*
47  This is evil. MSVC doesn't let us remove private symbols, nor change their
48  visibility; yet there are some symbols we really needed to make public, e.g.,
49  ~QColorDialog(), and then there were some totally needless symbols in our
50  header files, e.g., setSelectedAlpha(). So we define a new version of
51  QColorDialog & Co. with only the private symbols that we removed from the
52  public header files. The friends are there only to prevent potential compiler
53  warnings.
54 
55  It would have been nicer to export the missing symbols as mangled "C" symbols
56  instead but unfortunately MSVC uses out-of-reach characters like @ and . in
57  their mangled C++ symbols.
58 */
59 
60 #if QT_VERSION < 0x050000 && defined(Q_CC_MSVC)
61 
63 
64 #include <QtGui/QColor>
65 #include <QtGui/QFont>
66 
68 class QFontDialogPrivate;
70 class QWidget;
71 
73 {
74 private:
75  explicit QColorDialog(QWidget *, bool);
76  ~QColorDialog();
77 
78  void setColor(const QColor &);
79  QColor color() const;
80  bool selectColor(const QColor &);
81  void setSelectedAlpha(int);
82  int selectedAlpha() const;
83 
84  friend class QColorDialogPrivate;
85 };
86 
89 void QColorDialog::setColor(const QColor &) {}
90 QColor QColorDialog::color() const { return QColor(); }
91 bool QColorDialog::selectColor(const QColor &) { return false; }
92 void QColorDialog::setSelectedAlpha(int) {}
93 int QColorDialog::selectedAlpha() const { return 0; }
94 
96 {
97 private:
98  explicit QFontDialog(QWidget *, bool, Qt::WindowFlags);
99  ~QFontDialog();
100 
101  QFont font() const;
102  void setFont(const QFont &);
103  void updateFamilies();
104  void updateStyles();
105  void updateSizes();
106 
107  static QFont getFont(bool *, const QFont *, QWidget *);
108 
109  friend class QFontDialogPrivate;
110 };
111 
112 QFontDialog::QFontDialog(QWidget *, bool, Qt::WindowFlags) {}
114 QFont QFontDialog::font() const { return QFont(); }
115 void QFontDialog::setFont(const QFont &) { }
116 void QFontDialog::updateFamilies() {}
117 void QFontDialog::updateStyles() {}
118 void QFontDialog::updateSizes() {}
119 QFont QFontDialog::getFont(bool *, const QFont *, QWidget *) { return QFont(); }
120 
122 {
123 private:
124  enum Type { LineEdit, SpinBox, DoubleSpinBox, ComboBox, EditableComboBox };
125 
126  QInputDialog(const QString &, QWidget *, Type, Qt::WindowFlags);
127  QInputDialog(const QString &, const QString &, QWidget *, QWidget *, Qt::WindowFlags);
128  ~QInputDialog();
129 };
130 
131 QInputDialog::QInputDialog(const QString &, QWidget *, Type, Qt::WindowFlags) {}
132 QInputDialog::QInputDialog(const QString &, const QString &, QWidget *, QWidget *, Qt::WindowFlags) {}
134 
136 
137 #endif
QFontDialog(QWidget *parent=0)
Constructs a standard font dialog.
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
void setFont(const QFont &)
Use the single-argument overload instead.
Definition: qwidget.cpp:4996
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QInputDialog class provides a simple convenience dialog to get a single value from the user...
Definition: qinputdialog.h:59
QColorDialog(QWidget *parent=0)
Constructs a color dialog with the given parent.
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QFont getFont(bool *ok, const QFont &initial, QWidget *parent, const QString &title, FontDialogOptions options)
Executes a modal font dialog and returns a font.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QColorDialog class provides a dialog widget for specifying colors.
Definition: qcolordialog.h:57
The QFontDialog class provides a dialog widget for selecting a font.
Definition: qfontdialog.h:59
~QInputDialog()
Destroys the input dialog.
QInputDialog(QWidget *parent=0, Qt::WindowFlags flags=0)
Constructs a new input dialog with the given parent and window flags.
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
~QColorDialog()
Destroys the color dialog.
const QFont & font() const