Convenience typedef for \c{unsigned char}.
*/
-/*!
- \fn qt_set_sequence_auto_mnemonic(bool on)
- \relates <QtGlobal>
-
- Enables automatic mnemonics on Mac if \a on is true; otherwise
- this feature is disabled.
-
- Note that this function is only available on Mac where mnemonics
- are disabled by default.
-
- To access to this function, use an extern declaration:
- extern void qt_set_sequence_auto_mnemonic(bool b);
-
- \sa {QShortcut#mnemonic}{QShortcut}
-*/
-
/*! \typedef ushort
\relates <QtGlobal>
#ifndef QT_NO_FILESYSTEMMODEL
-#ifdef QT_BUILD_INTERNAL
-static bool fetchedRoot = false;
-Q_AUTOTEST_EXPORT void qt_test_resetFetchedRoot()
-{
- fetchedRoot = false;
-}
-
-Q_AUTOTEST_EXPORT bool qt_test_isFetchedRoot()
-{
- return fetchedRoot;
-}
-#endif
-
/*!
Creates thread
*/
// List drives
if (path.isEmpty()) {
-#ifdef QT_BUILD_INTERNAL
- fetchedRoot = true;
-#endif
QFileInfoList infoList;
if (files.isEmpty()) {
infoList << QFileInfo(QDir::rootPath());
*****************************************************************************/
QAtomicInt qt_pixmap_serial = QAtomicInt(0);
-int Q_GUI_EXPORT qt_x11_preferred_pixmap_depth = 0;
QX11PixmapData::QX11PixmapData(PixelType type)
: QPixmapData(type, X11Class), hd(0),
xinfo.setX11Data(xd);
}
- int dd = xinfo.depth();
-
- if (qt_x11_preferred_pixmap_depth)
- dd = qt_x11_preferred_pixmap_depth;
+ const int dd = xinfo.depth();
bool make_null = w <= 0 || h <= 0; // create null pixmap
d = (pixelType() == BitmapType ? 1 : dd);
}
QX11AlphaDetector alphaCheck(&img, flags);
- int dd = alphaCheck.hasXRenderAndAlpha() ? 32 : xinfo.depth();
-
- if (qt_x11_preferred_pixmap_depth)
- dd = qt_x11_preferred_pixmap_depth;
+ const int dd = alphaCheck.hasXRenderAndAlpha() ? 32 : xinfo.depth();
QImage image = img;
bool qt_sm_blockUserInput = false; // session management
-Q_GUI_EXPORT int qt_xfocusout_grab_counter = 0;
-
-typedef bool(*QX11FilterFunction)(XEvent *event);
-
-Q_GLOBAL_STATIC(QList<QX11FilterFunction>, x11Filters)
-
-Q_GUI_EXPORT void qt_installX11EventFilter(QX11FilterFunction func)
-{
- Q_ASSERT(func);
-
- if (QList<QX11FilterFunction> *list = x11Filters())
- list->append(func);
-}
-
-Q_GUI_EXPORT void qt_removeX11EventFilter(QX11FilterFunction func)
-{
- Q_ASSERT(func);
-
- if (QList<QX11FilterFunction> *list = x11Filters())
- list->removeOne(func);
-}
-
-
static bool qt_x11EventFilter(XEvent* ev)
{
long unused;
if (qApp->filterEvent(ev, &unused))
return true;
- if (const QList<QX11FilterFunction> *list = x11Filters()) {
- for (QList<QX11FilterFunction>::const_iterator it = list->constBegin(); it != list->constEnd(); ++it) {
- if ((*it)(ev))
- return true;
- }
- }
-
return qApp->x11EventFilter(ev);
}
if (!widget->isWindow())
break;
if (event->xfocus.mode == NotifyGrab) {
- qt_xfocusout_grab_counter++;
break;
}
if (event->xfocus.detail != NotifyAncestor &&
QT_BEGIN_NAMESPACE
-static bool qt_sequence_no_mnemonics = false;
-void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemonics = !b; }
-
/*!
\class QKeySequence
\brief The QKeySequence class encapsulates a key sequence as used
in English. At the time of writing, Microsoft and Open Group do
not appear to have issued equivalent recommendations for other
languages.
-
- \sa qt_set_sequence_auto_mnemonic()
*/
QKeySequence QKeySequence::mnemonic(const QString &text)
{
QKeySequence ret;
-
- if(qt_sequence_no_mnemonics)
- return ret;
-
bool found = false;
int p = 0;
while (p >= 0) {
shown and the character will be underlined. On Windows, shortcuts
are normally not displayed until the user presses the \gui Alt
key, but this is a setting the user can change. On Mac, shortcuts
- are disabled by default. Call qt_set_sequence_auto_mnemonic() to
- enable them. However, because mnemonic shortcuts do not fit in
- with Aqua's guidelines, Qt will not show the shortcut character
- underlined.
+ are disabled by default.
For applications that use menus, it may be more convenient to
use the convenience functions provided in the QMenu class to
return 0;
}
-Q_GUI_EXPORT bool qt_isExtendedRadialGradient(const QBrush &brush)
+static bool qt_isExtendedRadialGradient(const QBrush &brush)
{
if (brush.style() == Qt::RadialGradientPattern) {
const QGradient *g = brush.gradient();
// do nothing...
}
-Q_GUI_EXPORT QPainterPath qt_painterPathFromVectorPath(const QVectorPath &path)
-{
- const qreal *points = path.points();
- const QPainterPath::ElementType *types = path.elements();
-
- QPainterPath p;
- if (types) {
- int id = 0;
- for (int i=0; i<path.elementCount(); ++i) {
- switch(types[i]) {
- case QPainterPath::MoveToElement:
- p.moveTo(QPointF(points[id], points[id+1]));
- id+=2;
- break;
- case QPainterPath::LineToElement:
- p.lineTo(QPointF(points[id], points[id+1]));
- id+=2;
- break;
- case QPainterPath::CurveToElement: {
- QPointF p1(points[id], points[id+1]);
- QPointF p2(points[id+2], points[id+3]);
- QPointF p3(points[id+4], points[id+5]);
- p.cubicTo(p1, p2, p3);
- id+=6;
- break;
- }
- case QPainterPath::CurveToDataElement:
- ;
- break;
- }
- }
- } else {
- p.moveTo(QPointF(points[0], points[1]));
- int id = 2;
- for (int i=1; i<path.elementCount(); ++i) {
- p.lineTo(QPointF(points[id], points[id+1]));
- id+=2;
- }
- }
- if (path.hints() & QVectorPath::WindingFill)
- p.setFillRule(Qt::WindingFill);
-
- return p;
-}
-
void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem)
{
QPainterPath path;
QTextItem::RenderFlags flags, qreal width,
const QTextCharFormat &charFormat);
// Helper function to calculate left most position, width and flags for decoration drawing
-Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
- const QFixedPoint *positions, int glyphCount,
- QFontEngine *fontEngine, const QFont &font,
- const QTextCharFormat &charFormat);
+static void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
+ const QFixedPoint *positions, int glyphCount,
+ QFontEngine *fontEngine, const QFont &font,
+ const QTextCharFormat &charFormat);
static inline QGradient::CoordinateMode coordinateMode(const QBrush &brush)
{
painter->setBrush(oldBrush);
}
-Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
- const QFixedPoint *positions, int glyphCount,
- QFontEngine *fontEngine, const QFont &font,
- const QTextCharFormat &charFormat)
+static void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
+ const QFixedPoint *positions, int glyphCount,
+ QFontEngine *fontEngine, const QFont &font,
+ const QTextCharFormat &charFormat)
{
if (!(font.underline() || font.strikeOut() || font.overline()))
return;
#define SMOOTH_SCALABLE 0xffff
-bool qt_enable_test_font = false;
-
-static QString styleStringHelper(int weight, QFont::Style style);
-
-Q_AUTOTEST_EXPORT void qt_setQtEnableTestFont(bool value)
-{
- qt_enable_test_font = value;
-}
-
static int getFontWeight(const QString &weightString)
{
QString s = weightString.toLower();
#endif // QT_NO_FONTCONFIG
static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt);
+static QString styleStringHelper(int weight, QFont::Style style);
static void initializeFontDb()
{
if (!privateDb()->count)
initializeFontDb();
-#ifdef QT_BUILD_INTERNAL
- if (qt_enable_test_font && req.family == QLatin1String("__Qt__Box__Engine__")) {
- fe = new QTestFontEngine(req.pixelSize);
- fe->fontDef = req;
- } else
-#endif
#ifndef QT_NO_FONTCONFIG
if (qt_x11Data->has_fontconfig) {
fe = loadFc(d, static_cast<QUnicodeTables::Script>(script), req);
-Q_GUI_EXPORT void qt_x11ft_convert_pattern(FcPattern *pattern, QByteArray *file_name, int *index, bool *antialias)
+static void qt_x11ft_convert_pattern(FcPattern *pattern, QByteArray *file_name, int *index, bool *antialias)
{
FcChar8 *fileName;
FcPatternGetString(pattern, FC_FILE, 0, &fileName);
#define AUTO_REPEAT_DELAY 300
#define AUTO_REPEAT_INTERVAL 100
-Q_GUI_EXPORT extern bool qt_tab_all_widgets;
-
/*!
\class QAbstractButton
**
****************************************************************************/
-//#define QT_EXPERIMENTAL_CLIENT_DECORATIONS
-
#include "qmainwindow.h"
#include "qmainwindowlayout_p.h"
return QMainWindowPrivate::mainWindowLayout(mainWindow);
}
-#ifdef QT_EXPERIMENTAL_CLIENT_DECORATIONS
-Q_GUI_EXPORT void qt_setMainWindowTitleWidget(QMainWindow *mainWindow, Qt::DockWidgetArea area, QWidget *widget)
-{
- QGridLayout *topLayout = qobject_cast<QGridLayout *>(mainWindow->layout());
- Q_ASSERT(topLayout);
-
- int row = 0;
- int column = 0;
-
- switch (area) {
- case Qt::LeftDockWidgetArea:
- row = 1;
- column = 0;
- break;
- case Qt::TopDockWidgetArea:
- row = 0;
- column = 1;
- break;
- case Qt::BottomDockWidgetArea:
- row = 2;
- column = 1;
- break;
- case Qt::RightDockWidgetArea:
- row = 1;
- column = 2;
- break;
- default:
- Q_ASSERT_X(false, "qt_setMainWindowTitleWidget", "Unknown area");
- return;
- }
-
- if (QLayoutItem *oldItem = topLayout->itemAtPosition(row, column))
- delete oldItem->widget();
- topLayout->addWidget(widget, row, column);
-}
-#endif
-
void QMainWindowPrivate::init()
{
Q_Q(QMainWindow);
-#ifdef QT_EXPERIMENTAL_CLIENT_DECORATIONS
- QGridLayout *topLayout = new QGridLayout(q);
- topLayout->setContentsMargins(0, 0, 0, 0);
-
- layout = new QMainWindowLayout(q, topLayout);
-
- topLayout->addItem(layout, 1, 1);
-#else
layout = new QMainWindowLayout(q, 0);
-#endif
const int metric = q->style()->pixelMetric(QStyle::PM_ToolBarIconSize, 0, q);
iconSize = QSize(metric, metric);
static QTextStream qout(stderr, QIODevice::WriteOnly);
-static void dumpLayout(QTextStream &qout, const QDockAreaLayoutInfo &layout, QString indent);
-
static void dumpLayout(QTextStream &qout, const QDockAreaLayoutItem &item, QString indent)
{
qout << indent << "QDockAreaLayoutItem: "
qout.flush();
};
-
-void qt_dumpLayout(QTextStream &qout, QMainWindow *window)
-{
- QMainWindowLayout *layout = qt_mainwindow_layout(window);
- dumpLayout(qout, layout->layoutState.dockAreaLayout, QString());
-}
-
#endif // Q_DEBUG_MAINWINDOW_LAYOUT && !QT_NO_DOCKWIDGET
/******************************************************************************
//#define Q_DEBUG_MAINWINDOW_LAYOUT
#if defined(Q_DEBUG_MAINWINDOW_LAYOUT) && !defined(QT_NO_DOCKWIDGET)
-QT_BEGIN_NAMESPACE
-class QTextStream;
-Q_GUI_EXPORT void qt_dumpLayout(QTextStream &qout, QMainWindow *window);
-QT_END_NAMESPACE
+#include "qtextstream.h"
#endif // Q_DEBUG_MAINWINDOW_LAYOUT && !QT_NO_DOCKWIDGET
QT_BEGIN_NAMESPACE