summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/spreadsheet/spreadsheetdelegate.cpp6
-rw-r--r--doc/src/designer-manual.qdoc103
-rw-r--r--doc/src/images/rgbController-configure-connection1.pngbin0 -> 29210 bytes
-rw-r--r--doc/src/images/rgbController-configure-connection2.pngbin0 -> 28655 bytes
-rw-r--r--doc/src/images/rgbController-final-layout.pngbin0 -> 11275 bytes
-rw-r--r--doc/src/images/rgbController-form-gridLayout.pngbin0 -> 11235 bytes
-rw-r--r--doc/src/images/rgbController-property-editing.pngbin0 -> 9158 bytes
-rw-r--r--doc/src/images/rgbController-screenshot.pngbin0 -> 8995 bytes
-rw-r--r--doc/src/images/rgbController-selectForLayout.pngbin0 -> 20981 bytes
-rw-r--r--doc/src/images/rgbController-signalsAndSlots.pngbin0 -> 10050 bytes
-rw-r--r--src/3rdparty/phonon/phonon/effectwidget.cpp3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp5
-rw-r--r--src/gui/dialogs/qfontdialog_mac.mm39
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp8
-rw-r--r--src/gui/styles/qgtkstyle.cpp2
-rw-r--r--src/gui/text/qfontengine_win.cpp6
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp25
-rw-r--r--tests/auto/qdate/tst_qdate.cpp26
-rw-r--r--tools/assistant/tools/assistant/centralwidget.cpp166
-rw-r--r--tools/assistant/tools/assistant/centralwidget.h10
-rw-r--r--tools/qdoc3/test/classic.css8
21 files changed, 231 insertions, 176 deletions
diff --git a/demos/spreadsheet/spreadsheetdelegate.cpp b/demos/spreadsheet/spreadsheetdelegate.cpp
index 465c92f..2916757 100644
--- a/demos/spreadsheet/spreadsheetdelegate.cpp
+++ b/demos/spreadsheet/spreadsheetdelegate.cpp
@@ -51,7 +51,7 @@ QWidget *SpreadSheetDelegate::createEditor(QWidget *parent,
{
if (index.column() == 1) {
QDateTimeEdit *editor = new QDateTimeEdit(parent);
- editor->setDisplayFormat("dd/M/yyy");
+ editor->setDisplayFormat("dd/M/yyyy");
editor->setCalendarPopup(true);
return editor;
}
@@ -93,7 +93,7 @@ void SpreadSheetDelegate::setEditorData(QWidget *editor,
if (dateEditor) {
dateEditor->setDate(QDate::fromString(
index.model()->data(index, Qt::EditRole).toString(),
- "d/M/yy"));
+ "d/M/yyyy"));
}
}
}
@@ -107,7 +107,7 @@ void SpreadSheetDelegate::setModelData(QWidget *editor,
} else {
QDateTimeEdit *dateEditor = qobject_cast<QDateTimeEdit *>(editor);
if (dateEditor) {
- model->setData(index, dateEditor->date().toString("dd/M/yyy"));
+ model->setData(index, dateEditor->date().toString("dd/M/yyyy"));
}
}
}
diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc
index 77b208b..58d0f71 100644
--- a/doc/src/designer-manual.qdoc
+++ b/doc/src/designer-manual.qdoc
@@ -299,12 +299,12 @@
\row
\i \inlineimage designer-widget-box.png
\i \bold{Qt Designer's Widget Box}
-
+
The widget box provides a selection of standard Qt widgets, layouts,
and other objects that can be used to create user interfaces on forms.
Each of the categories in the widget box contain widgets with similar
uses or related features.
-
+
\note Since Qt 4.4, new widgets have been included, e.g.,
QPlainTextEdit, QCommandLinkButton, QScrollArea, QMdiArea, and
QWebView.
@@ -358,7 +358,7 @@
using a grid. The coordinates on the screenshot show the position of each
widget within the grid.
- \image addressbook-tutorial-part3-labeled-layout.png
+ \image addressbook-tutorial-part3-labeled-layout.png
\note Inside the grid, the QPushButton objects are actually nested. The
buttons on the right are first placed in a QVBoxLayout; the buttons at the
@@ -367,7 +367,7 @@
To visualize, imagine the layout as a box that shrinks as much as possible,
attempting to \e squeeze your widgets in a neat arrangement, and, at the
- same time, maximize the use of available space.
+ same time, maximize the use of available space.
Qt's layouts help when you:
@@ -436,17 +436,15 @@
You start by choosing \gui Widget from the \gui{New Form} dialog.
\endtable
- Then you drag three labels, three spin boxes and three vertical sliders on
- to your form. To change the label's default text, simply double-click on
- it. The screenshot below shows the form after all three labels have been
- renamed.
-
- You can roughly arrange them according to how you would like them to be
- laid out.
\table
- \row \o \inlineimage rgbController-widgetBox.png
- \o \inlineimage rgbController-arrangement.png
+ \row
+ \i \inlineimage rgbController-arrangement.png
+ \i \bold{Placing Widgets on a Form}
+
+ Drag three labels, three spin boxes and three vertical sliders on to your
+ form. To change the label's default text, simply double-click on it. You
+ can arrange them according to how you would like them to be laid out.
\endtable
To ensure that they are laid out exactly like this in your program, you
@@ -455,22 +453,15 @@
its corresponding spin box and slider. In the \gui{Form} menu, select
\gui{Lay Out in a Grid}.
- \omit
\table
\row
\i \inlineimage rgbController-form-gridLayout.png
\i \inlineimage rgbController-selectForLayout.png
\endtable
- \endomit
Repeat the step for the other two labels along with their corresponding
- spin boxes and sliders as well. Your form will now look similar to the
- screenshot below.
-
- \omit
- \image rgbController-almostLaidOut.png
- \endomit
+ spin boxes and sliders as well.
The next step is to combine all three layouts into one \bold{main layout}.
It is important that your form has a main layout; otherwise, the widgets
@@ -478,24 +469,26 @@
layout, \gui{Right click} anywhere on your form, outside of the three
separate layouts, and select \gui{Lay Out Horizontally}. Alternatively, you
could also select \gui{Lay Out in a Grid} -- you will still see the same
- arrangement.
+ arrangement (shown below).
+
+ \image rgbController-final-layout.png
\note Main layouts cannot be seen on the form. To check if you have a main
layout installed, try resizing your form; your widgets should resize
accordingly.
When you click on the slider and drag it to a certain value, you want the
- spin box to display the slider's position. To do this, you need to connect
- the slider's \l{QAbstractSlider::}{valueChanged()} signal to the spin box's
- \l{QSpinBox::}{setValue()} slot. You also need to make the reverse
- connections, e.g., connect the spin box's \l{QSpinBox::}{valueChanged()}
- signal to the slider's \l{QAbstractSlider::value()}{setValue()} slot.
+ spin box to display the slider's position. To accomplish this behavior, you
+ need to connect the slider's \l{QAbstractSlider::}{valueChanged()} signal
+ to the spin box's \l{QSpinBox::}{setValue()} slot. You also need to make
+ the reverse connections, e.g., connect the spin box's \l{QSpinBox::}
+ {valueChanged()} signal to the slider's \l{QAbstractSlider::value()}
+ {setValue()} slot.
To do this, you have to switch to \gui{Edit Signals/Slots} mode, either by
pressing \key{F4} or something \gui{Edit Signals/Slots} from the \gui{Edit}
menu.
- \omit
\table
\row
\i \inlineimage rgbController-signalsAndSlots.png
@@ -505,17 +498,19 @@
\gui{Configure Connection} dialog, shown below, will pop up. Select the
correct signal and slot and click \gui OK.
\endtable
- \endomit
- \omit
- \image rgbController-configureConnection.png
- \endomit
+ \image rgbController-configureConnection1.png
Repeat the step (in reverse order), clicking on the spin box and dragging
the cursor towards the slider, to connect the spin box's
\l{QSpinBox::}{valueChanged()} signal to the slider's
\l{QAbstractSlider::value()}{setValue()} slot.
+ You can use the screenshot below as a guide to selecting the correct signal
+ and slot.
+
+ \image rgbController-configure-connection2.png
+
Now that you have successfully connected the objects for the "RED"
component of the RGB Controller, do the same for the "GREEN" and "BLUE"
components as well.
@@ -523,7 +518,6 @@
Since RGB values range between 0 and 255, we need to limit the spin box
and slider to that particular range.
- \omit
\table
\row
\i \inlineimage rgbController-property-editing.png
@@ -534,17 +528,14 @@
\l{QSpinBox::}{maximum} property. Then, click on the first vertical
slider, you will see \l{QAbstractSlider}'s properties. Enter "255" for
the \l{QAbstractSlider::}{maximum} property as well. Repeat this
- process for the remaining spin boxes and sliders.
+ process for the remaining spin boxes and sliders.
\endtable
- \endomit
Now, we preview your form to see how it would look in your application. To
preview your form, press \key{Ctrl + R} or select \gui Preview from the
\gui Form menu.
- \omit
\image rgbController-preview.png
- \endomit
Try dragging the slider - the spin box will mirror its value too (and vice
versa). Also, you can resize it to see how the layouts used to manage the
@@ -790,11 +781,11 @@
have a \c text property that can also be edited by double-clicking
on the widget or by pressing \gui F2. \QD interprets the backslash
(\\) character specially, enabling newline (\\n) characters to be
- inserted into the text; the \\\\ character sequence is used to
+ inserted into the text; the \\\\ character sequence is used to
insert a single backslash into the text. A context menu can also be
opened while editing, providing another way to insert special
characters and newlines into the text.
- \endlist
+ \endlist
\section2 Dynamic Properties
@@ -806,12 +797,12 @@
\image designer-property-editor-toolbar.png
- To add a dynamic property, clcik on the \gui Add button
+ To add a dynamic property, clcik on the \gui Add button
\inlineimage designer-property-editor-add-dynamic.png
- . To remove it, click on the \gui Remove button
+ . To remove it, click on the \gui Remove button
\inlineimage designer-property-editor-remove-dynamic.png
instead. You can also sort the properties alphabetically and change the
- color groups by clickinig on the \gui Configure button
+ color groups by clickinig on the \gui Configure button
\inlineimage designer-property-editor-configure.png
.
@@ -913,7 +904,7 @@
\section2 Horizontal and Vertical Layouts
-
+
The simplest way to arrange objects on a form is to place them in a
horizontal or vertical layout. Horizontal layouts ensure that the widgets
within are aligned horizontally; vertical layouts ensure that they are
@@ -1140,7 +1131,7 @@
spacers just provide spacing hints to layouts, so they cannot be connected
to other objects.
-
+
\target HighlightedObjects
\table
\row
@@ -1179,7 +1170,7 @@
\image designer-connection-dialog.png
- To complete the connection, select a signal from the source object and a
+ To complete the connection, select a signal from the source object and a
slot from the destination object, then click \key OK. Click \key Cancel if
you wish to abandon the connection.
@@ -1722,22 +1713,22 @@
\i \bold{Resource Files}
Within the resource browser, you can open existing resource files or
- create new ones. Click the \gui{Edit Resources} button
+ create new ones. Click the \gui{Edit Resources} button
\inlineimage designer-edit-resources-button.png
to edit your resources. To reload resources, click on the \gui Reload
- button
+ button
\inlineimage designer-reload-resources-button.png
.
\endtable
Once a resource file is loaded, you can create or remove entries in it
- using the given \gui{Add Files}
- \inlineimage designer-add-resource-entry-button.png
- and \gui{Remove Files}
+ using the given \gui{Add Files}
+ \inlineimage designer-add-resource-entry-button.png
+ and \gui{Remove Files}
\inlineimage designer-remove-resource-entry-button.png
buttons, and specify resources (e.g., images) using the \gui{Add Files}
- button
+ button
\inlineimage designer-add-files-button.png
. Note that these resources must reside within the current resource file's
directory or one of its subdirectories.
@@ -1749,15 +1740,15 @@
\i \inlineimage designer-edit-resource.png
\i \bold{Editing Resource Files}
- Press the
+ Press the
\inlineimage designer-add-resource-entry-button.png
button to add a new resource entry to the file. Then use the
- \gui{Add Files} button
+ \gui{Add Files} button
\inlineimage designer-add-files-button.png
to specify the resource.
You can remove resources by selecting the corresponding entry in the
- resource editor, and pressing the
+ resource editor, and pressing the
\inlineimage designer-remove-resource-entry-button.png
button.
\endtable
@@ -2565,7 +2556,7 @@ pixmap property in the property editor.
QDesignerTaskMenuExtension is useful for custom widgets. It provides an
extension that allows you to add custom menu entries to \QD's task
menu.
-
+
The \l{designer/taskmenuextension}{Task Menu Extension} example
illustrates how to use this class.
@@ -2666,7 +2657,7 @@ pixmap property in the property editor.
function, making it able to create your extension, such as a
\l{designer/containerextension}{MultiPageWidget} container extension.
- You can either create a new QExtensionFactory and reimplement the
+ You can either create a new QExtensionFactory and reimplement the
QExtensionFactory::createExtension() function:
\snippet doc/src/snippets/code/doc_src_designer-manual.qdoc 8
diff --git a/doc/src/images/rgbController-configure-connection1.png b/doc/src/images/rgbController-configure-connection1.png
new file mode 100644
index 0000000..0798184
--- /dev/null
+++ b/doc/src/images/rgbController-configure-connection1.png
Binary files differ
diff --git a/doc/src/images/rgbController-configure-connection2.png b/doc/src/images/rgbController-configure-connection2.png
new file mode 100644
index 0000000..f3fcc62
--- /dev/null
+++ b/doc/src/images/rgbController-configure-connection2.png
Binary files differ
diff --git a/doc/src/images/rgbController-final-layout.png b/doc/src/images/rgbController-final-layout.png
new file mode 100644
index 0000000..d32a93e
--- /dev/null
+++ b/doc/src/images/rgbController-final-layout.png
Binary files differ
diff --git a/doc/src/images/rgbController-form-gridLayout.png b/doc/src/images/rgbController-form-gridLayout.png
new file mode 100644
index 0000000..c8f3dcf
--- /dev/null
+++ b/doc/src/images/rgbController-form-gridLayout.png
Binary files differ
diff --git a/doc/src/images/rgbController-property-editing.png b/doc/src/images/rgbController-property-editing.png
new file mode 100644
index 0000000..64fc500
--- /dev/null
+++ b/doc/src/images/rgbController-property-editing.png
Binary files differ
diff --git a/doc/src/images/rgbController-screenshot.png b/doc/src/images/rgbController-screenshot.png
new file mode 100644
index 0000000..6019233
--- /dev/null
+++ b/doc/src/images/rgbController-screenshot.png
Binary files differ
diff --git a/doc/src/images/rgbController-selectForLayout.png b/doc/src/images/rgbController-selectForLayout.png
new file mode 100644
index 0000000..7a8e184
--- /dev/null
+++ b/doc/src/images/rgbController-selectForLayout.png
Binary files differ
diff --git a/doc/src/images/rgbController-signalsAndSlots.png b/doc/src/images/rgbController-signalsAndSlots.png
new file mode 100644
index 0000000..2ba3aba
--- /dev/null
+++ b/doc/src/images/rgbController-signalsAndSlots.png
Binary files differ
diff --git a/src/3rdparty/phonon/phonon/effectwidget.cpp b/src/3rdparty/phonon/phonon/effectwidget.cpp
index da5a51a..d5c6c81 100644
--- a/src/3rdparty/phonon/phonon/effectwidget.cpp
+++ b/src/3rdparty/phonon/phonon/effectwidget.cpp
@@ -165,6 +165,7 @@ void EffectWidgetPrivate::autogenerateUi()
if (minValue == -1. && maxValue == 1.) {
//Special case values between -1 and 1.0 to use a slider for improved usability
QSlider *slider = new QSlider(Qt::Horizontal, q);
+ control = slider;
slider->setRange(-SLIDER_RANGE, +SLIDER_RANGE);
slider->setValue(int(SLIDER_RANGE * value.toDouble()));
slider->setTickPosition(QSlider::TicksBelow);
@@ -188,10 +189,10 @@ void EffectWidgetPrivate::autogenerateUi()
break;
}
+ if (control) {
#ifndef QT_NO_TOOLTIP
control->setToolTip(para.description());
#endif
- if (control) {
#ifndef QT_NO_SHORTCUT
label->setBuddy(control);
#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 5dc6363..e565476 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -268,7 +268,7 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
}
/*!
- Returns the frame's content, converted to HTML.
+ Returns the frame's content as HTML, enclosed in HTML and BODY tags.
\sa setHtml(), toPlainText()
*/
@@ -280,7 +280,8 @@ QString QWebFrame::toHtml() const
}
/*!
- Returns the content of this frame converted to plain text.
+ Returns the content of this frame converted to plain text, completely
+ stripped of all HTML formatting.
\sa toHtml()
*/
diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm
index 13f7149..3be53db 100644
--- a/src/gui/dialogs/qfontdialog_mac.mm
+++ b/src/gui/dialogs/qfontdialog_mac.mm
@@ -47,6 +47,7 @@
#include <private/qapplication_p.h>
#include <private/qfont_p.h>
#include <private/qfontengine_p.h>
+#include <private/qt_cocoa_helpers_mac_p.h>
#include <private/qt_mac_p.h>
#include <qdebug.h>
#import <AppKit/AppKit.h>
@@ -123,16 +124,16 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
QFont newFont;
if (cocoaFont) {
int pSize = qRound([cocoaFont pointSize]);
- QString family(QCFString::toQString(reinterpret_cast<CFStringRef>([cocoaFont familyName])));
- QString typeface(QCFString::toQString(reinterpret_cast<CFStringRef>([cocoaFont fontName])));
-// qDebug() << "original family" << family << "typeface" << typeface << "psize" << pSize;
+ QString family(qt_mac_NSStringToQString([cocoaFont familyName]));
+ QString typeface(qt_mac_NSStringToQString([cocoaFont fontName]));
+
int hyphenPos = typeface.indexOf(QLatin1Char('-'));
if (hyphenPos != -1) {
typeface.remove(0, hyphenPos + 1);
} else {
typeface = QLatin1String("Normal");
}
-// qDebug() << " massaged family" << family << "typeface" << typeface << "psize" << pSize;
+
newFont = QFontDatabase().font(family, typeface, pSize);
newFont.setUnderline(resolveFont.underline());
newFont.setStrikeOut(resolveFont.strikeOut());
@@ -598,15 +599,37 @@ QFont QFontDialogPrivate::execCocoaFontPanel(bool *ok, const QFont &initial,
}
}
-void QFontDialogPrivate::setFont(void * delegate, const QFont &font)
+void QFontDialogPrivate::setFont(void *delegate, const QFont &font)
{
+ QMacCocoaAutoReleasePool pool;
QFontEngine *fe = font.d->engineForScript(QUnicodeTables::Common);
+ NSFontManager *mgr = [NSFontManager sharedFontManager];
+ NSFont *nsFont = 0;
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if (qstrcmp(fe->name(), "CoreText") == 0) {
- const NSFont *nsFont = reinterpret_cast<const NSFont *>(static_cast<QCoreTextFontEngineMulti *>(fe)->ctfont);
- [[NSFontManager sharedFontManager] setSelectedFont:nsFont isMultiple:NO];
- }
+ nsFont = reinterpret_cast<const NSFont *>(static_cast<QCoreTextFontEngineMulti *>(fe)->ctfont);
+ } else
#endif
+ {
+ int weight = 5;
+ NSFontTraitMask mask = 0;
+ if (font.style() == QFont::StyleItalic) {
+ mask |= NSItalicFontMask;
+ }
+ if (font.weight() == QFont::Bold) {
+ weight = 9;
+ mask |= NSBoldFontMask;
+ }
+
+ NSFontManager *mgr = [NSFontManager sharedFontManager];
+ nsFont = [mgr fontWithFamily:qt_mac_QStringToNSString(font.family())
+ traits:mask
+ weight:weight
+ size:font.pointSize()];
+ }
+
+ [mgr setSelectedFont:nsFont isMultiple:NO];
[static_cast<QCocoaFontPanelDelegate *>(delegate) setQtFont:font];
}
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 3fd1ffb..89df869 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -92,8 +92,8 @@ void QTextureGlyphCache::populate(const QTextItemInt &ti,
int glyph_height = metrics.height.ceil().toInt();
if (glyph_height == 0 || glyph_width == 0)
continue;
- glyph_width += margin * 2 + 2;
- glyph_height += margin * 2 + 2;
+ glyph_width += margin * 2 + 4;
+ glyph_height += margin * 2 + 4;
// align to 8-bit boundary
if (m_type == QFontEngineGlyphCache::Raster_Mono)
glyph_width = (glyph_width+7)&~7;
@@ -189,7 +189,11 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
int QImageTextureGlyphCache::glyphMargin() const
{
+#ifdef Q_WS_MAC
return 2;
+#else
+ return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0;
+#endif
}
void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g)
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index 86653df..14be518 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -2344,7 +2344,7 @@ void QGtkStyle::drawControl(ControlElement element,
case CE_SizeGrip: {
GtkWidget *gtkStatusbar = QGtk::gtkWidget(QLS("GtkStatusbar.GtkFrame"));
QRect gripRect = option->rect.adjusted(0, 0, -gtkStatusbar->style->xthickness, -gtkStatusbar->style->ythickness);
- gtkPainter.paintResizeGrip( gtkStatusbar, "window", gripRect, GTK_STATE_NORMAL,
+ gtkPainter.paintResizeGrip( gtkStatusbar, "statusbar", gripRect, GTK_STATE_NORMAL,
GTK_SHADOW_OUT, QApplication::isRightToLeft() ?
GDK_WINDOW_EDGE_SOUTH_WEST : GDK_WINDOW_EDGE_SOUTH_EAST,
gtkStatusbar->style);
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index bf3a176..7341665 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -1406,8 +1406,8 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin
#endif
#endif
- QNativeImage *ni = new QNativeImage(iw + 2 * margin + 2,
- ih + 2 * margin + 2,
+ QNativeImage *ni = new QNativeImage(iw + 2 * margin + 4,
+ ih + 2 * margin + 4,
QNativeImage::systemFormat(), true);
ni->image.fill(0xffffffff);
@@ -1449,7 +1449,7 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform)
font = CreateFontIndirectW(&lf);
}
- QNativeImage *mask = drawGDIGlyph(font, glyph, 2, xform);
+ QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform);
if (mask == 0)
return QImage();
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 6f8cf42..cb101af 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -482,30 +482,7 @@ void QSslSocketPrivate::resetDefaultCiphers()
QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
{
-#ifdef QQ_OS_UNIX
- // Check known locations for the system's default bundle. ### On Windows,
- // we should use CAPI to find the bundle, and not rely on default unix
- // locations.
- const char *standardLocations[] = {"/etc/ssl/certs/",
-#if 0
- // KDE uses KConfig for its SSL store,
- // but it also stores the bundle at
- // this location
- "$HOME/.kde/share/apps/kssl/ca-bundle.crt",
-#endif
- 0};
- const char **it = standardLocations;
- QStringList nameFilter;
- nameFilter << QLatin1String("*.pem") << QLatin1String("*.crt");
- while (*it) {
- if (QDirIterator(QLatin1String(*it), nameFilter).hasNext())
- return certificatesFromPath(QLatin1String(*it));
- ++it;
- }
-#endif
-
- // Qt provides a default bundle when we cannot detect the system's default
- // bundle.
+ // Qt provides a default bundle of certificates
QFile caBundle(QLatin1String(":/trolltech/network/ssl/qt-ca-bundle.crt"));
if (caBundle.open(QIODevice::ReadOnly | QIODevice::Text))
return QSslCertificate::fromDevice(&caBundle);
diff --git a/tests/auto/qdate/tst_qdate.cpp b/tests/auto/qdate/tst_qdate.cpp
index d4273d0..4d6c80c 100644
--- a/tests/auto/qdate/tst_qdate.cpp
+++ b/tests/auto/qdate/tst_qdate.cpp
@@ -82,6 +82,8 @@ private slots:
void operator_gt_eq();
void fromString_data();
void fromString();
+ void fromString_format_data();
+ void fromString_format();
void toString_format_data();
void toString_format();
void isLeapYear();
@@ -618,6 +620,30 @@ void tst_QDate::fromString()
QCOMPARE( QDate::fromString( str2, Qt::ISODate ), d1 );
}
+void tst_QDate::fromString_format_data()
+{
+ QTest::addColumn<QString>("string");
+ QTest::addColumn<QString>("format");
+ QTest::addColumn<QDate>("date");
+
+ //year with yy is always 19xx for compatibility
+ QTest::newRow( "data0" ) << QString("21052006") << QString("ddMMyyyy") << QDate(2006,5,21);
+ QTest::newRow( "data1" ) << QString("210506") << QString("ddMMyy") << QDate(1906,5,21);
+ QTest::newRow( "data2" ) << QString("21/5/2006") << QString("d/M/yyyy") << QDate(2006,5,21);
+ QTest::newRow( "data3" ) << QString("21/5/06") << QString("d/M/yy") << QDate(1906,5,21);
+ QTest::newRow( "data4" ) << QString("20060521") << QString("yyyyMMdd") << QDate(2006,5,21);
+ QTest::newRow( "data5" ) << QString("060521") << QString("yyMMdd") << QDate(1906,5,21);
+}
+
+void tst_QDate::fromString_format()
+{
+ QFETCH( QString, string );
+ QFETCH( QString, format );
+ QFETCH( QDate, date );
+
+ QCOMPARE( QDate::fromString( string, format ), date );
+}
+
void tst_QDate::toString_format_data()
{
QTest::addColumn<QDate>("t");
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp
index b78f346..52d48d5 100644
--- a/tools/assistant/tools/assistant/centralwidget.cpp
+++ b/tools/assistant/tools/assistant/centralwidget.cpp
@@ -87,6 +87,7 @@ namespace {
FindWidget::FindWidget(QWidget *parent)
: QWidget(parent)
+ , appPalette(qApp->palette())
{
QHBoxLayout *hboxLayout = new QHBoxLayout(this);
QString resourcePath = QLatin1String(":/trolltech/assistant/images/");
@@ -148,6 +149,34 @@ FindWidget::~FindWidget()
{
}
+void FindWidget::hideEvent(QHideEvent* event)
+{
+#if !defined(QT_NO_WEBKIT)
+ // TODO: remove this once webkit supports setting the palette
+ if (!event->spontaneous())
+ qApp->setPalette(appPalette);
+#else
+ Q_UNUSED(event);
+#endif
+}
+
+void FindWidget::showEvent(QShowEvent* event)
+{
+#if !defined(QT_NO_WEBKIT)
+ // TODO: remove this once webkit supports setting the palette
+ if (!event->spontaneous()) {
+ QPalette p = appPalette;
+ p.setColor(QPalette::Inactive, QPalette::Highlight,
+ p.color(QPalette::Active, QPalette::Highlight));
+ p.setColor(QPalette::Inactive, QPalette::HighlightedText,
+ p.color(QPalette::Active, QPalette::HighlightedText));
+ qApp->setPalette(p);
+ }
+#else
+ Q_UNUSED(event);
+#endif
+}
+
void FindWidget::updateButtons()
{
if (editFind->text().isEmpty()) {
@@ -245,12 +274,14 @@ CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent)
SLOT(showTabBarContextMenu(QPoint)));
}
- QPalette p = qApp->palette();
+#if defined(QT_NO_WEBKIT)
+ QPalette p = palette();
p.setColor(QPalette::Inactive, QPalette::Highlight,
p.color(QPalette::Active, QPalette::Highlight));
p.setColor(QPalette::Inactive, QPalette::HighlightedText,
p.color(QPalette::Active, QPalette::HighlightedText));
- qApp->setPalette(p);
+ setPalette(p);
+#endif
}
CentralWidget::~CentralWidget()
@@ -848,60 +879,64 @@ void CentralWidget::keyPressEvent(QKeyEvent *e)
QWidget::keyPressEvent(e);
}
-void CentralWidget::find(QString ttf, bool forward, bool backward)
+void CentralWidget::find(const QString &ttf, bool forward, bool backward)
{
- QTextCursor cursor;
- QTextDocument *doc = 0;
- QTextBrowser *browser = 0;
-
- HelpViewer *viewer = currentHelpViewer();
QPalette p = findWidget->editFind->palette();
p.setColor(QPalette::Active, QPalette::Base, Qt::white);
-#if !defined(QT_NO_WEBKIT)
- Q_UNUSED(forward)
- Q_UNUSED(doc)
- Q_UNUSED(browser)
-
- if (viewer) {
- QWebPage::FindFlags options;
- if (backward)
- options |= QWebPage::FindBackward;
+ if (!ttf.isEmpty()) {
+ HelpViewer *viewer = currentHelpViewer();
- if (findWidget->checkCase->isChecked())
- options |= QWebPage::FindCaseSensitively;
+ bool found = false;
+#if !defined(QT_NO_WEBKIT)
+ if (viewer) {
+ QWebPage::FindFlags options;
+ if (backward)
+ options |= QWebPage::FindBackward;
- bool found = viewer->findText(ttf, options);
- findWidget->labelWrapped->hide();
+ if (findWidget->checkCase->isChecked())
+ options |= QWebPage::FindCaseSensitively;
- if (!found) {
- options |= QWebPage::FindWrapsAroundDocument;
found = viewer->findText(ttf, options);
+ findWidget->labelWrapped->hide();
if (!found) {
- p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102));
- } else {
- findWidget->labelWrapped->show();
+ options |= QWebPage::FindWrapsAroundDocument;
+ found = viewer->findText(ttf, options);
+ if (found)
+ findWidget->labelWrapped->show();
}
+ } else if (tabWidget->currentWidget() == m_searchWidget) {
+ QTextBrowser *browser = qFindChild<QTextBrowser*>(m_searchWidget);
+ found = findInTextBrowser(browser, ttf, forward, backward);
}
- }
#else
- if (viewer) {
- doc = viewer->document();
- cursor = viewer->textCursor();
- browser = qobject_cast<QTextBrowser*>(viewer);
- }
+ QTextBrowser *browser = qobject_cast<QTextBrowser*>(viewer);
+ if (tabWidget->currentWidget() == m_searchWidget)
+ browser = qFindChild<QTextBrowser*>(m_searchWidget);
+ found = findInTextBrowser(browser, ttf, forward, backward);
+#endif
- if (tabWidget->currentWidget() == m_searchWidget) {
- QTextBrowser *browser = qFindChild<QTextBrowser*>(m_searchWidget);
- if (browser) {
- doc = browser->document();
- cursor = browser->textCursor();
- }
+ if (!found)
+ p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102));
}
- if (!browser || !doc || cursor.isNull())
- return;
+ if (!findWidget->isVisible())
+ findWidget->show();
+ findWidget->editFind->setPalette(p);
+}
+
+bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf,
+ bool forward, bool backward)
+{
+ if (!browser)
+ return false;
+
+ QTextDocument *doc = browser->document();
+ QTextCursor cursor = browser->textCursor();
+
+ if (!doc || cursor.isNull())
+ return false;
QTextDocument::FindFlags options;
@@ -910,44 +945,33 @@ void CentralWidget::find(QString ttf, bool forward, bool backward)
QTextCursor::MoveAnchor);
}
- QTextCursor newCursor = cursor;
+ if (backward)
+ options |= QTextDocument::FindBackward;
- if (!ttf.isEmpty()) {
- if (backward)
- options |= QTextDocument::FindBackward;
-
- if (findWidget->checkCase->isChecked())
- options |= QTextDocument::FindCaseSensitively;
+ if (findWidget->checkCase->isChecked())
+ options |= QTextDocument::FindCaseSensitively;
- if (findWidget->checkWholeWords->isChecked())
- options |= QTextDocument::FindWholeWords;
+ if (findWidget->checkWholeWords->isChecked())
+ options |= QTextDocument::FindWholeWords;
- newCursor = doc->find(ttf, cursor, options);
- findWidget->labelWrapped->hide();
+ findWidget->labelWrapped->hide();
+ bool found = true;
+ QTextCursor newCursor = doc->find(ttf, cursor, options);
+ if (newCursor.isNull()) {
+ QTextCursor ac(doc);
+ ac.movePosition(options & QTextDocument::FindBackward
+ ? QTextCursor::End : QTextCursor::Start);
+ newCursor = doc->find(ttf, ac, options);
if (newCursor.isNull()) {
- QTextCursor ac(doc);
- ac.movePosition(options & QTextDocument::FindBackward
- ? QTextCursor::End : QTextCursor::Start);
- newCursor = doc->find(ttf, ac, options);
- if (newCursor.isNull()) {
- p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102));
- newCursor = cursor;
- } else {
- findWidget->labelWrapped->show();
- }
+ found = false;
+ newCursor = cursor;
+ } else {
+ findWidget->labelWrapped->show();
}
}
-#endif
-
- if (!findWidget->isVisible())
- findWidget->show();
-
-#if defined(QT_NO_WEBKIT)
- if (browser)
- browser->setTextCursor(newCursor);
-#endif
- findWidget->editFind->setPalette(p);
+ browser->setTextCursor(newCursor);
+ return found;
}
void CentralWidget::updateBrowserFont()
diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h
index e3ce200..d59dbe5 100644
--- a/tools/assistant/tools/assistant/centralwidget.h
+++ b/tools/assistant/tools/assistant/centralwidget.h
@@ -55,6 +55,7 @@ class QLabel;
class QAction;
class QCheckBox;
class QLineEdit;
+class QTextBrowser;
class QToolButton;
class HelpViewer;
@@ -79,6 +80,10 @@ signals:
void findNext();
void findPrevious();
+protected:
+ void hideEvent(QHideEvent* event);
+ void showEvent(QShowEvent * event);
+
private slots:
void updateButtons();
@@ -94,6 +99,7 @@ private:
QToolButton *toolPrevious;
QCheckBox *checkWholeWords;
+ QPalette appPalette;
friend class CentralWidget;
};
@@ -176,7 +182,9 @@ private slots:
private:
void connectSignals();
bool eventFilter(QObject *object, QEvent *e);
- void find(QString ttf, bool forward, bool backward);
+ void find(const QString &ttf, bool forward, bool backward);
+ bool findInTextBrowser(QTextBrowser* browser, const QString &ttf,
+ bool forward, bool backward);
void initPrinter();
QString quoteTabTitle(const QString &title) const;
void highlightSearchTerms();
diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css
index 6cf7377..f22a77a 100644
--- a/tools/qdoc3/test/classic.css
+++ b/tools/qdoc3/test/classic.css
@@ -77,10 +77,10 @@ table.annotated td {
table tr pre
{
- padding-top: none;
- padding-bottom: none;
- padding-left: none;
- padding-right: none;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ padding-left: 0px;
+ padding-right: 0px;
border: none;
background: none
}