summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp35
-rw-r--r--src/widgets/dialogs/qcolordialog_p.h2
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp5
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp2
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp2
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp6
-rw-r--r--src/widgets/dialogs/qinputdialog.cpp9
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp16
-rw-r--r--src/widgets/dialogs/qmessagebox.h7
-rw-r--r--src/widgets/dialogs/qwizard.cpp97
-rw-r--r--src/widgets/dialogs/qwizard.h3
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp50
-rw-r--r--src/widgets/dialogs/qwizard_win_p.h4
-rw-r--r--src/widgets/doc/snippets/code/doc_src_layout.cpp2
-rw-r--r--src/widgets/doc/snippets/customstyle/customstyle.cpp48
-rw-r--r--src/widgets/doc/snippets/mainwindowsnippet.cpp2
-rw-r--r--src/widgets/doc/snippets/mdiareasnippets.cpp2
-rw-r--r--src/widgets/doc/snippets/textdocument-imagedrop/textedit.cpp2
-rw-r--r--src/widgets/doc/snippets/timeline/main.cpp2
-rw-r--r--src/widgets/graphicsview/graphicsview.pri6
-rw-r--r--src/widgets/graphicsview/qgraphicsgridlayout.cpp55
-rw-r--r--src/widgets/graphicsview/qgraphicsgridlayoutengine.cpp106
-rw-r--r--src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h129
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp114
-rw-r--r--src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h96
-rw-r--r--src/widgets/graphicsview/qgraphicslinearlayout.cpp54
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.cpp16
-rw-r--r--src/widgets/graphicsview/qgraphicssceneindex.cpp70
-rw-r--r--src/widgets/graphicsview/qgraphicssceneindex_p.h33
-rw-r--r--src/widgets/graphicsview/qgridlayoutengine.cpp1745
-rw-r--r--src/widgets/graphicsview/qgridlayoutengine_p.h458
-rw-r--r--src/widgets/graphicsview/qsimplex_p.cpp4
-rw-r--r--src/widgets/graphicsview/qsimplex_p.h11
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp3
-rw-r--r--src/widgets/itemviews/qfileiconprovider.cpp8
-rw-r--r--src/widgets/itemviews/qheaderview.cpp133
-rw-r--r--src/widgets/itemviews/qheaderview_p.h28
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp8
-rw-r--r--src/widgets/itemviews/qtreeview.cpp14
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp9
-rw-r--r--src/widgets/kernel/kernel.pri5
-rw-r--r--src/widgets/kernel/qapplication.cpp124
-rw-r--r--src/widgets/kernel/qapplication.h4
-rw-r--r--src/widgets/kernel/qapplication_p.h7
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp4
-rw-r--r--src/widgets/kernel/qformlayout.h2
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp183
-rw-r--r--src/widgets/kernel/qopenglwidget_p.h135
-rw-r--r--src/widgets/kernel/qwidget.cpp114
-rw-r--r--src/widgets/kernel/qwidget_p.h33
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp5
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp138
-rw-r--r--src/widgets/kernel/qwidgetbackingstore_p.h27
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp59
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa_p.h1
-rw-r--r--src/widgets/kernel/win.pri2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm20
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h45
-rw-r--r--src/widgets/styles/qstyle.h2
-rw-r--r--src/widgets/styles/qstyleanimation.cpp42
-rw-r--r--src/widgets/styles/qstyleanimation_p.h22
-rw-r--r--src/widgets/styles/qwindowscestyle.cpp2
-rw-r--r--src/widgets/styles/qwindowsmobilestyle.cpp5572
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp20
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp16
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp4
-rw-r--r--src/widgets/util/qsystemtrayicon_qpa.cpp8
-rw-r--r--src/widgets/util/util.pri2
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp33
-rw-r--r--src/widgets/widgets/qabstractspinbox.h4
-rw-r--r--src/widgets/widgets/qabstractspinbox_p.h1
-rw-r--r--src/widgets/widgets/qcombobox.cpp12
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp12
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.cpp216
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.h5
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp16
-rw-r--r--src/widgets/widgets/qdockwidget.cpp6
-rw-r--r--src/widgets/widgets/qdockwidget_p.h2
-rw-r--r--src/widgets/widgets/qeffects.cpp42
-rw-r--r--src/widgets/widgets/qfontcombobox.cpp7
-rw-r--r--src/widgets/widgets/qlcdnumber.h1
-rw-r--r--src/widgets/widgets/qlineedit.cpp11
-rw-r--r--src/widgets/widgets/qlineedit_p.h5
-rw-r--r--src/widgets/widgets/qmdiarea.cpp3
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp6
-rw-r--r--src/widgets/widgets/qmenu.cpp52
-rw-r--r--src/widgets/widgets/qmenu.h1
-rw-r--r--src/widgets/widgets/qmenu_p.h2
-rw-r--r--src/widgets/widgets/qmenubar.cpp6
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp87
-rw-r--r--src/widgets/widgets/qplaintextedit.h7
-rw-r--r--src/widgets/widgets/qplaintextedit_p.h1
-rw-r--r--src/widgets/widgets/qpushbutton.cpp6
-rw-r--r--src/widgets/widgets/qsizegrip.cpp2
-rw-r--r--src/widgets/widgets/qslider.cpp4
-rw-r--r--src/widgets/widgets/qspinbox.cpp16
-rw-r--r--src/widgets/widgets/qsplashscreen.cpp4
-rw-r--r--src/widgets/widgets/qtabwidget.cpp3
-rw-r--r--src/widgets/widgets/qtextbrowser.cpp2
-rw-r--r--src/widgets/widgets/qtextedit.cpp34
-rw-r--r--src/widgets/widgets/qtextedit.h4
-rw-r--r--src/widgets/widgets/qtoolbar.cpp4
-rw-r--r--src/widgets/widgets/qtoolbar.h2
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp62
-rw-r--r--src/widgets/widgets/qwidgettextcontrol_p.h5
106 files changed, 4857 insertions, 5825 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 2e6518dd17..8866a3e97e 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -66,6 +66,8 @@
#include "qscreen.h"
#include "qcursor.h"
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
//////////// QWellArray BEGIN
@@ -758,13 +760,9 @@ void QColorLuminancePicker::paintEvent(QPaintEvent *)
int y;
uint *pixel = (uint *) img.scanLine(0);
for (y = 0; y < hi; y++) {
- const uint *end = pixel + wi;
- while (pixel < end) {
- QColor c;
- c.setHsv(hue, sat, y2val(y+coff));
- *pixel = c.rgb();
- ++pixel;
- }
+ uint *end = pixel + wi;
+ std::fill(pixel, end, QColor::fromHsv(hue, sat, y2val(y + coff)).rgb());
+ pixel = end;
}
pix = new QPixmap(QPixmap::fromImage(img));
}
@@ -907,10 +905,8 @@ public:
QColSpinBox(QWidget *parent)
: QSpinBox(parent) { setRange(0, 255); }
void setValue(int i) {
- bool block = signalsBlocked();
- blockSignals(true);
+ const QSignalBlocker blocker(this);
QSpinBox::setValue(i);
- blockSignals(block);
}
};
@@ -1393,7 +1389,7 @@ void QColorShower::setRgb(QRgb rgb)
void QColorShower::setHsv(int h, int s, int v)
{
if (h < -1 || (uint)s > 255 || (uint)v > 255)
- return;
+ return;
rgbOriginal = false;
hue = h; val = v; sat = s;
@@ -1794,6 +1790,21 @@ void QColorDialogPrivate::retranslateStrings()
cs->retranslateStrings();
}
+bool QColorDialogPrivate::canBeNativeDialog() const
+{
+ Q_Q(const QColorDialog);
+ if (nativeDialogInUse)
+ return true;
+ if (q->testAttribute(Qt::WA_DontShowOnScreen))
+ return false;
+ if (q->options() & QColorDialog::DontUseNativeDialog)
+ return false;
+
+ QLatin1String staticName(QColorDialog::staticMetaObject.className());
+ QLatin1String dynamicName(q->metaObject()->className());
+ return (staticName == dynamicName);
+}
+
static const Qt::WindowFlags DefaultWindowFlags =
Qt::Dialog | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint
| Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
@@ -2196,13 +2207,13 @@ bool QColorDialogPrivate::handleColorPickingKeyPress(QKeyEvent *e)
void QColorDialog::done(int result)
{
Q_D(QColorDialog);
- QDialog::done(result);
if (result == Accepted) {
d->selectedQColor = d->currentQColor();
emit colorSelected(d->selectedQColor);
} else {
d->selectedQColor = QColor();
}
+ QDialog::done(result);
if (d->receiverToDisconnectOnClose) {
disconnect(this, SIGNAL(colorSelected(QColor)),
d->receiverToDisconnectOnClose, d->memberToDisconnectOnClose);
diff --git a/src/widgets/dialogs/qcolordialog_p.h b/src/widgets/dialogs/qcolordialog_p.h
index f58a9200db..72c3b0e3cd 100644
--- a/src/widgets/dialogs/qcolordialog_p.h
+++ b/src/widgets/dialogs/qcolordialog_p.h
@@ -110,6 +110,8 @@ public:
bool handleColorPickingMouseButtonRelease(QMouseEvent *e);
bool handleColorPickingKeyPress(QKeyEvent *e);
+ bool canBeNativeDialog() const;
+
QWellArray *custom;
QWellArray *standard;
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 998866c039..1c580ce143 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -1729,7 +1729,7 @@ int QFileDialogPrivate::maxNameLength(const QString &path)
{
#if defined(Q_OS_UNIX)
return ::pathconf(QFile::encodeName(path).data(), _PC_NAME_MAX);
-#elif defined(Q_OS_WINCE)
+#elif defined(Q_OS_WINCE) || defined(Q_OS_WINRT)
Q_UNUSED(path);
return MAX_PATH;
#elif defined(Q_OS_WIN)
@@ -2627,9 +2627,8 @@ void QFileDialog::accept()
// special case for ".."
if (lineEditText == QLatin1String("..")) {
d->_q_navigateToParent();
- bool block = d->qFileDialogUi->fileNameEdit->blockSignals(true);
+ const QSignalBlocker blocker(d->qFileDialogUi->fileNameEdit);
d->lineEdit()->selectAll();
- d->qFileDialogUi->fileNameEdit->blockSignals(block);
return;
}
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index c06ef0c474..b08cc798e5 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -315,7 +315,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
dirIt.next();
fileInfo = dirIt.fileInfo();
allFiles.append(fileInfo.fileName());
- fetch(fileInfo, base, firstTime, updatedFiles, path);
+ fetch(fileInfo, base, firstTime, updatedFiles, path);
}
if (!allFiles.isEmpty())
emit newListOfFiles(path, allFiles);
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index fa6306005b..bda448bde3 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -1715,7 +1715,7 @@ QFileSystemModelPrivate::QFileSystemNode* QFileSystemModelPrivate::addNode(QFile
#ifndef QT_NO_FILESYSTEMWATCHER
node->populate(info);
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
//The parentNode is "" so we are listing the drives
if (parentNode->fileName.isEmpty()) {
wchar_t name[MAX_PATH + 1];
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index d908a683a9..94e96a52c5 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -632,12 +632,11 @@ void QFontDialogPrivate::updateSizes()
}
sizeList->setCurrentItem(current);
- sizeEdit->blockSignals(true);
+ const QSignalBlocker blocker(sizeEdit);
sizeEdit->setText((smoothScalable ? QString::number(size) : sizeList->currentText()));
if (q->style()->styleHint(QStyle::SH_FontDialog_SelectAssociatedText, 0, q)
&& sizeList->hasFocus())
sizeEdit->selectAll();
- sizeEdit->blockSignals(false);
} else {
sizeEdit->clear();
}
@@ -750,9 +749,8 @@ void QFontDialogPrivate::_q_sizeChanged(const QString &s)
if (sizeList->text(i).toInt() >= this->size)
break;
}
- sizeList->blockSignals(true);
+ const QSignalBlocker blocker(sizeList);
sizeList->setCurrentItem(i);
- sizeList->blockSignals(false);
}
_q_updateSample();
}
diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp
index 4eec2eb3e2..10d693b4a3 100644
--- a/src/widgets/dialogs/qinputdialog.cpp
+++ b/src/widgets/dialogs/qinputdialog.cpp
@@ -771,10 +771,11 @@ void QInputDialog::setComboBoxItems(const QStringList &items)
Q_D(QInputDialog);
d->ensureComboBox();
- d->comboBox->blockSignals(true);
- d->comboBox->clear();
- d->comboBox->addItems(items);
- d->comboBox->blockSignals(false);
+ {
+ const QSignalBlocker blocker(d->comboBox);
+ d->comboBox->clear();
+ d->comboBox->addItems(items);
+ }
if (inputMode() == TextInput)
d->chooseRightTextInputWidget();
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index ee2ef409d8..3080d5f1e8 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -73,7 +73,7 @@
QT_BEGIN_NAMESPACE
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
HMENU qt_getWindowsSystemMenu(const QWidget *w)
{
if (QWindow *window = QApplicationPrivate::windowForWidget(w))
@@ -209,7 +209,7 @@ public:
void init(const QString &title = QString(), const QString &text = QString());
void setupLayout();
void _q_buttonClicked(QAbstractButton *);
- void _q_clicked(QMessageDialogOptions::StandardButton button, QMessageDialogOptions::ButtonRole role);
+ void _q_clicked(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role);
QAbstractButton *findButton(int button0, int button1, int button2, int flags);
void addOldButtons(int button0, int button1, int button2);
@@ -524,7 +524,7 @@ void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
}
}
-void QMessageBoxPrivate::_q_clicked(QMessageDialogOptions::StandardButton button, QMessageDialogOptions::ButtonRole role)
+void QMessageBoxPrivate::_q_clicked(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role)
{
Q_UNUSED(role);
Q_Q(QMessageBox);
@@ -1620,7 +1620,7 @@ void QMessageBox::showEvent(QShowEvent *e)
QAccessibleEvent event(this, QAccessible::Alert);
QAccessible::updateAccessibility(&event);
#endif
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
if (const HMENU systemMenu = qt_getWindowsSystemMenu(this)) {
EnableMenuItem(systemMenu, SC_CLOSE, d->detectedEscapeButton ?
MF_BYCOMMAND|MF_ENABLED : MF_BYCOMMAND|MF_GRAYED);
@@ -2697,8 +2697,8 @@ QPixmap QMessageBoxPrivate::standardIcon(QMessageBox::Icon icon, QMessageBox *mb
void QMessageBoxPrivate::initHelper(QPlatformDialogHelper *h)
{
Q_Q(QMessageBox);
- QObject::connect(h, SIGNAL(clicked(QMessageDialogOptions::StandardButton, QMessageDialogOptions::ButtonRole)),
- q, SLOT(_q_clicked(QMessageDialogOptions::StandardButton, QMessageDialogOptions::ButtonRole)));
+ QObject::connect(h, SIGNAL(clicked(QPlatformDialogHelper::StandardButton, QPlatformDialogHelper::ButtonRole)),
+ q, SLOT(_q_clicked(QPlatformDialogHelper::StandardButton, QPlatformDialogHelper::ButtonRole)));
static_cast<QPlatformMessageDialogHelper *>(h)->setOptions(options);
}
@@ -2719,9 +2719,9 @@ static QMessageDialogOptions::Icon helperIcon(QMessageBox::Icon i)
return QMessageDialogOptions::NoIcon;
}
-static QMessageDialogOptions::StandardButtons helperStandardButtons(QMessageBox * q)
+static QPlatformDialogHelper::StandardButtons helperStandardButtons(QMessageBox * q)
{
- QMessageDialogOptions::StandardButtons buttons(int(q->standardButtons()));
+ QPlatformDialogHelper::StandardButtons buttons(int(q->standardButtons()));
return buttons;
}
diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h
index c5598a8f1d..5fae174fe1 100644
--- a/src/widgets/dialogs/qmessagebox.h
+++ b/src/widgets/dialogs/qmessagebox.h
@@ -72,6 +72,7 @@ class Q_WIDGETS_EXPORT QMessageBox : public QDialog
public:
enum Icon {
+ // keep this in sync with QMessageDialogOptions::Icon
NoIcon = 0,
Information = 1,
Warning = 2,
@@ -80,7 +81,7 @@ public:
};
enum ButtonRole {
- // keep this in sync with QDialogButtonBox::ButtonRole
+ // keep this in sync with QDialogButtonBox::ButtonRole and QPlatformDialogHelper::ButtonRole
InvalidRole = -1,
AcceptRole,
RejectRole,
@@ -96,7 +97,7 @@ public:
};
enum StandardButton {
- // keep this in sync with QDialogButtonBox::StandardButton and QMessageDialogOptions::StandardButton
+ // keep this in sync with QDialogButtonBox::StandardButton and QPlatformDialogHelper::StandardButton
NoButton = 0x00000000,
Ok = 0x00000400,
Save = 0x00000800,
@@ -309,7 +310,7 @@ protected:
private:
Q_PRIVATE_SLOT(d_func(), void _q_buttonClicked(QAbstractButton *))
- Q_PRIVATE_SLOT(d_func(), void _q_clicked(QMessageDialogOptions::StandardButton, QMessageDialogOptions::ButtonRole))
+ Q_PRIVATE_SLOT(d_func(), void _q_clicked(QPlatformDialogHelper::StandardButton, QPlatformDialogHelper::ButtonRole))
Q_DISABLE_COPY(QMessageBox)
Q_DECLARE_PRIVATE(QMessageBox)
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index a667f299e8..b294e98c30 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -76,6 +76,7 @@ extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp
#endif
#include <string.h> // for memset()
+#include <algorithm>
QT_BEGIN_NAMESPACE
@@ -129,22 +130,41 @@ static bool objectInheritsXAndXIsCloserThanY(const QObject *object, const QByteA
return false;
}
-const int NFallbackDefaultProperties = 7;
-
const struct {
- const char *className;
- const char *property;
- const char *changedSignal;
-} fallbackProperties[NFallbackDefaultProperties] = {
+ const char className[16];
+ const char property[13];
+} fallbackProperties[] = {
// If you modify this list, make sure to update the documentation (and the auto test)
- { "QAbstractButton", "checked", SIGNAL(toggled(bool)) },
- { "QAbstractSlider", "value", SIGNAL(valueChanged(int)) },
- { "QComboBox", "currentIndex", SIGNAL(currentIndexChanged(int)) },
- { "QDateTimeEdit", "dateTime", SIGNAL(dateTimeChanged(QDateTime)) },
- { "QLineEdit", "text", SIGNAL(textChanged(QString)) },
- { "QListWidget", "currentRow", SIGNAL(currentRowChanged(int)) },
- { "QSpinBox", "value", SIGNAL(valueChanged(int)) }
+ { "QAbstractButton", "checked" },
+ { "QAbstractSlider", "value" },
+ { "QComboBox", "currentIndex" },
+ { "QDateTimeEdit", "dateTime" },
+ { "QLineEdit", "text" },
+ { "QListWidget", "currentRow" },
+ { "QSpinBox", "value" },
};
+const size_t NFallbackDefaultProperties = sizeof fallbackProperties / sizeof *fallbackProperties;
+
+static const char *changed_signal(int which)
+{
+ // since it might expand to a runtime function call (to
+ // qFlagLocations()), we cannot store the result of SIGNAL() in a
+ // character array and expect it to be statically initialized. To
+ // avoid the relocations caused by a char pointer table, use a
+ // switch statement:
+ switch (which) {
+ case 0: return SIGNAL(toggled(bool));
+ case 1: return SIGNAL(valueChanged(int));
+ case 2: return SIGNAL(currentIndexChanged(int));
+ case 3: return SIGNAL(dateTimeChanged(QDateTime));
+ case 4: return SIGNAL(textChanged(QString));
+ case 5: return SIGNAL(currentRowChanged(int));
+ case 6: return SIGNAL(valueChanged(int));
+ };
+ Q_STATIC_ASSERT(7 == NFallbackDefaultProperties);
+ Q_UNREACHABLE();
+ return 0;
+}
class QWizardDefaultProperty
{
@@ -542,6 +562,7 @@ public:
, canContinue(false)
, canFinish(false)
, disableUpdatesCount(0)
+ , wizStyle(QWizard::ClassicStyle)
, opts(0)
, buttonsHaveCustomLayout(false)
, titleFmt(Qt::AutoText)
@@ -551,10 +572,12 @@ public:
, headerWidget(0)
, watermarkLabel(0)
, sideWidget(0)
+ , pageFrame(0)
, titleLabel(0)
, subTitleLabel(0)
, bottomRuler(0)
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
+ , vistaHelper(0)
, vistaInitPending(false)
, vistaState(QVistaHelper::Dirty)
, vistaStateChanged(false)
@@ -565,8 +588,7 @@ public:
, maximumWidth(QWIDGETSIZE_MAX)
, maximumHeight(QWIDGETSIZE_MAX)
{
- for (int i = 0; i < QWizard::NButtons; ++i)
- btns[i] = 0;
+ std::fill(btns, btns + QWizard::NButtons, static_cast<QAbstractButton *>(0));
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
@@ -737,10 +759,10 @@ void QWizardPrivate::init()
updateButtonLayout();
- for (int i = 0; i < NFallbackDefaultProperties; ++i)
+ for (uint i = 0; i < NFallbackDefaultProperties; ++i)
defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className,
fallbackProperties[i].property,
- fallbackProperties[i].changedSignal));
+ changed_signal(i)));
}
void QWizardPrivate::reset()
@@ -887,9 +909,28 @@ void QWizardPrivate::switchToPage(int newId, Direction direction)
}
// keep in sync with QWizard::WizardButton
-static const char * const buttonSlots[QWizard::NStandardButtons] = {
- SLOT(back()), SLOT(next()), SLOT(next()), SLOT(accept()), SLOT(reject()),
- SIGNAL(helpRequested())
+static const char * buttonSlots(QWizard::WizardButton which)
+{
+ switch (which) {
+ case QWizard::BackButton:
+ return SLOT(back());
+ case QWizard::NextButton:
+ case QWizard::CommitButton:
+ return SLOT(next());
+ case QWizard::FinishButton:
+ return SLOT(accept());
+ case QWizard::CancelButton:
+ return SLOT(reject());
+ case QWizard::HelpButton:
+ return SIGNAL(helpRequested());
+ case QWizard::CustomButton1:
+ case QWizard::CustomButton2:
+ case QWizard::CustomButton3:
+ case QWizard::Stretch:
+ case QWizard::NoButton:
+ Q_UNREACHABLE();
+ };
+ return 0;
};
QWizardLayoutInfo QWizardPrivate::layoutInfoForCurrentPage()
@@ -1405,7 +1446,7 @@ void QWizardPrivate::connectButton(QWizard::WizardButton which) const
{
Q_Q(const QWizard);
if (which < QWizard::NStandardButtons) {
- QObject::connect(btns[which], SIGNAL(clicked()), q, buttonSlots[which]);
+ QObject::connect(btns[which], SIGNAL(clicked()), q, buttonSlots(which));
} else {
QObject::connect(btns[which], SIGNAL(clicked()), q, SLOT(_q_emitCustomButtonClicked()));
}
@@ -1424,6 +1465,11 @@ void QWizardPrivate::updateButtonTexts()
btns[i]->setText(buttonDefaultText(wizStyle, i, this));
}
}
+ // Vista: Add shortcut for 'next'. Note: native dialogs use ALT-Right
+ // even in RTL mode, so do the same, even if it might be counter-intuitive.
+ // The shortcut for 'back' is set in class QVistaBackButton.
+ if (btns[QWizard::NextButton])
+ btns[QWizard::NextButton]->setShortcut(isVistaThemeEnabled() ? QKeySequence(Qt::ALT | Qt::Key_Right) : QKeySequence());
}
void QWizardPrivate::updateButtonLayout()
@@ -1576,7 +1622,7 @@ bool QWizardPrivate::handleAeroStyleChange()
if (isWindow)
vistaHelper->setTitleBarIconAndCaptionVisible(false);
QObject::connect(
- vistaHelper->backButton(), SIGNAL(clicked()), q, buttonSlots[QWizard::BackButton]);
+ vistaHelper->backButton(), SIGNAL(clicked()), q, buttonSlots(QWizard::BackButton));
vistaHelper->backButton()->show();
} else {
q->setMouseTracking(true); // ### original value possibly different
@@ -1666,6 +1712,10 @@ void QWizardPrivate::_q_updateButtonStates()
btn.finish->setVisible(buttonLayoutContains(QWizard::FinishButton)
&& (canFinish || (opts & QWizard::HaveFinishButtonOnEarlyPages)));
+ if (!(opts & QWizard::NoCancelButton))
+ btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton)
+ && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage)));
+
bool useDefault = !(opts & QWizard::NoDefaultButton);
if (QPushButton *nextPush = qobject_cast<QPushButton *>(btn.next))
nextPush->setDefault(canContinue && useDefault && !commitPage);
@@ -2150,6 +2200,7 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
\value HaveCustomButton1 Show the first user-defined button (CustomButton1).
\value HaveCustomButton2 Show the second user-defined button (CustomButton2).
\value HaveCustomButton3 Show the third user-defined button (CustomButton3).
+ \value NoCancelButtonOnLastPage Don't show the \uicontrol Cancel button on the last page.
\sa setOptions(), setOption(), testOption()
*/
@@ -2604,7 +2655,7 @@ void QWizard::setOptions(WizardOptions options)
d->updateButtonLayout();
} else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPage
| HaveNextButtonOnLastPage | HaveFinishButtonOnEarlyPages
- | DisabledBackButtonOnLastPage)) {
+ | DisabledBackButtonOnLastPage | NoCancelButtonOnLastPage)) {
d->_q_updateButtonStates();
}
diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h
index 9dea9a8e6f..51b18e0e8f 100644
--- a/src/widgets/dialogs/qwizard.h
+++ b/src/widgets/dialogs/qwizard.h
@@ -115,7 +115,8 @@ public:
HelpButtonOnRight = 0x00001000,
HaveCustomButton1 = 0x00002000,
HaveCustomButton2 = 0x00004000,
- HaveCustomButton3 = 0x00008000
+ HaveCustomButton3 = 0x00008000,
+ NoCancelButtonOnLastPage = 0x00010000
};
Q_DECLARE_FLAGS(WizardOptions, WizardOption)
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index b57614c018..747115984d 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -117,16 +117,16 @@ enum WIZ_WINDOWTHEMEATTRIBUTETYPE {
#define WIZ_DT_NOPREFIX 0x00000800
enum WIZ_NAVIGATIONPARTS { //NAVIGATIONPARTS
- WIZ_NAV_BACKBUTTON = 1,
- WIZ_NAV_FORWARDBUTTON = 2,
- WIZ_NAV_MENUBUTTON = 3,
+ WIZ_NAV_BACKBUTTON = 1,
+ WIZ_NAV_FORWARDBUTTON = 2,
+ WIZ_NAV_MENUBUTTON = 3,
};
enum WIZ_NAV_BACKBUTTONSTATES { //NAV_BACKBUTTONSTATES
- WIZ_NAV_BB_NORMAL = 1,
- WIZ_NAV_BB_HOT = 2,
- WIZ_NAV_BB_PRESSED = 3,
- WIZ_NAV_BB_DISABLED = 4,
+ WIZ_NAV_BB_NORMAL = 1,
+ WIZ_NAV_BB_HOT = 2,
+ WIZ_NAV_BB_PRESSED = 3,
+ WIZ_NAV_BB_DISABLED = 4,
};
#define WIZ_TMT_CAPTIONFONT (801) //TMT_CAPTIONFONT
@@ -183,6 +183,8 @@ QVistaBackButton::QVistaBackButton(QWidget *widget)
: QAbstractButton(widget)
{
setFocusPolicy(Qt::NoFocus);
+ // Native dialogs use ALT-Left even in RTL mode, so do the same, even if it might be counter-intuitive.
+ setShortcut(QKeySequence(Qt::ALT | Qt::Key_Left));
}
QSize QVistaBackButton::sizeHint() const
@@ -278,8 +280,6 @@ QVistaHelper::~QVistaHelper()
void QVistaHelper::updateCustomMargins(bool vistaMargins)
{
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8)
- return; // Negative margins are not supported on Windows 8.
if (QWindow *window = wizard->windowHandle()) {
// Reduce top frame to zero since we paint it ourselves.
const QMargins customMargins = vistaMargins ?
@@ -768,6 +768,33 @@ bool QVistaHelper::drawBlackRect(const QRect &rect, HDC hdc)
return value;
}
+#if !defined(_MSC_VER) || _MSC_VER < 1700
+static inline int getWindowBottomMargin()
+{
+ return GetSystemMetrics(SM_CYSIZEFRAME);
+}
+#else // !_MSC_VER || _MSC_VER < 1700
+// QTBUG-36192, GetSystemMetrics(SM_CYSIZEFRAME) returns bogus values
+// for MSVC2012 which leads to the custom margin having no effect since
+// that only works when removing the entire margin.
+static inline int getWindowBottomMargin()
+{
+ RECT rect = {0, 0, 0, 0};
+ AdjustWindowRectEx(&rect, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_THICKFRAME | WS_DLGFRAME, FALSE, 0);
+ return qAbs(rect.bottom);
+}
+#endif // _MSC_VER >= 1700
+
+int QVistaHelper::frameSize()
+{
+ return getWindowBottomMargin();
+}
+
+int QVistaHelper::captionSize()
+{
+ return GetSystemMetrics(SM_CYCAPTION);
+}
+
bool QVistaHelper::resolveSymbols()
{
static bool tried = false;
@@ -826,10 +853,7 @@ int QVistaHelper::topOffset()
static const int aeroOffset =
QSysInfo::WindowsVersion == QSysInfo::WV_WINDOWS7 ?
QStyleHelper::dpiScaled(4) : QStyleHelper::dpiScaled(13);
- int result = aeroOffset;
- if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8)
- result += titleBarSize();
- return result;
+ return aeroOffset + titleBarSize();
}
QT_END_NAMESPACE
diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h
index a7713d889b..81514a8950 100644
--- a/src/widgets/dialogs/qwizard_win_p.h
+++ b/src/widgets/dialogs/qwizard_win_p.h
@@ -117,8 +117,8 @@ private:
bool drawTitleText(QPainter *painter, const QString &text, const QRect &rect, HDC hdc);
static bool drawBlackRect(const QRect &rect, HDC hdc);
- static int frameSize() { return GetSystemMetrics(SM_CYSIZEFRAME); }
- static int captionSize() { return GetSystemMetrics(SM_CYCAPTION); }
+ static int frameSize();
+ static int captionSize();
static int backButtonSize() { return int(QStyleHelper::dpiScaled(30)); }
static int iconSize() { return 16; } // Standard Aero
diff --git a/src/widgets/doc/snippets/code/doc_src_layout.cpp b/src/widgets/doc/snippets/code/doc_src_layout.cpp
index 6bad8558c1..5ea8ce5a5f 100644
--- a/src/widgets/doc/snippets/code/doc_src_layout.cpp
+++ b/src/widgets/doc/snippets/code/doc_src_layout.cpp
@@ -75,7 +75,7 @@ private:
//! [2]
int CardLayout::count() const
{
- // QList::size() returns the number of QLayoutItems in the list
+ // QList::size() returns the number of QLayoutItems in the list
return list.size();
}
//! [2]
diff --git a/src/widgets/doc/snippets/customstyle/customstyle.cpp b/src/widgets/doc/snippets/customstyle/customstyle.cpp
index 9d00745e6a..b5d44ebecd 100644
--- a/src/widgets/doc/snippets/customstyle/customstyle.cpp
+++ b/src/widgets/doc/snippets/customstyle/customstyle.cpp
@@ -57,32 +57,32 @@ void CustomStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *op
QPainter *painter, const QWidget *widget) const
{
if (element == PE_IndicatorSpinUp || element == PE_IndicatorSpinDown) {
- QPolygon points(3);
- int x = option->rect.x();
- int y = option->rect.y();
- int w = option->rect.width() / 2;
- int h = option->rect.height() / 2;
- x += (option->rect.width() - w) / 2;
- y += (option->rect.height() - h) / 2;
+ QPolygon points(3);
+ int x = option->rect.x();
+ int y = option->rect.y();
+ int w = option->rect.width() / 2;
+ int h = option->rect.height() / 2;
+ x += (option->rect.width() - w) / 2;
+ y += (option->rect.height() - h) / 2;
- if (element == PE_IndicatorSpinUp) {
- points[0] = QPoint(x, y + h);
- points[1] = QPoint(x + w, y + h);
- points[2] = QPoint(x + w / 2, y);
- } else { // PE_SpinBoxDown
- points[0] = QPoint(x, y);
- points[1] = QPoint(x + w, y);
- points[2] = QPoint(x + w / 2, y + h);
- }
+ if (element == PE_IndicatorSpinUp) {
+ points[0] = QPoint(x, y + h);
+ points[1] = QPoint(x + w, y + h);
+ points[2] = QPoint(x + w / 2, y);
+ } else { // PE_SpinBoxDown
+ points[0] = QPoint(x, y);
+ points[1] = QPoint(x + w, y);
+ points[2] = QPoint(x + w / 2, y + h);
+ }
- if (option->state & State_Enabled) {
- painter->setPen(option->palette.mid().color());
- painter->setBrush(option->palette.buttonText());
- } else {
- painter->setPen(option->palette.buttonText().color());
- painter->setBrush(option->palette.mid());
- }
- painter->drawPolygon(points);
+ if (option->state & State_Enabled) {
+ painter->setPen(option->palette.mid().color());
+ painter->setBrush(option->palette.buttonText());
+ } else {
+ painter->setPen(option->palette.buttonText().color());
+ painter->setBrush(option->palette.mid());
+ }
+ painter->drawPolygon(points);
} else {
QProxyStyle::drawPrimitive(element, option, painter, widget);
//! [2] //! [3]
diff --git a/src/widgets/doc/snippets/mainwindowsnippet.cpp b/src/widgets/doc/snippets/mainwindowsnippet.cpp
index a9a9012d46..e27e00e848 100644
--- a/src/widgets/doc/snippets/mainwindowsnippet.cpp
+++ b/src/widgets/doc/snippets/mainwindowsnippet.cpp
@@ -85,7 +85,7 @@ void MainWindow::createDockWidgets()
//! [0]
QDockWidget *dockWidget = new QDockWidget(tr("Dock Widget"), this);
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea |
- Qt::RightDockWidgetArea);
+ Qt::RightDockWidgetArea);
dockWidget->setWidget(dockWidgetContents);
addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
//! [0]
diff --git a/src/widgets/doc/snippets/mdiareasnippets.cpp b/src/widgets/doc/snippets/mdiareasnippets.cpp
index 42902b4cd7..9c0b693e80 100644
--- a/src/widgets/doc/snippets/mdiareasnippets.cpp
+++ b/src/widgets/doc/snippets/mdiareasnippets.cpp
@@ -66,7 +66,7 @@ void addingSubWindowsExample()
mdiArea.addSubWindow(subWindow1);
QMdiSubWindow *subWindow2 =
- mdiArea.addSubWindow(internalWidget2);
+ mdiArea.addSubWindow(internalWidget2);
//! [1]
subWindow1->show();
diff --git a/src/widgets/doc/snippets/textdocument-imagedrop/textedit.cpp b/src/widgets/doc/snippets/textdocument-imagedrop/textedit.cpp
index 619333d98e..b11abbe604 100644
--- a/src/widgets/doc/snippets/textdocument-imagedrop/textedit.cpp
+++ b/src/widgets/doc/snippets/textdocument-imagedrop/textedit.cpp
@@ -42,7 +42,7 @@
#include <QtGui>
TextEdit::TextEdit(QWidget *parent)
- : QTextEdit(parent)
+ : QTextEdit(parent)
{
}
diff --git a/src/widgets/doc/snippets/timeline/main.cpp b/src/widgets/doc/snippets/timeline/main.cpp
index 9e4d218a88..8c74ee0615 100644
--- a/src/widgets/doc/snippets/timeline/main.cpp
+++ b/src/widgets/doc/snippets/timeline/main.cpp
@@ -56,7 +56,7 @@ int main(int argv, char *args[])
animation->setTimeLine(timer);
for (int i = 0; i < 200; ++i)
- animation->setPosAt(i / 200.0, QPointF(i, i));
+ animation->setPosAt(i / 200.0, QPointF(i, i));
QGraphicsScene *scene = new QGraphicsScene();
scene->setSceneRect(0, 0, 250, 250);
diff --git a/src/widgets/graphicsview/graphicsview.pri b/src/widgets/graphicsview/graphicsview.pri
index a0fc4bc8d3..b81f736ef4 100644
--- a/src/widgets/graphicsview/graphicsview.pri
+++ b/src/widgets/graphicsview/graphicsview.pri
@@ -23,7 +23,8 @@ HEADERS += graphicsview/qgraphicsgridlayout.h \
graphicsview/qgraphicsview_p.h \
graphicsview/qgraphicswidget.h \
graphicsview/qgraphicswidget_p.h \
- graphicsview/qgridlayoutengine_p.h \
+ graphicsview/qgraphicslayoutstyleinfo_p.h \
+ graphicsview/qgraphicsgridlayoutengine_p.h \
graphicsview/qgraph_p.h \
graphicsview/qsimplex_p.h \
graphicsview/qgraphicsanchorlayout_p.h \
@@ -47,7 +48,8 @@ SOURCES += graphicsview/qgraphicsgridlayout.cpp \
graphicsview/qgraphicsview.cpp \
graphicsview/qgraphicswidget.cpp \
graphicsview/qgraphicswidget_p.cpp \
- graphicsview/qgridlayoutengine.cpp \
+ graphicsview/qgraphicslayoutstyleinfo.cpp \
+ graphicsview/qgraphicsgridlayoutengine.cpp \
graphicsview/qsimplex_p.cpp \
graphicsview/qgraphicsanchorlayout_p.cpp \
graphicsview/qgraphicsanchorlayout.cpp
diff --git a/src/widgets/graphicsview/qgraphicsgridlayout.cpp b/src/widgets/graphicsview/qgraphicsgridlayout.cpp
index 6d9dd98839..0ecb4af6bd 100644
--- a/src/widgets/graphicsview/qgraphicsgridlayout.cpp
+++ b/src/widgets/graphicsview/qgraphicsgridlayout.cpp
@@ -89,30 +89,35 @@
#include "qgraphicslayoutitem.h"
#include "qgraphicsgridlayout.h"
#include "qgraphicswidget.h"
-#include "qgridlayoutengine_p.h"
-#include <QtCore/qdebug.h>
+#include "qgraphicsgridlayoutengine_p.h"
+#include "qgraphicslayoutstyleinfo_p.h"
+#ifdef QT_DEBUG
+# include <QtCore/qdebug.h>
+#endif
QT_BEGIN_NAMESPACE
class QGraphicsGridLayoutPrivate : public QGraphicsLayoutPrivate
{
public:
- QGraphicsGridLayoutPrivate() { }
- QLayoutStyleInfo styleInfo() const;
+ QGraphicsGridLayoutPrivate(): m_styleInfo(0) { }
+ QGraphicsLayoutStyleInfo *styleInfo() const;
- QGridLayoutEngine engine;
-#ifdef QT_DEBUG
+ mutable QGraphicsLayoutStyleInfo *m_styleInfo;
+ QGraphicsGridLayoutEngine engine;
+
+#ifdef QGRIDLAYOUTENGINE_DEBUG
void dump(int indent) const;
#endif
};
-Q_GLOBAL_STATIC(QWidget, globalStyleInfoWidget);
-QLayoutStyleInfo QGraphicsGridLayoutPrivate::styleInfo() const
+QGraphicsLayoutStyleInfo *QGraphicsGridLayoutPrivate::styleInfo() const
{
- QGraphicsItem *item = parentItem();
- QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style();
- return QLayoutStyleInfo(style, globalStyleInfoWidget());
+ if (!m_styleInfo)
+ m_styleInfo = new QGraphicsLayoutStyleInfo(this);
+ m_styleInfo->updateChanged(QAbstractLayoutStyleInfo::Unknown);
+ return m_styleInfo;
}
/*!
@@ -172,7 +177,8 @@ void QGraphicsGridLayout::addItem(QGraphicsLayoutItem *item, int row, int column
d->addChildLayoutItem(item);
- new QGridLayoutItem(&d->engine, item, row, column, rowSpan, columnSpan, alignment);
+ QGraphicsGridLayoutEngineItem *gridEngineItem = new QGraphicsGridLayoutEngineItem(item, row, column, rowSpan, columnSpan, alignment);
+ d->engine.insertItem(gridEngineItem, -1);
invalidate();
}
@@ -199,7 +205,7 @@ void QGraphicsGridLayout::setHorizontalSpacing(qreal spacing)
qreal QGraphicsGridLayout::horizontalSpacing() const
{
Q_D(const QGraphicsGridLayout);
- return d->engine.spacing(d->styleInfo(), Qt::Horizontal);
+ return d->engine.spacing(Qt::Horizontal, d->styleInfo());
}
/*!
@@ -218,7 +224,7 @@ void QGraphicsGridLayout::setVerticalSpacing(qreal spacing)
qreal QGraphicsGridLayout::verticalSpacing() const
{
Q_D(const QGraphicsGridLayout);
- return d->engine.spacing(d->styleInfo(), Qt::Vertical);
+ return d->engine.spacing(Qt::Vertical, d->styleInfo());
}
/*!
@@ -535,8 +541,8 @@ QGraphicsLayoutItem *QGraphicsGridLayout::itemAt(int row, int column) const
qWarning("QGraphicsGridLayout::itemAt: invalid row, column %d, %d", row, column);
return 0;
}
- if (QGridLayoutItem *item = d->engine.itemAt(row, column))
- return item->layoutItem();
+ if (QGraphicsGridLayoutEngineItem *engineItem = static_cast<QGraphicsGridLayoutEngineItem*>(d->engine.itemAt(row, column)))
+ return engineItem->layoutItem();
return 0;
}
@@ -561,8 +567,8 @@ QGraphicsLayoutItem *QGraphicsGridLayout::itemAt(int index) const
return 0;
}
QGraphicsLayoutItem *item = 0;
- if (QGridLayoutItem *gridItem = d->engine.itemAt(index))
- item = gridItem->layoutItem();
+ if (QGraphicsGridLayoutEngineItem *engineItem = static_cast<QGraphicsGridLayoutEngineItem*>(d->engine.itemAt(index)))
+ item = engineItem->layoutItem();
return item;
}
@@ -579,7 +585,8 @@ void QGraphicsGridLayout::removeAt(int index)
qWarning("QGraphicsGridLayout::removeAt: invalid index %d", index);
return;
}
- if (QGridLayoutItem *gridItem = d->engine.itemAt(index)) {
+
+ if (QGraphicsGridLayoutEngineItem *gridItem = static_cast<QGraphicsGridLayoutEngineItem*>(d->engine.itemAt(index))) {
if (QGraphicsLayoutItem *layoutItem = gridItem->layoutItem())
layoutItem->setParentLayoutItem(0);
d->engine.removeItem(gridItem);
@@ -619,10 +626,12 @@ void QGraphicsGridLayout::invalidate()
{
Q_D(QGraphicsGridLayout);
d->engine.invalidate();
+ if (d->m_styleInfo)
+ d->m_styleInfo->invalidate();
QGraphicsLayout::invalidate();
}
-#ifdef QT_DEBUG
+#ifdef QGRIDLAYOUTENGINE_DEBUG
void QGraphicsGridLayoutPrivate::dump(int indent) const
{
if (qt_graphicsLayoutDebug()) {
@@ -646,8 +655,8 @@ void QGraphicsGridLayout::setGeometry(const QRectF &rect)
if (visualDir == Qt::RightToLeft)
qSwap(left, right);
effectiveRect.adjust(+left, +top, -right, -bottom);
- d->engine.setGeometries(d->styleInfo(), effectiveRect);
-#ifdef QT_DEBUG
+ d->engine.setGeometries(effectiveRect, d->styleInfo());
+#ifdef QGRIDLAYOUTENGINE_DEBUG
if (qt_graphicsLayoutDebug()) {
static int counter = 0;
qDebug("==== BEGIN DUMP OF QGraphicsGridLayout (%d)====", counter++);
@@ -666,7 +675,7 @@ QSizeF QGraphicsGridLayout::sizeHint(Qt::SizeHint which, const QSizeF &constrain
qreal left, top, right, bottom;
getContentsMargins(&left, &top, &right, &bottom);
const QSizeF extraMargins(left + right, top + bottom);
- return d->engine.sizeHint(d->styleInfo(), which , constraint - extraMargins) + extraMargins;
+ return d->engine.sizeHint(which , constraint - extraMargins, d->styleInfo()) + extraMargins;
}
diff --git a/src/widgets/graphicsview/qgraphicsgridlayoutengine.cpp b/src/widgets/graphicsview/qgraphicsgridlayoutengine.cpp
new file mode 100644
index 0000000000..605411bd6d
--- /dev/null
+++ b/src/widgets/graphicsview/qgraphicsgridlayoutengine.cpp
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWidgets module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qgraphicsgridlayoutengine_p.h"
+
+#ifndef QT_NO_GRAPHICSVIEW
+
+#include "qgraphicslayoutitem_p.h"
+#include "qgraphicslayout_p.h"
+#include "qgraphicswidget.h"
+
+QT_BEGIN_NAMESPACE
+
+/*
+ returns \c true if the size policy returns \c true for either hasHeightForWidth()
+ or hasWidthForHeight()
+ */
+bool QGraphicsGridLayoutEngineItem::hasDynamicConstraint() const
+{
+ return QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasHeightForWidth()
+ || QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasWidthForHeight();
+}
+
+Qt::Orientation QGraphicsGridLayoutEngineItem::dynamicConstraintOrientation() const
+{
+ if (QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasHeightForWidth())
+ return Qt::Vertical;
+ else //if (QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasWidthForHeight())
+ return Qt::Horizontal;
+}
+
+
+void QGraphicsGridLayoutEngine::setAlignment(QGraphicsLayoutItem *graphicsLayoutItem, Qt::Alignment alignment)
+{
+ if (QGraphicsGridLayoutEngineItem *gridEngineItem = findLayoutItem(graphicsLayoutItem)) {
+ gridEngineItem->setAlignment(alignment);
+ invalidate();
+ }
+}
+
+Qt::Alignment QGraphicsGridLayoutEngine::alignment(QGraphicsLayoutItem *graphicsLayoutItem) const
+{
+ if (QGraphicsGridLayoutEngineItem *gridEngineItem = findLayoutItem(graphicsLayoutItem))
+ return gridEngineItem->alignment();
+ return 0;
+}
+
+
+void QGraphicsGridLayoutEngine::setStretchFactor(QGraphicsLayoutItem *layoutItem, int stretch,
+ Qt::Orientation orientation)
+{
+ Q_ASSERT(stretch >= 0);
+
+ if (QGraphicsGridLayoutEngineItem *item = findLayoutItem(layoutItem))
+ item->setStretchFactor(stretch, orientation);
+}
+
+int QGraphicsGridLayoutEngine::stretchFactor(QGraphicsLayoutItem *layoutItem, Qt::Orientation orientation) const
+{
+ if (QGraphicsGridLayoutEngineItem *item = findLayoutItem(layoutItem))
+ return item->stretchFactor(orientation);
+ return 0;
+}
+
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_GRAPHICSVIEW
diff --git a/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h b/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
new file mode 100644
index 0000000000..1338114d96
--- /dev/null
+++ b/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWidgets module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGRAPHICSGRIDLAYOUTENGINE_P_H
+#define QGRAPHICSGRIDLAYOUTENGINE_P_H
+
+#include <QtGui/private/qgridlayoutengine_p.h>
+
+#ifndef QT_NO_GRAPHICSVIEW
+
+#include <QtWidgets/qsizepolicy.h>
+#include <QtWidgets/qstyle.h>
+#include <QtWidgets/qstyleoption.h>
+#include "qgraphicslayoutitem.h"
+
+QT_BEGIN_NAMESPACE
+
+class QGraphicsLayoutPrivate;
+
+class QGraphicsGridLayoutEngineItem : public QGridLayoutItem {
+public:
+ QGraphicsGridLayoutEngineItem(QGraphicsLayoutItem *item, int row, int columns, int rowSpan = 1, int columnSpan = 1,
+ Qt::Alignment alignment = 0)
+ : QGridLayoutItem(row, columns, rowSpan, columnSpan, alignment), q_layoutItem(item) {}
+
+ virtual QLayoutPolicy::Policy sizePolicy(Qt::Orientation orientation) const Q_DECL_OVERRIDE
+ {
+ QSizePolicy sizePolicy(q_layoutItem->sizePolicy());
+ return (QLayoutPolicy::Policy)((orientation == Qt::Horizontal) ? sizePolicy.horizontalPolicy()
+ : sizePolicy.verticalPolicy());
+ }
+
+ virtual QLayoutPolicy::ControlTypes controlTypes(LayoutSide) const Q_DECL_OVERRIDE
+ {
+ const QSizePolicy::ControlType ct = q_layoutItem->sizePolicy().controlType();
+ return (QLayoutPolicy::ControlTypes)ct;
+ }
+
+ virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const Q_DECL_OVERRIDE
+ {
+ return q_layoutItem->effectiveSizeHint(which, constraint);
+ }
+
+ virtual void setGeometry(const QRectF &rect) Q_DECL_OVERRIDE
+ {
+ q_layoutItem->setGeometry(rect);
+ }
+
+ virtual bool hasDynamicConstraint() const Q_DECL_OVERRIDE;
+ virtual Qt::Orientation dynamicConstraintOrientation() const Q_DECL_OVERRIDE;
+
+ QGraphicsLayoutItem *layoutItem() const { return q_layoutItem; }
+
+protected:
+ QGraphicsLayoutItem *q_layoutItem;
+};
+
+
+class QGraphicsGridLayoutEngine : public QGridLayoutEngine
+{
+public:
+ QGraphicsGridLayoutEngineItem *findLayoutItem(QGraphicsLayoutItem *layoutItem) const
+ {
+ const int index = indexOf(layoutItem);
+ if (index < 0)
+ return 0;
+ return static_cast<QGraphicsGridLayoutEngineItem*>(q_items.at(index));
+ }
+
+ int indexOf(QGraphicsLayoutItem *item) const
+ {
+ for (int i = 0; i < q_items.count(); ++i) {
+ if (item == static_cast<QGraphicsGridLayoutEngineItem*>(q_items.at(i))->layoutItem())
+ return i;
+ }
+ return -1;
+ }
+
+ void setAlignment(QGraphicsLayoutItem *graphicsLayoutItem, Qt::Alignment alignment);
+ Qt::Alignment alignment(QGraphicsLayoutItem *graphicsLayoutItem) const;
+
+ void setStretchFactor(QGraphicsLayoutItem *layoutItem, int stretch, Qt::Orientation orientation);
+ int stretchFactor(QGraphicsLayoutItem *layoutItem, Qt::Orientation orientation) const;
+
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_GRAPHICSVIEW
+
+#endif // QGRAPHICSGRIDLAYOUTENGINE_P_H
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index 2d07e545c8..ae2423400a 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -10316,7 +10316,7 @@ QVariant QGraphicsTextItem::inputMethodQuery(Qt::InputMethodQuery query) const
if (query == Qt::ImHints)
v = int(inputMethodHints());
else if (dd->control)
- v = dd->control->inputMethodQuery(query);
+ v = dd->control->inputMethodQuery(query, QVariant());
if (v.type() == QVariant::RectF)
v = v.toRectF().translated(-dd->controlOffset());
else if (v.type() == QVariant::PointF)
diff --git a/src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp b/src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp
new file mode 100644
index 0000000000..d60fd6059e
--- /dev/null
+++ b/src/widgets/graphicsview/qgraphicslayoutstyleinfo.cpp
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWidgets module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qgraphicslayoutstyleinfo_p.h"
+
+#ifndef QT_NO_GRAPHICSVIEW
+
+#include "qgraphicslayout_p.h"
+#include "qgraphicswidget.h"
+#include <QtWidgets/qstyle.h>
+#include <QtWidgets/qwidget.h>
+#include <QtWidgets/qapplication.h>
+
+QT_BEGIN_NAMESPACE
+
+QGraphicsLayoutStyleInfo::QGraphicsLayoutStyleInfo(const QGraphicsLayoutPrivate *layout)
+ : m_layout(layout), m_style(0)
+{
+ m_widget = new QWidget; // pixelMetric might need a widget ptr
+ if (m_widget)
+ m_styleOption.initFrom(m_widget);
+ m_isWindow = m_styleOption.state & QStyle::State_Window;
+}
+
+QGraphicsLayoutStyleInfo::~QGraphicsLayoutStyleInfo()
+{
+ delete m_widget;
+}
+
+qreal QGraphicsLayoutStyleInfo::combinedLayoutSpacing(QLayoutPolicy::ControlTypes controls1,
+ QLayoutPolicy::ControlTypes controls2,
+ Qt::Orientation orientation) const
+{
+ Q_ASSERT(style());
+ return style()->combinedLayoutSpacing(QSizePolicy::ControlTypes(int(controls1)), QSizePolicy::ControlTypes(int(controls2)),
+ orientation, const_cast<QStyleOption*>(&m_styleOption), widget());
+}
+
+qreal QGraphicsLayoutStyleInfo::perItemSpacing(QLayoutPolicy::ControlType control1,
+ QLayoutPolicy::ControlType control2,
+ Qt::Orientation orientation) const
+{
+ Q_ASSERT(style());
+ return style()->layoutSpacing(QSizePolicy::ControlType(control1), QSizePolicy::ControlType(control2),
+ orientation, const_cast<QStyleOption*>(&m_styleOption), widget());
+}
+
+qreal QGraphicsLayoutStyleInfo::spacing(Qt::Orientation orientation) const
+{
+ Q_ASSERT(style());
+ return style()->pixelMetric(orientation == Qt::Horizontal ? QStyle::PM_LayoutHorizontalSpacing : QStyle::PM_LayoutVerticalSpacing);
+}
+
+qreal QGraphicsLayoutStyleInfo::windowMargin(Qt::Orientation orientation) const
+{
+ return style()->pixelMetric(orientation == Qt::Vertical
+ ? QStyle::PM_LayoutBottomMargin
+ : QStyle::PM_LayoutRightMargin,
+ const_cast<QStyleOption*>(&m_styleOption), widget());
+}
+
+QWidget *QGraphicsLayoutStyleInfo::widget() const { return m_widget; }
+
+QStyle *QGraphicsLayoutStyleInfo::style() const
+{
+ if (!m_style) {
+ Q_ASSERT(m_layout);
+ QGraphicsItem *item = m_layout->parentItem();
+ m_style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style();
+ }
+ return m_style;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_GRAPHICSVIEW
diff --git a/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h b/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
new file mode 100644
index 0000000000..275ebab6a1
--- /dev/null
+++ b/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWidgets module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QGRAPHICSLAYOUTSTYLEINFO_P_H
+#define QGRAPHICSLAYOUTSTYLEINFO_P_H
+
+#include <QtGui/private/qabstractlayoutstyleinfo_p.h>
+#include <QtWidgets/qstyleoption.h>
+
+QT_BEGIN_NAMESPACE
+
+class QStyle;
+class QWidget;
+class QGraphicsLayoutPrivate;
+
+class QGraphicsLayoutStyleInfo : public QAbstractLayoutStyleInfo
+{
+public:
+ QGraphicsLayoutStyleInfo(const QGraphicsLayoutPrivate *layout);
+ ~QGraphicsLayoutStyleInfo();
+
+ virtual qreal combinedLayoutSpacing(QLayoutPolicy::ControlTypes controls1,
+ QLayoutPolicy::ControlTypes controls2,
+ Qt::Orientation orientation) const Q_DECL_OVERRIDE;
+
+ virtual qreal perItemSpacing(QLayoutPolicy::ControlType control1,
+ QLayoutPolicy::ControlType control2,
+ Qt::Orientation orientation) const Q_DECL_OVERRIDE;
+
+ virtual qreal spacing(Qt::Orientation orientation) const Q_DECL_OVERRIDE;
+
+ virtual qreal windowMargin(Qt::Orientation orientation) const Q_DECL_OVERRIDE;
+
+ virtual void invalidate() Q_DECL_OVERRIDE
+ {
+ m_style = 0;
+ QAbstractLayoutStyleInfo::invalidate();
+ }
+
+ virtual bool hasChangedCore() const Q_DECL_OVERRIDE
+ {
+ QStyle *s = m_style;
+ // Note that style() will change m_style
+ return s != style();
+ }
+
+ QWidget *widget() const;
+ QStyle *style() const;
+
+private:
+ const QGraphicsLayoutPrivate *m_layout;
+ mutable QStyle *m_style;
+ QStyleOption m_styleOption;
+ QWidget *m_widget;
+};
+
+QT_END_NAMESPACE
+
+#endif // QGRAPHICSLAYOUTSTYLEINFO_P_H \ No newline at end of file
diff --git a/src/widgets/graphicsview/qgraphicslinearlayout.cpp b/src/widgets/graphicsview/qgraphicslinearlayout.cpp
index 00076502ea..294905b986 100644
--- a/src/widgets/graphicsview/qgraphicslinearlayout.cpp
+++ b/src/widgets/graphicsview/qgraphicslinearlayout.cpp
@@ -63,9 +63,9 @@
layout. The layout takes ownership of the items. In some cases when the layout
item also inherits from QGraphicsItem (such as QGraphicsWidget) there will be a
ambiguity in ownership because the layout item belongs to two ownership hierarchies.
- See the documentation of QGraphicsLayoutItem::setOwnedByLayout() how to handle
- this.
- You can access each item in the layout by calling count() and itemAt(). Calling
+ See the documentation of QGraphicsLayoutItem::setOwnedByLayout() how to handle
+ this.
+ You can access each item in the layout by calling count() and itemAt(). Calling
removeAt() or removeItem() will remove an item from the layout, without
destroying it.
@@ -122,7 +122,8 @@
#include "qgraphicslayoutitem.h"
#include "qgraphicslinearlayout.h"
#include "qgraphicswidget.h"
-#include "qgridlayoutengine_p.h"
+#include "qgraphicsgridlayoutengine_p.h"
+#include "qgraphicslayoutstyleinfo_p.h"
#ifdef QT_DEBUG
#include <QtCore/qdebug.h>
#endif
@@ -132,16 +133,20 @@ QT_BEGIN_NAMESPACE
class QGraphicsLinearLayoutPrivate : public QGraphicsLayoutPrivate
{
public:
- QGraphicsLinearLayoutPrivate(Qt::Orientation orientation) : orientation(orientation) { }
+ QGraphicsLinearLayoutPrivate(Qt::Orientation orientation)
+ : orientation(orientation),
+ m_styleInfo(0)
+ { }
void removeGridItem(QGridLayoutItem *gridItem);
- QLayoutStyleInfo styleInfo() const;
+ QGraphicsLayoutStyleInfo *styleInfo() const;
void fixIndex(int *index) const;
int gridRow(int index) const;
int gridColumn(int index) const;
Qt::Orientation orientation;
- QGridLayoutEngine engine;
+ mutable QGraphicsLayoutStyleInfo *m_styleInfo;
+ QGraphicsGridLayoutEngine engine;
};
void QGraphicsLinearLayoutPrivate::removeGridItem(QGridLayoutItem *gridItem)
@@ -172,13 +177,12 @@ int QGraphicsLinearLayoutPrivate::gridColumn(int index) const
return int(qMin(uint(index), uint(engine.columnCount())));
}
-Q_GLOBAL_STATIC(QWidget, globalStyleInfoWidget)
-
-QLayoutStyleInfo QGraphicsLinearLayoutPrivate::styleInfo() const
+QGraphicsLayoutStyleInfo *QGraphicsLinearLayoutPrivate::styleInfo() const
{
- QGraphicsItem *item = parentItem();
- QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style();
- return QLayoutStyleInfo(style, globalStyleInfoWidget());
+ if (!m_styleInfo)
+ m_styleInfo = new QGraphicsLayoutStyleInfo(this);
+ m_styleInfo->updateChanged(QAbstractLayoutStyleInfo::Unknown);
+ return m_styleInfo;
}
/*!
@@ -281,7 +285,8 @@ void QGraphicsLinearLayout::insertItem(int index, QGraphicsLayoutItem *item)
Q_ASSERT(item);
d->fixIndex(&index);
d->engine.insertRow(index, d->orientation);
- new QGridLayoutItem(&d->engine, item, d->gridRow(index), d->gridColumn(index), 1, 1, 0, index);
+ QGraphicsGridLayoutEngineItem *gridEngineItem = new QGraphicsGridLayoutEngineItem(item, d->gridRow(index), d->gridColumn(index), 1, 1, 0);
+ d->engine.insertItem(gridEngineItem, index);
invalidate();
}
@@ -309,7 +314,7 @@ void QGraphicsLinearLayout::insertStretch(int index, int stretch)
void QGraphicsLinearLayout::removeItem(QGraphicsLayoutItem *item)
{
Q_D(QGraphicsLinearLayout);
- if (QGridLayoutItem *gridItem = d->engine.findLayoutItem(item)) {
+ if (QGraphicsGridLayoutEngineItem *gridItem = d->engine.findLayoutItem(item)) {
item->setParentLayoutItem(0);
d->removeGridItem(gridItem);
delete gridItem;
@@ -330,7 +335,8 @@ void QGraphicsLinearLayout::removeAt(int index)
qWarning("QGraphicsLinearLayout::removeAt: invalid index %d", index);
return;
}
- if (QGridLayoutItem *gridItem = d->engine.itemAt(index)) {
+
+ if (QGraphicsGridLayoutEngineItem *gridItem = static_cast<QGraphicsGridLayoutEngineItem*>(d->engine.itemAt(index))) {
if (QGraphicsLayoutItem *layoutItem = gridItem->layoutItem())
layoutItem->setParentLayoutItem(0);
d->removeGridItem(gridItem);
@@ -365,7 +371,7 @@ void QGraphicsLinearLayout::setSpacing(qreal spacing)
qreal QGraphicsLinearLayout::spacing() const
{
Q_D(const QGraphicsLinearLayout);
- return d->engine.spacing(d->styleInfo(), d->orientation);
+ return d->engine.spacing(d->orientation, d->styleInfo());
}
/*!
@@ -485,7 +491,7 @@ QGraphicsLayoutItem *QGraphicsLinearLayout::itemAt(int index) const
return 0;
}
QGraphicsLayoutItem *item = 0;
- if (QGridLayoutItem *gridItem = d->engine.itemAt(index))
+ if (QGraphicsGridLayoutEngineItem *gridItem = static_cast<QGraphicsGridLayoutEngineItem *>(d->engine.itemAt(index)))
item = gridItem->layoutItem();
return item;
}
@@ -505,15 +511,15 @@ void QGraphicsLinearLayout::setGeometry(const QRectF &rect)
if (visualDir == Qt::RightToLeft)
qSwap(left, right);
effectiveRect.adjust(+left, +top, -right, -bottom);
-#ifdef QT_DEBUG
+#ifdef QGRIDLAYOUTENGINE_DEBUG
if (qt_graphicsLayoutDebug()) {
static int counter = 0;
qDebug() << counter++ << "QGraphicsLinearLayout::setGeometry - " << rect;
dump(1);
}
#endif
- d->engine.setGeometries(d->styleInfo(), effectiveRect);
-#ifdef QT_DEBUG
+ d->engine.setGeometries(effectiveRect, d->styleInfo());
+#ifdef QGRIDLAYOUTENGINE_DEBUG
if (qt_graphicsLayoutDebug()) {
qDebug() << "post dump";
dump(1);
@@ -530,7 +536,7 @@ QSizeF QGraphicsLinearLayout::sizeHint(Qt::SizeHint which, const QSizeF &constra
qreal left, top, right, bottom;
getContentsMargins(&left, &top, &right, &bottom);
const QSizeF extraMargins(left + right, top + bottom);
- return d->engine.sizeHint(d->styleInfo(), which , constraint - extraMargins) + extraMargins;
+ return d->engine.sizeHint(which , constraint - extraMargins, d->styleInfo()) + extraMargins;
}
/*!
@@ -540,6 +546,8 @@ void QGraphicsLinearLayout::invalidate()
{
Q_D(QGraphicsLinearLayout);
d->engine.invalidate();
+ if (d->m_styleInfo)
+ d->m_styleInfo->invalidate();
QGraphicsLayout::invalidate();
}
@@ -548,7 +556,7 @@ void QGraphicsLinearLayout::invalidate()
*/
void QGraphicsLinearLayout::dump(int indent) const
{
-#ifdef QT_DEBUG
+#ifdef QGRIDLAYOUTENGINE_DEBUG
if (qt_graphicsLayoutDebug()) {
Q_D(const QGraphicsLinearLayout);
qDebug("%*s%s layout", indent, "",
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
index 0ed0b0ec3f..68944817f6 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
@@ -348,7 +348,7 @@ QWidget *QGraphicsProxyWidgetPrivate::findFocusChild(QWidget *child, bool next)
// Run around the focus chain until we find a widget that can take tab focus.
if (!child) {
- child = next ? (QWidget *)widget : widget->d_func()->focus_prev;
+ child = next ? (QWidget *)widget : widget->d_func()->focus_prev;
} else {
child = next ? child->d_func()->focus_next : child->d_func()->focus_prev;
if ((next && child == widget) || (!next && child == widget->d_func()->focus_prev)) {
@@ -363,7 +363,7 @@ QWidget *QGraphicsProxyWidgetPrivate::findFocusChild(QWidget *child, bool next)
uint focus_flag = qt_tab_all_widgets() ? Qt::TabFocus : Qt::StrongFocus;
do {
if (child->isEnabled()
- && child->isVisibleTo(widget)
+ && child->isVisibleTo(widget)
&& ((child->focusPolicy() & focus_flag) == focus_flag)
&& !(child->d_func()->extra && child->d_func()->extra->focus_proxy)) {
return child;
@@ -1324,17 +1324,17 @@ void QGraphicsProxyWidget::focusInEvent(QFocusEvent *event)
switch (event->reason()) {
case Qt::TabFocusReason: {
- if (QWidget *focusChild = d->findFocusChild(0, true))
+ if (QWidget *focusChild = d->findFocusChild(0, true))
focusChild->setFocus(event->reason());
break;
}
case Qt::BacktabFocusReason:
- if (QWidget *focusChild = d->findFocusChild(0, false))
+ if (QWidget *focusChild = d->findFocusChild(0, false))
focusChild->setFocus(event->reason());
break;
default:
- if (d->widget && d->widget->focusWidget()) {
- d->widget->focusWidget()->setFocus(event->reason());
+ if (d->widget && d->widget->focusWidget()) {
+ d->widget->focusWidget()->setFocus(event->reason());
}
break;
}
@@ -1371,8 +1371,8 @@ bool QGraphicsProxyWidget::focusNextPrevChild(bool next)
Qt::FocusReason reason = next ? Qt::TabFocusReason : Qt::BacktabFocusReason;
QWidget *lastFocusChild = d->widget->focusWidget();
if (QWidget *newFocusChild = d->findFocusChild(lastFocusChild, next)) {
- newFocusChild->setFocus(reason);
- return true;
+ newFocusChild->setFocus(reason);
+ return true;
}
return QGraphicsWidget::focusNextPrevChild(next);
diff --git a/src/widgets/graphicsview/qgraphicssceneindex.cpp b/src/widgets/graphicsview/qgraphicssceneindex.cpp
index 398e72e4c3..40f63937f4 100644
--- a/src/widgets/graphicsview/qgraphicssceneindex.cpp
+++ b/src/widgets/graphicsview/qgraphicssceneindex.cpp
@@ -67,12 +67,13 @@
QT_BEGIN_NAMESPACE
-class QGraphicsSceneIndexRectIntersector : public QGraphicsSceneIndexIntersector
-{
-public:
- bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
- const QTransform &deviceTransform) const
+namespace QtPrivate { // just to keep indentation of the following functions at the same level
+
+ static bool intersect_rect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
+ const QTransform &deviceTransform, const void *intersectData)
{
+ const QRectF sceneRect = *static_cast<const QRectF *>(intersectData);
+
QRectF brect = item->boundingRect();
_q_adjustRect(&brect);
@@ -117,15 +118,11 @@ public:
return keep;
}
- QRectF sceneRect;
-};
-
-class QGraphicsSceneIndexPointIntersector : public QGraphicsSceneIndexIntersector
-{
-public:
- bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
- const QTransform &deviceTransform) const
+ static bool intersect_point(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
+ const QTransform &deviceTransform, const void *intersectData)
{
+ const QPointF scenePoint = *static_cast<const QPointF *>(intersectData);
+
QRectF brect = item->boundingRect();
_q_adjustRect(&brect);
@@ -163,15 +160,11 @@ public:
return keep;
}
- QPointF scenePoint;
-};
-
-class QGraphicsSceneIndexPathIntersector : public QGraphicsSceneIndexIntersector
-{
-public:
- bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
- const QTransform &deviceTransform) const
+ static bool intersect_path(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
+ const QTransform &deviceTransform, const void *intersectData)
{
+ const QPainterPath scenePath = *static_cast<const QPainterPath *>(intersectData);
+
QRectF brect = item->boundingRect();
_q_adjustRect(&brect);
@@ -211,17 +204,13 @@ public:
return keep;
}
- QPainterPath scenePath;
-};
+} // namespace QtPrivate
/*!
Constructs a private scene index.
*/
QGraphicsSceneIndexPrivate::QGraphicsSceneIndexPrivate(QGraphicsScene *scene) : scene(scene)
{
- pointIntersector = new QGraphicsSceneIndexPointIntersector;
- rectIntersector = new QGraphicsSceneIndexRectIntersector;
- pathIntersector = new QGraphicsSceneIndexPathIntersector;
}
/*!
@@ -229,9 +218,6 @@ QGraphicsSceneIndexPrivate::QGraphicsSceneIndexPrivate(QGraphicsScene *scene) :
*/
QGraphicsSceneIndexPrivate::~QGraphicsSceneIndexPrivate()
{
- delete pointIntersector;
- delete rectIntersector;
- delete pathIntersector;
}
/*!
@@ -268,11 +254,11 @@ bool QGraphicsSceneIndexPrivate::itemCollidesWithPath(const QGraphicsItem *item,
This function returns the items in ascending order.
*/
void QGraphicsSceneIndexPrivate::recursive_items_helper(QGraphicsItem *item, QRectF exposeRect,
- QGraphicsSceneIndexIntersector *intersector,
+ QGraphicsSceneIndexIntersector intersect,
QList<QGraphicsItem *> *items,
const QTransform &viewTransform,
Qt::ItemSelectionMode mode,
- qreal parentOpacity) const
+ qreal parentOpacity, const void *intersectData) const
{
Q_ASSERT(item);
if (!item->d_ptr->visible)
@@ -295,7 +281,7 @@ void QGraphicsSceneIndexPrivate::recursive_items_helper(QGraphicsItem *item, QRe
const bool itemClipsChildrenToShape = (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape);
bool processItem = !itemIsFullyTransparent;
if (processItem) {
- processItem = intersector->intersect(item, exposeRect, mode, viewTransform);
+ processItem = intersect(item, exposeRect, mode, viewTransform, intersectData);
if (!processItem && (!itemHasChildren || itemClipsChildrenToShape)) {
if (wasDirtyParentSceneTransform)
item->d_ptr->invalidateChildrenSceneTransform();
@@ -326,8 +312,8 @@ void QGraphicsSceneIndexPrivate::recursive_items_helper(QGraphicsItem *item, QRe
break;
if (itemIsFullyTransparent && !(child->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity))
continue;
- recursive_items_helper(child, exposeRect, intersector, items, viewTransform,
- mode, opacity);
+ recursive_items_helper(child, exposeRect, intersect, items, viewTransform,
+ mode, opacity, intersectData);
}
}
@@ -343,8 +329,8 @@ void QGraphicsSceneIndexPrivate::recursive_items_helper(QGraphicsItem *item, QRe
child->d_ptr->dirtySceneTransform = 1;
if (itemIsFullyTransparent && !(child->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity))
continue;
- recursive_items_helper(child, exposeRect, intersector, items, viewTransform,
- mode, opacity);
+ recursive_items_helper(child, exposeRect, intersect, items, viewTransform,
+ mode, opacity, intersectData);
}
}
}
@@ -419,8 +405,7 @@ QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QPointF &pos, Qt::ItemSe
Q_D(const QGraphicsSceneIndex);
QList<QGraphicsItem *> itemList;
- d->pointIntersector->scenePoint = pos;
- d->items_helper(QRectF(pos, QSizeF(1, 1)), d->pointIntersector, &itemList, deviceTransform, mode, order);
+ d->items_helper(QRectF(pos, QSizeF(1, 1)), &QtPrivate::intersect_point, &itemList, deviceTransform, mode, order, &pos);
return itemList;
}
@@ -453,8 +438,7 @@ QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QRectF &rect, Qt::ItemSe
QRectF exposeRect = rect;
_q_adjustRect(&exposeRect);
QList<QGraphicsItem *> itemList;
- d->rectIntersector->sceneRect = rect;
- d->items_helper(exposeRect, d->rectIntersector, &itemList, deviceTransform, mode, order);
+ d->items_helper(exposeRect, &QtPrivate::intersect_rect, &itemList, deviceTransform, mode, order, &rect);
return itemList;
}
@@ -489,8 +473,7 @@ QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QPolygonF &polygon, Qt::
_q_adjustRect(&exposeRect);
QPainterPath path;
path.addPolygon(polygon);
- d->pathIntersector->scenePath = path;
- d->items_helper(exposeRect, d->pathIntersector, &itemList, deviceTransform, mode, order);
+ d->items_helper(exposeRect, &QtPrivate::intersect_path, &itemList, deviceTransform, mode, order, &path);
return itemList;
}
@@ -523,8 +506,7 @@ QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QPainterPath &path, Qt::
QList<QGraphicsItem *> itemList;
QRectF exposeRect = path.controlPointRect();
_q_adjustRect(&exposeRect);
- d->pathIntersector->scenePath = path;
- d->items_helper(exposeRect, d->pathIntersector, &itemList, deviceTransform, mode, order);
+ d->items_helper(exposeRect, &QtPrivate::intersect_path, &itemList, deviceTransform, mode, order, &path);
return itemList;
}
diff --git a/src/widgets/graphicsview/qgraphicssceneindex_p.h b/src/widgets/graphicsview/qgraphicssceneindex_p.h
index 29b321fb1d..215fefe9b7 100644
--- a/src/widgets/graphicsview/qgraphicssceneindex_p.h
+++ b/src/widgets/graphicsview/qgraphicssceneindex_p.h
@@ -66,15 +66,14 @@ QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
-class QGraphicsSceneIndexIntersector;
-class QGraphicsSceneIndexPointIntersector;
-class QGraphicsSceneIndexRectIntersector;
-class QGraphicsSceneIndexPathIntersector;
class QGraphicsSceneIndexPrivate;
class QPointF;
class QRectF;
template<typename T> class QList;
+typedef bool (*QGraphicsSceneIndexIntersector)(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
+ const QTransform &deviceTransform, const void *data);
+
class Q_AUTOTEST_EXPORT QGraphicsSceneIndex : public QObject
{
Q_OBJECT
@@ -133,27 +132,24 @@ public:
static bool itemCollidesWithPath(const QGraphicsItem *item, const QPainterPath &path, Qt::ItemSelectionMode mode);
void recursive_items_helper(QGraphicsItem *item, QRectF exposeRect,
- QGraphicsSceneIndexIntersector *intersector, QList<QGraphicsItem *> *items,
+ QGraphicsSceneIndexIntersector intersect, QList<QGraphicsItem *> *items,
const QTransform &viewTransform,
- Qt::ItemSelectionMode mode, qreal parentOpacity = 1.0) const;
- inline void items_helper(const QRectF &rect, QGraphicsSceneIndexIntersector *intersector,
+ Qt::ItemSelectionMode mode, qreal parentOpacity, const void *intersectData) const;
+ inline void items_helper(const QRectF &rect, QGraphicsSceneIndexIntersector intersect,
QList<QGraphicsItem *> *items, const QTransform &viewTransform,
- Qt::ItemSelectionMode mode, Qt::SortOrder order) const;
+ Qt::ItemSelectionMode mode, Qt::SortOrder order, const void *intersectData) const;
QGraphicsScene *scene;
- QGraphicsSceneIndexPointIntersector *pointIntersector;
- QGraphicsSceneIndexRectIntersector *rectIntersector;
- QGraphicsSceneIndexPathIntersector *pathIntersector;
};
-inline void QGraphicsSceneIndexPrivate::items_helper(const QRectF &rect, QGraphicsSceneIndexIntersector *intersector,
+inline void QGraphicsSceneIndexPrivate::items_helper(const QRectF &rect, QGraphicsSceneIndexIntersector intersect,
QList<QGraphicsItem *> *items, const QTransform &viewTransform,
- Qt::ItemSelectionMode mode, Qt::SortOrder order) const
+ Qt::ItemSelectionMode mode, Qt::SortOrder order, const void *intersectData) const
{
Q_Q(const QGraphicsSceneIndex);
const QList<QGraphicsItem *> tli = q->estimateTopLevelItems(rect, Qt::AscendingOrder);
for (int i = 0; i < tli.size(); ++i)
- recursive_items_helper(tli.at(i), rect, intersector, items, viewTransform, mode);
+ recursive_items_helper(tli.at(i), rect, intersect, items, viewTransform, mode, 1.0, intersectData);
if (order == Qt::DescendingOrder) {
const int n = items->size();
for (int i = 0; i < n / 2; ++i)
@@ -161,15 +157,6 @@ inline void QGraphicsSceneIndexPrivate::items_helper(const QRectF &rect, QGraphi
}
}
-class QGraphicsSceneIndexIntersector
-{
-public:
- QGraphicsSceneIndexIntersector() { }
- virtual ~QGraphicsSceneIndexIntersector() { }
- virtual bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
- const QTransform &deviceTransform) const = 0;
-};
-
#endif // QT_NO_GRAPHICSVIEW
QT_END_NAMESPACE
diff --git a/src/widgets/graphicsview/qgridlayoutengine.cpp b/src/widgets/graphicsview/qgridlayoutengine.cpp
deleted file mode 100644
index a1affdb55e..0000000000
--- a/src/widgets/graphicsview/qgridlayoutengine.cpp
+++ /dev/null
@@ -1,1745 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtWidgets module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qglobal.h"
-
-#ifndef QT_NO_GRAPHICSVIEW
-
-#include <math.h>
-
-#include "qgraphicslayoutitem.h"
-#include "qgridlayoutengine_p.h"
-#include "qstyleoption.h"
-#include "qvarlengtharray.h"
-
-#include <QtDebug>
-#include <QtCore/qmath.h>
-
-QT_BEGIN_NAMESPACE
-
-template <typename T>
-static void insertOrRemoveItems(QVector<T> &items, int index, int delta)
-{
- int count = items.count();
- if (index < count) {
- if (delta > 0) {
- items.insert(index, delta, T());
- } else if (delta < 0) {
- items.remove(index, qMin(-delta, count - index));
- }
- }
-}
-
-static qreal growthFactorBelowPreferredSize(qreal desired, qreal sumAvailable, qreal sumDesired)
-{
- Q_ASSERT(sumDesired != 0.0);
- return desired * qPow(sumAvailable / sumDesired, desired / sumDesired);
-}
-
-static qreal fixedDescent(qreal descent, qreal ascent, qreal targetSize)
-{
- if (descent < 0.0)
- return -1.0;
-
- Q_ASSERT(descent >= 0.0);
- Q_ASSERT(ascent >= 0.0);
- Q_ASSERT(targetSize >= ascent + descent);
-
- qreal extra = targetSize - (ascent + descent);
- return descent + (extra / 2.0);
-}
-
-static qreal compare(const QGridLayoutBox &box1, const QGridLayoutBox &box2, int which)
-{
- qreal size1 = box1.q_sizes(which);
- qreal size2 = box2.q_sizes(which);
-
- if (which == MaximumSize) {
- return size2 - size1;
- } else {
- return size1 - size2;
- }
-}
-
-void QGridLayoutBox::add(const QGridLayoutBox &other, int stretch, qreal spacing)
-{
- Q_ASSERT(q_minimumDescent < 0.0);
-
- q_minimumSize += other.q_minimumSize + spacing;
- q_preferredSize += other.q_preferredSize + spacing;
- q_maximumSize += ((stretch == 0) ? other.q_preferredSize : other.q_maximumSize) + spacing;
-}
-
-void QGridLayoutBox::combine(const QGridLayoutBox &other)
-{
- q_minimumDescent = qMax(q_minimumDescent, other.q_minimumDescent);
- q_minimumAscent = qMax(q_minimumAscent, other.q_minimumAscent);
-
- q_minimumSize = qMax(q_minimumAscent + q_minimumDescent,
- qMax(q_minimumSize, other.q_minimumSize));
- qreal maxMax;
- if (q_maximumSize == FLT_MAX && other.q_maximumSize != FLT_MAX)
- maxMax = other.q_maximumSize;
- else if (other.q_maximumSize == FLT_MAX && q_maximumSize != FLT_MAX)
- maxMax = q_maximumSize;
- else
- maxMax = qMax(q_maximumSize, other.q_maximumSize);
-
- q_maximumSize = qMax(q_minimumSize, maxMax);
- q_preferredSize = qBound(q_minimumSize, qMax(q_preferredSize, other.q_preferredSize),
- q_maximumSize);
-}
-
-void QGridLayoutBox::normalize()
-{
- q_maximumSize = qMax(qreal(0.0), q_maximumSize);
- q_minimumSize = qBound(qreal(0.0), q_minimumSize, q_maximumSize);
- q_preferredSize = qBound(q_minimumSize, q_preferredSize, q_maximumSize);
- q_minimumDescent = qMin(q_minimumDescent, q_minimumSize);
-
- Q_ASSERT((q_minimumDescent < 0.0) == (q_minimumAscent < 0.0));
-}
-
-#ifdef QT_DEBUG
-void QGridLayoutBox::dump(int indent) const
-{
- qDebug("%*sBox (%g <= %g <= %g [%g/%g])", indent, "", q_minimumSize, q_preferredSize,
- q_maximumSize, q_minimumAscent, q_minimumDescent);
-}
-#endif
-
-bool operator==(const QGridLayoutBox &box1, const QGridLayoutBox &box2)
-{
- for (int i = 0; i < NSizes; ++i) {
- if (box1.q_sizes(i) != box2.q_sizes(i))
- return false;
- }
- return box1.q_minimumDescent == box2.q_minimumDescent
- && box1.q_minimumAscent == box2.q_minimumAscent;
-}
-
-void QGridLayoutRowData::reset(int count)
-{
- ignore.fill(false, count);
- boxes.fill(QGridLayoutBox(), count);
- multiCellMap.clear();
- stretches.fill(0, count);
- spacings.fill(0.0, count);
- hasIgnoreFlag = false;
-}
-
-void QGridLayoutRowData::distributeMultiCells(const QGridLayoutRowInfo &rowInfo)
-{
- MultiCellMap::const_iterator i = multiCellMap.constBegin();
- for (; i != multiCellMap.constEnd(); ++i) {
- int start = i.key().first;
- int span = i.key().second;
- int end = start + span;
- const QGridLayoutBox &box = i.value().q_box;
- int stretch = i.value().q_stretch;
-
- QGridLayoutBox totalBox = this->totalBox(start, end);
- QVarLengthArray<QGridLayoutBox> extras(span);
- QVarLengthArray<qreal> dummy(span);
- QVarLengthArray<qreal> newSizes(span);
-
- for (int j = 0; j < NSizes; ++j) {
- qreal extra = compare(box, totalBox, j);
- if (extra > 0.0) {
- calculateGeometries(start, end, box.q_sizes(j), dummy.data(), newSizes.data(),
- 0, totalBox, rowInfo);
-
- for (int k = 0; k < span; ++k)
- extras[k].q_sizes(j) = newSizes[k];
- }
- }
-
- for (int k = 0; k < span; ++k) {
- boxes[start + k].combine(extras[k]);
- if (stretch != 0)
- stretches[start + k] = qMax(stretches[start + k], stretch);
- }
- }
- multiCellMap.clear();
-}
-
-void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSize, qreal *positions,
- qreal *sizes, qreal *descents,
- const QGridLayoutBox &totalBox,
- const QGridLayoutRowInfo &rowInfo)
-{
- Q_ASSERT(end > start);
-
- targetSize = qMax(totalBox.q_minimumSize, targetSize);
-
- int n = end - start;
- QVarLengthArray<qreal> newSizes(n);
- QVarLengthArray<qreal> factors(n);
- qreal sumFactors = 0.0;
- int sumStretches = 0;
- qreal sumAvailable;
-
- for (int i = 0; i < n; ++i) {
- if (stretches[start + i] > 0)
- sumStretches += stretches[start + i];
- }
-
- if (targetSize < totalBox.q_preferredSize) {
- stealBox(start, end, MinimumSize, positions, sizes);
-
- sumAvailable = targetSize - totalBox.q_minimumSize;
- if (sumAvailable > 0.0) {
- qreal sumDesired = totalBox.q_preferredSize - totalBox.q_minimumSize;
-
- for (int i = 0; i < n; ++i) {
- if (ignore.testBit(start + i)) {
- factors[i] = 0.0;
- continue;
- }
-
- const QGridLayoutBox &box = boxes.at(start + i);
- qreal desired = box.q_preferredSize - box.q_minimumSize;
- factors[i] = growthFactorBelowPreferredSize(desired, sumAvailable, sumDesired);
- sumFactors += factors[i];
- }
-
- for (int i = 0; i < n; ++i) {
- Q_ASSERT(sumFactors > 0.0);
- qreal delta = sumAvailable * factors[i] / sumFactors;
- newSizes[i] = sizes[i] + delta;
- }
- }
- } else {
- bool isLargerThanMaximum = (targetSize > totalBox.q_maximumSize);
- if (isLargerThanMaximum) {
- stealBox(start, end, MaximumSize, positions, sizes);
- sumAvailable = targetSize - totalBox.q_maximumSize;
- } else {
- stealBox(start, end, PreferredSize, positions, sizes);
- sumAvailable = targetSize - totalBox.q_preferredSize;
- }
-
- if (sumAvailable > 0.0) {
- qreal sumCurrentAvailable = sumAvailable;
- bool somethingHasAMaximumSize = false;
-
- qreal sumSizes = 0.0;
- for (int i = 0; i < n; ++i)
- sumSizes += sizes[i];
-
- for (int i = 0; i < n; ++i) {
- if (ignore.testBit(start + i)) {
- newSizes[i] = 0.0;
- factors[i] = 0.0;
- continue;
- }
-
- const QGridLayoutBox &box = boxes.at(start + i);
- qreal boxSize;
-
- qreal desired;
- if (isLargerThanMaximum) {
- boxSize = box.q_maximumSize;
- desired = rowInfo.boxes.value(start + i).q_maximumSize - boxSize;
- } else {
- boxSize = box.q_preferredSize;
- desired = box.q_maximumSize - boxSize;
- }
- if (desired == 0.0) {
- newSizes[i] = sizes[i];
- factors[i] = 0.0;
- } else {
- Q_ASSERT(desired > 0.0);
-
- int stretch = stretches[start + i];
- if (sumStretches == 0) {
- if (hasIgnoreFlag || sizes[i] == 0.0) {
- factors[i] = (stretch < 0) ? 1.0 : 0.0;
- } else {
- factors[i] = (stretch < 0) ? sizes[i] : 0.0;
- }
- } else if (stretch == sumStretches) {
- factors[i] = 1.0;
- } else if (stretch <= 0) {
- factors[i] = 0.0;
- } else {
- qreal ultimateSize;
- qreal ultimateSumSizes;
- qreal x = ((stretch * sumSizes)
- - (sumStretches * boxSize))
- / (sumStretches - stretch);
- if (x >= 0.0) {
- ultimateSize = boxSize + x;
- ultimateSumSizes = sumSizes + x;
- } else {
- ultimateSize = boxSize;
- ultimateSumSizes = (sumStretches * boxSize)
- / stretch;
- }
-
- /*
- We multiply these by 1.5 to give some space for a smooth transition
- (at the expense of the stretch factors, which are not fully respected
- during the transition).
- */
- ultimateSize = ultimateSize * 3 / 2;
- ultimateSumSizes = ultimateSumSizes * 3 / 2;
-
- qreal beta = ultimateSumSizes - sumSizes;
- if (!beta) {
- factors[i] = 1;
- } else {
- qreal alpha = qMin(sumCurrentAvailable, beta);
- qreal ultimateFactor = (stretch * ultimateSumSizes / sumStretches)
- - (boxSize);
- qreal transitionalFactor = sumCurrentAvailable * (ultimateSize - boxSize) / beta;
-
- factors[i] = ((alpha * ultimateFactor)
- + ((beta - alpha) * transitionalFactor)) / beta;
- }
-
- }
- sumFactors += factors[i];
- if (desired < sumCurrentAvailable)
- somethingHasAMaximumSize = true;
-
- newSizes[i] = -1.0;
- }
- }
-
- bool keepGoing = somethingHasAMaximumSize;
- while (keepGoing) {
- keepGoing = false;
-
- for (int i = 0; i < n; ++i) {
- if (newSizes[i] >= 0.0)
- continue;
-
- qreal maxBoxSize;
- if (isLargerThanMaximum)
- maxBoxSize = rowInfo.boxes.value(start + i).q_maximumSize;
- else
- maxBoxSize = boxes.at(start + i).q_maximumSize;
-
- qreal avail = sumCurrentAvailable * factors[i] / sumFactors;
- if (sizes[i] + avail >= maxBoxSize) {
- newSizes[i] = maxBoxSize;
- sumCurrentAvailable -= maxBoxSize - sizes[i];
- sumFactors -= factors[i];
- keepGoing = (sumCurrentAvailable > 0.0);
- if (!keepGoing)
- break;
- }
- }
- }
-
- for (int i = 0; i < n; ++i) {
- if (newSizes[i] < 0.0) {
- qreal delta = (sumFactors == 0.0) ? 0.0
- : sumCurrentAvailable * factors[i] / sumFactors;
- newSizes[i] = sizes[i] + delta;
- }
- }
- }
- }
-
- if (sumAvailable > 0) {
- qreal offset = 0;
- for (int i = 0; i < n; ++i) {
- qreal delta = newSizes[i] - sizes[i];
- positions[i] += offset;
- sizes[i] += delta;
- offset += delta;
- }
-
-#if 0 // some "pixel allocation"
- int surplus = targetSize - (positions[n - 1] + sizes[n - 1]);
- Q_ASSERT(surplus >= 0 && surplus <= n);
-
- int prevSurplus = -1;
- while (surplus > 0 && surplus != prevSurplus) {
- prevSurplus = surplus;
-
- int offset = 0;
- for (int i = 0; i < n; ++i) {
- const QGridLayoutBox &box = boxes.at(start + i);
- int delta = (!ignore.testBit(start + i) && surplus > 0
- && factors[i] > 0 && sizes[i] < box.q_maximumSize)
- ? 1 : 0;
-
- positions[i] += offset;
- sizes[i] += delta;
- offset += delta;
- surplus -= delta;
- }
- }
- Q_ASSERT(surplus == 0);
-#endif
- }
-
- if (descents) {
- for (int i = 0; i < n; ++i) {
- if (ignore.testBit(start + i))
- continue;
- const QGridLayoutBox &box = boxes.at(start + i);
- descents[i] = fixedDescent(box.q_minimumDescent, box.q_minimumAscent, sizes[i]);
- }
- }
-}
-
-QGridLayoutBox QGridLayoutRowData::totalBox(int start, int end) const
-{
- QGridLayoutBox result;
- if (start < end) {
- result.q_maximumSize = 0.0;
- qreal nextSpacing = 0.0;
- for (int i = start; i < end; ++i) {
- if (ignore.testBit(i))
- continue;
- result.add(boxes.at(i), stretches.at(i), nextSpacing);
- nextSpacing = spacings.at(i);
- }
- }
- return result;
-}
-
-void QGridLayoutRowData::stealBox(int start, int end, int which, qreal *positions, qreal *sizes)
-{
- qreal offset = 0.0;
- qreal nextSpacing = 0.0;
-
- for (int i = start; i < end; ++i) {
- qreal avail = 0.0;
-
- if (!ignore.testBit(i)) {
- const QGridLayoutBox &box = boxes.at(i);
- avail = box.q_sizes(which);
- offset += nextSpacing;
- nextSpacing = spacings.at(i);
- }
-
- *positions++ = offset;
- *sizes++ = avail;
- offset += avail;
- }
-}
-
-#ifdef QT_DEBUG
-void QGridLayoutRowData::dump(int indent) const
-{
- qDebug("%*sData", indent, "");
-
- for (int i = 0; i < ignore.count(); ++i) {
- qDebug("%*s Row %d (stretch %d, spacing %g)", indent, "", i, stretches.at(i),
- spacings.at(i));
- if (ignore.testBit(i))
- qDebug("%*s Ignored", indent, "");
- boxes.at(i).dump(indent + 2);
- }
-
- MultiCellMap::const_iterator it = multiCellMap.constBegin();
- while (it != multiCellMap.constEnd()) {
- qDebug("%*s Multi-cell entry <%d, %d> (stretch %d)", indent, "", it.key().first,
- it.key().second, it.value().q_stretch);
- it.value().q_box.dump(indent + 2);
- }
-}
-#endif
-
-QGridLayoutItem::QGridLayoutItem(QGridLayoutEngine *engine, QGraphicsLayoutItem *layoutItem,
- int row, int column, int rowSpan, int columnSpan,
- Qt::Alignment alignment, int itemAtIndex)
- : q_engine(engine), q_layoutItem(layoutItem), q_alignment(alignment)
-{
- q_firstRows[Hor] = column;
- q_firstRows[Ver] = row;
- q_rowSpans[Hor] = columnSpan;
- q_rowSpans[Ver] = rowSpan;
- q_stretches[Hor] = -1;
- q_stretches[Ver] = -1;
-
- q_engine->insertItem(this, itemAtIndex);
-}
-
-int QGridLayoutItem::firstRow(Qt::Orientation orientation) const
-{
- return q_firstRows[orientation == Qt::Vertical];
-}
-
-int QGridLayoutItem::firstColumn(Qt::Orientation orientation) const
-{
- return q_firstRows[orientation == Qt::Horizontal];
-}
-
-int QGridLayoutItem::lastRow(Qt::Orientation orientation) const
-{
- return firstRow(orientation) + rowSpan(orientation) - 1;
-}
-
-int QGridLayoutItem::lastColumn(Qt::Orientation orientation) const
-{
- return firstColumn(orientation) + columnSpan(orientation) - 1;
-}
-
-int QGridLayoutItem::rowSpan(Qt::Orientation orientation) const
-{
- return q_rowSpans[orientation == Qt::Vertical];
-}
-
-int QGridLayoutItem::columnSpan(Qt::Orientation orientation) const
-{
- return q_rowSpans[orientation == Qt::Horizontal];
-}
-
-void QGridLayoutItem::setFirstRow(int row, Qt::Orientation orientation)
-{
- q_firstRows[orientation == Qt::Vertical] = row;
-}
-
-void QGridLayoutItem::setRowSpan(int rowSpan, Qt::Orientation orientation)
-{
- q_rowSpans[orientation == Qt::Vertical] = rowSpan;
-}
-
-int QGridLayoutItem::stretchFactor(Qt::Orientation orientation) const
-{
- int stretch = q_stretches[orientation == Qt::Vertical];
- if (stretch >= 0)
- return stretch;
-
- QSizePolicy::Policy policy = sizePolicy(orientation);
-
- if (policy & QSizePolicy::ExpandFlag) {
- return 1;
- } else if (policy & QSizePolicy::GrowFlag) {
- return -1; // because we max it up
- } else {
- return 0;
- }
-}
-
-void QGridLayoutItem::setStretchFactor(int stretch, Qt::Orientation orientation)
-{
- Q_ASSERT(stretch >= 0); // ### deal with too big stretches
- q_stretches[orientation == Qt::Vertical] = stretch;
-}
-
-QSizePolicy::Policy QGridLayoutItem::sizePolicy(Qt::Orientation orientation) const
-{
- QSizePolicy sizePolicy(q_layoutItem->sizePolicy());
- return (orientation == Qt::Horizontal) ? sizePolicy.horizontalPolicy()
- : sizePolicy.verticalPolicy();
-}
-
-/*
- returns \c true if the size policy returns \c true for either hasHeightForWidth()
- or hasWidthForHeight()
- */
-bool QGridLayoutItem::hasDynamicConstraint() const
-{
- return QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasHeightForWidth()
- || QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasWidthForHeight();
-}
-
-Qt::Orientation QGridLayoutItem::dynamicConstraintOrientation() const
-{
- if (QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasHeightForWidth())
- return Qt::Vertical;
- else //if (QGraphicsLayoutItemPrivate::get(q_layoutItem)->hasWidthForHeight())
- return Qt::Horizontal;
-}
-
-QSizePolicy::ControlTypes QGridLayoutItem::controlTypes(LayoutSide /* side */) const
-{
- return q_layoutItem->sizePolicy().controlType();
-}
-
-QSizeF QGridLayoutItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
-{
- return q_layoutItem->effectiveSizeHint(which, constraint);
-}
-
-QGridLayoutBox QGridLayoutItem::box(Qt::Orientation orientation, qreal constraint) const
-{
- QGridLayoutBox result;
- QSizePolicy::Policy policy = sizePolicy(orientation);
-
- if (orientation == Qt::Horizontal) {
- QSizeF constraintSize(-1.0, constraint);
-
- result.q_preferredSize = sizeHint(Qt::PreferredSize, constraintSize).width();
-
- if (policy & QSizePolicy::ShrinkFlag) {
- result.q_minimumSize = sizeHint(Qt::MinimumSize, constraintSize).width();
- } else {
- result.q_minimumSize = result.q_preferredSize;
- }
-
- if (policy & (QSizePolicy::GrowFlag | QSizePolicy::ExpandFlag)) {
- result.q_maximumSize = sizeHint(Qt::MaximumSize, constraintSize).width();
- } else {
- result.q_maximumSize = result.q_preferredSize;
- }
- } else {
- QSizeF constraintSize(constraint, -1.0);
-
- result.q_preferredSize = sizeHint(Qt::PreferredSize, constraintSize).height();
-
- if (policy & QSizePolicy::ShrinkFlag) {
- result.q_minimumSize = sizeHint(Qt::MinimumSize, constraintSize).height();
- } else {
- result.q_minimumSize = result.q_preferredSize;
- }
-
- if (policy & (QSizePolicy::GrowFlag | QSizePolicy::ExpandFlag)) {
- result.q_maximumSize = sizeHint(Qt::MaximumSize, constraintSize).height();
- } else {
- result.q_maximumSize = result.q_preferredSize;
- }
-
- result.q_minimumDescent = sizeHint(Qt::MinimumDescent, constraintSize).height();
- if (result.q_minimumDescent >= 0.0)
- result.q_minimumAscent = result.q_minimumSize - result.q_minimumDescent;
- }
- if (policy & QSizePolicy::IgnoreFlag)
- result.q_preferredSize = result.q_minimumSize;
-
- return result;
-}
-
-QRectF QGridLayoutItem::geometryWithin(qreal x, qreal y, qreal width, qreal height,
- qreal rowDescent) const
-{
- rowDescent = -1.0; // ### This disables the descent
-
- QGridLayoutBox vBox = box(Qt::Vertical);
- if (vBox.q_minimumDescent < 0.0 || rowDescent < 0.0) {
- qreal cellWidth = width;
- qreal cellHeight = height;
-
-
- QSizeF size = effectiveMaxSize(QSizeF(-1,-1));
- if (hasDynamicConstraint()) {
- if (dynamicConstraintOrientation() == Qt::Vertical) {
- if (size.width() > cellWidth)
- size = effectiveMaxSize(QSizeF(cellWidth, -1));
- } else if (size.height() > cellHeight) {
- size = effectiveMaxSize(QSizeF(-1, cellHeight));
- }
- }
- size = size.boundedTo(QSizeF(cellWidth, cellHeight));
- width = size.width();
- height = size.height();
-
- Qt::Alignment align = q_engine->effectiveAlignment(this);
- switch (align & Qt::AlignHorizontal_Mask) {
- case Qt::AlignHCenter:
- x += (cellWidth - width)/2;
- break;
- case Qt::AlignRight:
- x += cellWidth - width;
- break;
- default:
- break;
- }
- switch (align & Qt::AlignVertical_Mask) {
- case Qt::AlignVCenter:
- y += (cellHeight - height)/2;
- break;
- case Qt::AlignBottom:
- y += cellHeight - height;
- break;
- default:
- break;
- }
- return QRectF(x, y, width, height);
- } else {
- qreal descent = vBox.q_minimumDescent;
- qreal ascent = vBox.q_minimumSize - descent;
- return QRectF(x, y + height - rowDescent - ascent, width, ascent + descent);
- }
-}
-
-void QGridLayoutItem::setGeometry(const QRectF &rect)
-{
- q_layoutItem->setGeometry(rect);
-}
-
-void QGridLayoutItem::transpose()
-{
- qSwap(q_firstRows[Hor], q_firstRows[Ver]);
- qSwap(q_rowSpans[Hor], q_rowSpans[Ver]);
- qSwap(q_stretches[Hor], q_stretches[Ver]);
-}
-
-void QGridLayoutItem::insertOrRemoveRows(int row, int delta, Qt::Orientation orientation)
-{
- int oldFirstRow = firstRow(orientation);
- if (oldFirstRow >= row) {
- setFirstRow(oldFirstRow + delta, orientation);
- } else if (lastRow(orientation) >= row) {
- setRowSpan(rowSpan(orientation) + delta, orientation);
- }
-}
-/*!
- \internal
- returns the effective maximumSize, will take the sizepolicy into
- consideration. (i.e. if sizepolicy does not have QSizePolicy::Grow, then
- maxSizeHint will be the preferredSize)
- Note that effectiveSizeHint does not take sizePolicy into consideration,
- (since it only evaluates the hints, as the name implies)
-*/
-QSizeF QGridLayoutItem::effectiveMaxSize(const QSizeF &constraint) const
-{
- QSizeF size = constraint;
- bool vGrow = (sizePolicy(Qt::Vertical) & QSizePolicy::GrowFlag) == QSizePolicy::GrowFlag;
- bool hGrow = (sizePolicy(Qt::Horizontal) & QSizePolicy::GrowFlag) == QSizePolicy::GrowFlag;
- if (!vGrow || !hGrow) {
- QSizeF pref = layoutItem()->effectiveSizeHint(Qt::PreferredSize, constraint);
- if (!vGrow)
- size.setHeight(pref.height());
- if (!hGrow)
- size.setWidth(pref.width());
- }
-
- if (!size.isValid()) {
- QSizeF maxSize = layoutItem()->effectiveSizeHint(Qt::MaximumSize, size);
- if (size.width() == -1)
- size.setWidth(maxSize.width());
- if (size.height() == -1)
- size.setHeight(maxSize.height());
- }
- return size;
-}
-
-#ifdef QT_DEBUG
-void QGridLayoutItem::dump(int indent) const
-{
- qDebug("%*s%p (%d, %d) %d x %d", indent, "", q_layoutItem, firstRow(), firstColumn(),
- rowSpan(), columnSpan());
-
- if (q_stretches[Hor] >= 0)
- qDebug("%*s Horizontal stretch: %d", indent, "", q_stretches[Hor]);
- if (q_stretches[Ver] >= 0)
- qDebug("%*s Vertical stretch: %d", indent, "", q_stretches[Ver]);
- if (q_alignment != 0)
- qDebug("%*s Alignment: %x", indent, "", uint(q_alignment));
- qDebug("%*s Horizontal size policy: %x Vertical size policy: %x",
- indent, "", sizePolicy(Qt::Horizontal), sizePolicy(Qt::Vertical));
-}
-#endif
-
-void QGridLayoutRowInfo::insertOrRemoveRows(int row, int delta)
-{
- count += delta;
-
- insertOrRemoveItems(stretches, row, delta);
- insertOrRemoveItems(spacings, row, delta);
- insertOrRemoveItems(alignments, row, delta);
- insertOrRemoveItems(boxes, row, delta);
-}
-
-#ifdef QT_DEBUG
-void QGridLayoutRowInfo::dump(int indent) const
-{
- qDebug("%*sInfo (count: %d)", indent, "", count);
- for (int i = 0; i < count; ++i) {
- QString message;
-
- if (stretches.value(i).value() >= 0)
- message += QString::fromLatin1(" stretch %1").arg(stretches.value(i).value());
- if (spacings.value(i).value() >= 0.0)
- message += QString::fromLatin1(" spacing %1").arg(spacings.value(i).value());
- if (alignments.value(i) != 0)
- message += QString::fromLatin1(" alignment %1").arg(int(alignments.value(i)), 16);
-
- if (!message.isEmpty() || boxes.value(i) != QGridLayoutBox()) {
- qDebug("%*s Row %d:%s", indent, "", i, qPrintable(message));
- if (boxes.value(i) != QGridLayoutBox())
- boxes.value(i).dump(indent + 1);
- }
- }
-}
-#endif
-
-QGridLayoutEngine::QGridLayoutEngine()
-{
- m_visualDirection = Qt::LeftToRight;
- invalidate();
-}
-
-int QGridLayoutEngine::rowCount(Qt::Orientation orientation) const
-{
- return q_infos[orientation == Qt::Vertical].count;
-}
-
-int QGridLayoutEngine::columnCount(Qt::Orientation orientation) const
-{
- return q_infos[orientation == Qt::Horizontal].count;
-}
-
-int QGridLayoutEngine::itemCount() const
-{
- return q_items.count();
-}
-
-QGridLayoutItem *QGridLayoutEngine::itemAt(int index) const
-{
- Q_ASSERT(index >= 0 && index < itemCount());
- return q_items.at(index);
-}
-
-int QGridLayoutEngine::indexOf(QGraphicsLayoutItem *item) const
-{
- for (int i = 0; i < q_items.size(); ++i) {
- if (item == q_items.at(i)->layoutItem())
- return i;
- }
- return -1;
-}
-
-int QGridLayoutEngine::effectiveFirstRow(Qt::Orientation orientation) const
-{
- ensureEffectiveFirstAndLastRows();
- return q_cachedEffectiveFirstRows[orientation == Qt::Vertical];
-}
-
-int QGridLayoutEngine::effectiveLastRow(Qt::Orientation orientation) const
-{
- ensureEffectiveFirstAndLastRows();
- return q_cachedEffectiveLastRows[orientation == Qt::Vertical];
-}
-
-void QGridLayoutEngine::setSpacing(qreal spacing, Qt::Orientations orientations)
-{
- Q_ASSERT(spacing >= 0.0);
- if (orientations & Qt::Horizontal)
- q_defaultSpacings[Hor].setUserValue(spacing);
- if (orientations & Qt::Vertical)
- q_defaultSpacings[Ver].setUserValue(spacing);
-
- invalidate();
-}
-
-qreal QGridLayoutEngine::spacing(const QLayoutStyleInfo &styleInfo, Qt::Orientation orientation) const
-{
- if (q_defaultSpacings[orientation == Qt::Vertical].isDefault()) {
- QStyle *style = styleInfo.style();
- QStyleOption option;
- option.initFrom(styleInfo.widget());
- qreal defaultSpacing = (qreal)style->pixelMetric(orientation == Qt::Vertical ? QStyle::PM_LayoutVerticalSpacing
- : QStyle::PM_LayoutHorizontalSpacing, &option, styleInfo.widget());
- q_defaultSpacings[orientation == Qt::Vertical].setCachedValue(defaultSpacing);
- }
- return q_defaultSpacings[orientation == Qt::Vertical].value();
-}
-
-void QGridLayoutEngine::setRowSpacing(int row, qreal spacing, Qt::Orientation orientation)
-{
- Q_ASSERT(row >= 0);
-
- QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
- if (row >= rowInfo.spacings.count())
- rowInfo.spacings.resize(row + 1);
- if (spacing >= 0)
- rowInfo.spacings[row].setUserValue(spacing);
- else
- rowInfo.spacings[row] = QLayoutParameter<qreal>();
- invalidate();
-}
-
-qreal QGridLayoutEngine::rowSpacing(int row, Qt::Orientation orientation) const
-{
- QLayoutParameter<qreal> spacing = q_infos[orientation == Qt::Vertical].spacings.value(row);
- if (!spacing.isDefault())
- return spacing.value();
- return q_defaultSpacings[orientation == Qt::Vertical].value();
-}
-
-void QGridLayoutEngine::setRowStretchFactor(int row, int stretch, Qt::Orientation orientation)
-{
- Q_ASSERT(row >= 0);
- Q_ASSERT(stretch >= 0);
-
- maybeExpandGrid(row, -1, orientation);
-
- QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
- if (row >= rowInfo.stretches.count())
- rowInfo.stretches.resize(row + 1);
- rowInfo.stretches[row].setUserValue(stretch);
-}
-
-int QGridLayoutEngine::rowStretchFactor(int row, Qt::Orientation orientation) const
-{
- QStretchParameter stretch = q_infos[orientation == Qt::Vertical].stretches.value(row);
- if (!stretch.isDefault())
- return stretch.value();
- return 0;
-}
-
-void QGridLayoutEngine::setStretchFactor(QGraphicsLayoutItem *layoutItem, int stretch,
- Qt::Orientation orientation)
-{
- Q_ASSERT(stretch >= 0);
-
- if (QGridLayoutItem *item = findLayoutItem(layoutItem))
- item->setStretchFactor(stretch, orientation);
-}
-
-int QGridLayoutEngine::stretchFactor(QGraphicsLayoutItem *layoutItem, Qt::Orientation orientation) const
-{
- if (QGridLayoutItem *item = findLayoutItem(layoutItem))
- return item->stretchFactor(orientation);
- return 0;
-}
-
-void QGridLayoutEngine::setRowSizeHint(Qt::SizeHint which, int row, qreal size,
- Qt::Orientation orientation)
-{
- Q_ASSERT(row >= 0);
- Q_ASSERT(size >= 0.0);
-
- maybeExpandGrid(row, -1, orientation);
-
- QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
- if (row >= rowInfo.boxes.count())
- rowInfo.boxes.resize(row + 1);
- rowInfo.boxes[row].q_sizes(which) = size;
-}
-
-qreal QGridLayoutEngine::rowSizeHint(Qt::SizeHint which, int row, Qt::Orientation orientation) const
-{
- return q_infos[orientation == Qt::Vertical].boxes.value(row).q_sizes(which);
-}
-
-void QGridLayoutEngine::setRowAlignment(int row, Qt::Alignment alignment,
- Qt::Orientation orientation)
-{
- Q_ASSERT(row >= 0);
-
- maybeExpandGrid(row, -1, orientation);
-
- QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
- if (row >= rowInfo.alignments.count())
- rowInfo.alignments.resize(row + 1);
- rowInfo.alignments[row] = alignment;
-}
-
-Qt::Alignment QGridLayoutEngine::rowAlignment(int row, Qt::Orientation orientation) const
-{
- Q_ASSERT(row >= 0);
- return q_infos[orientation == Qt::Vertical].alignments.value(row);
-}
-
-void QGridLayoutEngine::setAlignment(QGraphicsLayoutItem *layoutItem, Qt::Alignment alignment)
-{
- if (QGridLayoutItem *item = findLayoutItem(layoutItem))
- item->setAlignment(alignment);
- invalidate();
-}
-
-Qt::Alignment QGridLayoutEngine::alignment(QGraphicsLayoutItem *layoutItem) const
-{
- if (QGridLayoutItem *item = findLayoutItem(layoutItem))
- return item->alignment();
- return 0;
-}
-
-Qt::Alignment QGridLayoutEngine::effectiveAlignment(const QGridLayoutItem *layoutItem) const
-{
- Qt::Alignment align = layoutItem->alignment();
- if (!(align & Qt::AlignVertical_Mask)) {
- // no vertical alignment, respect the row alignment
- int y = layoutItem->firstRow();
- align |= (rowAlignment(y, Qt::Vertical) & Qt::AlignVertical_Mask);
- }
- if (!(align & Qt::AlignHorizontal_Mask)) {
- // no horizontal alignment, respect the column alignment
- int x = layoutItem->firstColumn();
- align |= (rowAlignment(x, Qt::Horizontal) & Qt::AlignHorizontal_Mask);
- }
- return align;
-}
-
-/*!
- \internal
- The \a index is only used by QGraphicsLinearLayout to ensure that itemAt() reflects the order
- of visual arrangement. Strictly speaking it does not have to, but most people expect it to.
- (And if it didn't we would have to add itemArrangedAt(int index) or something..)
- */
-void QGridLayoutEngine::insertItem(QGridLayoutItem *item, int index)
-{
- maybeExpandGrid(item->lastRow(), item->lastColumn());
-
- if (index == -1)
- q_items.append(item);
- else
- q_items.insert(index, item);
-
- for (int i = item->firstRow(); i <= item->lastRow(); ++i) {
- for (int j = item->firstColumn(); j <= item->lastColumn(); ++j) {
- if (itemAt(i, j))
- qWarning("QGridLayoutEngine::addItem: Cell (%d, %d) already taken", i, j);
- setItemAt(i, j, item);
- }
- }
-}
-
-void QGridLayoutEngine::addItem(QGridLayoutItem *item)
-{
- insertItem(item, -1);
-}
-
-void QGridLayoutEngine::removeItem(QGridLayoutItem *item)
-{
- Q_ASSERT(q_items.contains(item));
-
- invalidate();
-
- for (int i = item->firstRow(); i <= item->lastRow(); ++i) {
- for (int j = item->firstColumn(); j <= item->lastColumn(); ++j) {
- if (itemAt(i, j) == item)
- setItemAt(i, j, 0);
- }
- }
-
- q_items.removeAll(item);
-}
-
-QGridLayoutItem *QGridLayoutEngine::findLayoutItem(QGraphicsLayoutItem *layoutItem) const
-{
- for (int i = q_items.count() - 1; i >= 0; --i) {
- QGridLayoutItem *item = q_items.at(i);
- if (item->layoutItem() == layoutItem)
- return item;
- }
- return 0;
-}
-
-QGridLayoutItem *QGridLayoutEngine::itemAt(int row, int column, Qt::Orientation orientation) const
-{
- if (orientation == Qt::Horizontal)
- qSwap(row, column);
- if (uint(row) >= uint(rowCount()) || uint(column) >= uint(columnCount()))
- return 0;
- return q_grid.at((row * internalGridColumnCount()) + column);
-}
-
-void QGridLayoutEngine::invalidate()
-{
- q_cachedEffectiveFirstRows[Hor] = -1;
- q_cachedEffectiveFirstRows[Ver] = -1;
- q_cachedEffectiveLastRows[Hor] = -1;
- q_cachedEffectiveLastRows[Ver] = -1;
- q_cachedDataForStyleInfo.invalidate();
- q_cachedSize = QSizeF();
- q_cachedConstraintOrientation = UnknownConstraint;
-}
-
-static void visualRect(QRectF *geom, Qt::LayoutDirection dir, const QRectF &contentsRect)
-{
- if (dir == Qt::RightToLeft)
- geom->moveRight(contentsRect.right() - (geom->left() - contentsRect.left()));
-}
-
-void QGridLayoutEngine::setGeometries(const QLayoutStyleInfo &styleInfo,
- const QRectF &contentsGeometry)
-{
- if (rowCount() < 1 || columnCount() < 1)
- return;
-
- ensureGeometries(styleInfo, contentsGeometry.size());
-
- for (int i = q_items.count() - 1; i >= 0; --i) {
- QGridLayoutItem *item = q_items.at(i);
-
- qreal x = q_xx[item->firstColumn()];
- qreal y = q_yy[item->firstRow()];
- qreal width = q_widths[item->lastColumn()];
- qreal height = q_heights[item->lastRow()];
-
- if (item->columnSpan() != 1)
- width += q_xx[item->lastColumn()] - x;
- if (item->rowSpan() != 1)
- height += q_yy[item->lastRow()] - y;
-
- QRectF geom = item->geometryWithin(contentsGeometry.x() + x, contentsGeometry.y() + y,
- width, height, q_descents[item->lastRow()]);
- visualRect(&geom, visualDirection(), contentsGeometry);
- item->setGeometry(geom);
- }
-}
-
-// ### candidate for deletion
-QRectF QGridLayoutEngine::cellRect(const QLayoutStyleInfo &styleInfo,
- const QRectF &contentsGeometry, int row, int column, int rowSpan,
- int columnSpan) const
-{
- if (uint(row) >= uint(rowCount()) || uint(column) >= uint(columnCount())
- || rowSpan < 1 || columnSpan < 1)
- return QRectF();
-
- ensureGeometries(styleInfo, contentsGeometry.size());
-
- int lastColumn = qMax(column + columnSpan, columnCount()) - 1;
- int lastRow = qMax(row + rowSpan, rowCount()) - 1;
-
- qreal x = q_xx[column];
- qreal y = q_yy[row];
- qreal width = q_widths[lastColumn];
- qreal height = q_heights[lastRow];
-
- if (columnSpan != 1)
- width += q_xx[lastColumn] - x;
- if (rowSpan != 1)
- height += q_yy[lastRow] - y;
-
- return QRectF(contentsGeometry.x() + x, contentsGeometry.y() + y, width, height);
-}
-
-QSizeF QGridLayoutEngine::sizeHint(const QLayoutStyleInfo &styleInfo, Qt::SizeHint which,
- const QSizeF &constraint) const
-{
- QGridLayoutBox sizehint_totalBoxes[NOrientations];
-
- bool sizeHintCalculated = false;
-
- if (hasDynamicConstraint() && rowCount() > 0 && columnCount() > 0) {
- if (constraintOrientation() == Qt::Vertical) {
- //We have items whose height depends on their width
- if (constraint.width() >= 0) {
- if (q_cachedDataForStyleInfo != styleInfo)
- ensureColumnAndRowData(&q_columnData, &sizehint_totalBoxes[Hor], styleInfo, NULL, NULL, Qt::Horizontal);
- else
- sizehint_totalBoxes[Hor] = q_totalBoxes[Hor];
- QVector<qreal> sizehint_xx;
- QVector<qreal> sizehint_widths;
-
- sizehint_xx.resize(columnCount());
- sizehint_widths.resize(columnCount());
- qreal width = constraint.width();
- //Calculate column widths and positions, and put results in q_xx.data() and q_widths.data() so that we can use this information as
- //constraints to find the row heights
- q_columnData.calculateGeometries(0, columnCount(), width, sizehint_xx.data(), sizehint_widths.data(),
- 0, sizehint_totalBoxes[Hor], q_infos[Hor]);
- ensureColumnAndRowData(&q_rowData, &sizehint_totalBoxes[Ver], styleInfo, sizehint_xx.data(), sizehint_widths.data(), Qt::Vertical);
- sizeHintCalculated = true;
- }
- } else {
- if (constraint.height() >= 0) {
- //We have items whose width depends on their height
- ensureColumnAndRowData(&q_rowData, &sizehint_totalBoxes[Ver], styleInfo, NULL, NULL, Qt::Vertical);
- QVector<qreal> sizehint_yy;
- QVector<qreal> sizehint_heights;
-
- sizehint_yy.resize(rowCount());
- sizehint_heights.resize(rowCount());
- qreal height = constraint.height();
- //Calculate row heights and positions, and put results in q_yy.data() and q_heights.data() so that we can use this information as
- //constraints to find the column widths
- q_rowData.calculateGeometries(0, rowCount(), height, sizehint_yy.data(), sizehint_heights.data(),
- 0, sizehint_totalBoxes[Ver], q_infos[Ver]);
- ensureColumnAndRowData(&q_columnData, &sizehint_totalBoxes[Hor], styleInfo, sizehint_yy.data(), sizehint_heights.data(), Qt::Horizontal);
- sizeHintCalculated = true;
- }
- }
- }
-
- if (!sizeHintCalculated) {
- //No items with height for width, so it doesn't matter which order we do these in
- if (q_cachedDataForStyleInfo != styleInfo) {
- ensureColumnAndRowData(&q_columnData, &sizehint_totalBoxes[Hor], styleInfo, NULL, NULL, Qt::Horizontal);
- ensureColumnAndRowData(&q_rowData, &sizehint_totalBoxes[Ver], styleInfo, NULL, NULL, Qt::Vertical);
- } else {
- sizehint_totalBoxes[Hor] = q_totalBoxes[Hor];
- sizehint_totalBoxes[Ver] = q_totalBoxes[Ver];
- }
- }
-
- switch (which) {
- case Qt::MinimumSize:
- return QSizeF(sizehint_totalBoxes[Hor].q_minimumSize, sizehint_totalBoxes[Ver].q_minimumSize);
- case Qt::PreferredSize:
- return QSizeF(sizehint_totalBoxes[Hor].q_preferredSize, sizehint_totalBoxes[Ver].q_preferredSize);
- case Qt::MaximumSize:
- return QSizeF(sizehint_totalBoxes[Hor].q_maximumSize, sizehint_totalBoxes[Ver].q_maximumSize);
- case Qt::MinimumDescent:
- return QSizeF(-1.0, sizehint_totalBoxes[Hor].q_minimumDescent); // ### doesn't work
- default:
- break;
- }
- return QSizeF();
-}
-
-QSizePolicy::ControlTypes QGridLayoutEngine::controlTypes(LayoutSide side) const
-{
- Qt::Orientation orientation = (side == Top || side == Bottom) ? Qt::Vertical : Qt::Horizontal;
- int row = (side == Top || side == Left) ? effectiveFirstRow(orientation)
- : effectiveLastRow(orientation);
- QSizePolicy::ControlTypes result = 0;
-
- for (int column = columnCount(orientation) - 1; column >= 0; --column) {
- if (QGridLayoutItem *item = itemAt(row, column, orientation))
- result |= item->controlTypes(side);
- }
- return result;
-}
-
-void QGridLayoutEngine::transpose()
-{
- invalidate();
-
- for (int i = q_items.count() - 1; i >= 0; --i)
- q_items.at(i)->transpose();
-
- qSwap(q_defaultSpacings[Hor], q_defaultSpacings[Ver]);
- qSwap(q_infos[Hor], q_infos[Ver]);
-
- regenerateGrid();
-}
-
-void QGridLayoutEngine::setVisualDirection(Qt::LayoutDirection direction)
-{
- m_visualDirection = direction;
-}
-
-Qt::LayoutDirection QGridLayoutEngine::visualDirection() const
-{
- return m_visualDirection;
-}
-
-#ifdef QT_DEBUG
-void QGridLayoutEngine::dump(int indent) const
-{
- qDebug("%*sEngine", indent, "");
-
- qDebug("%*s Items (%d)", indent, "", q_items.count());
- int i;
- for (i = 0; i < q_items.count(); ++i)
- q_items.at(i)->dump(indent + 2);
-
- qDebug("%*s Grid (%d x %d)", indent, "", internalGridRowCount(),
- internalGridColumnCount());
- for (int row = 0; row < internalGridRowCount(); ++row) {
- QString message = QLatin1String("[ ");
- for (int column = 0; column < internalGridColumnCount(); ++column) {
- message += QString::number(q_items.indexOf(itemAt(row, column))).rightJustified(3);
- message += QLatin1Char(' ');
- }
- message += QLatin1Char(']');
- qDebug("%*s %s", indent, "", qPrintable(message));
- }
-
- if (q_defaultSpacings[Hor].value() >= 0.0 || q_defaultSpacings[Ver].value() >= 0.0)
- qDebug("%*s Default spacings: %g %g", indent, "", q_defaultSpacings[Hor].value(),
- q_defaultSpacings[Ver].value());
-
- qDebug("%*s Column and row info", indent, "");
- q_infos[Hor].dump(indent + 2);
- q_infos[Ver].dump(indent + 2);
-
- qDebug("%*s Column and row data", indent, "");
- q_columnData.dump(indent + 2);
- q_rowData.dump(indent + 2);
-
- qDebug("%*s Geometries output", indent, "");
- QVector<qreal> *cellPos = &q_yy;
- for (int pass = 0; pass < 2; ++pass) {
- QString message;
- for (i = 0; i < cellPos->count(); ++i) {
- message += QLatin1String((message.isEmpty() ? "[" : ", "));
- message += QString::number(cellPos->at(i));
- }
- message += QLatin1Char(']');
- qDebug("%*s %s %s", indent, "", (pass == 0 ? "rows:" : "columns:"), qPrintable(message));
- cellPos = &q_xx;
- }
-}
-#endif
-
-void QGridLayoutEngine::maybeExpandGrid(int row, int column, Qt::Orientation orientation)
-{
- invalidate(); // ### move out of here?
-
- if (orientation == Qt::Horizontal)
- qSwap(row, column);
-
- if (row < rowCount() && column < columnCount())
- return;
-
- int oldGridRowCount = internalGridRowCount();
- int oldGridColumnCount = internalGridColumnCount();
-
- q_infos[Ver].count = qMax(row + 1, rowCount());
- q_infos[Hor].count = qMax(column + 1, columnCount());
-
- int newGridRowCount = internalGridRowCount();
- int newGridColumnCount = internalGridColumnCount();
-
- int newGridSize = newGridRowCount * newGridColumnCount;
- if (newGridSize != q_grid.count()) {
- q_grid.resize(newGridSize);
-
- if (newGridColumnCount != oldGridColumnCount) {
- for (int i = oldGridRowCount - 1; i >= 1; --i) {
- for (int j = oldGridColumnCount - 1; j >= 0; --j) {
- int oldIndex = (i * oldGridColumnCount) + j;
- int newIndex = (i * newGridColumnCount) + j;
-
- Q_ASSERT(newIndex > oldIndex);
- q_grid[newIndex] = q_grid[oldIndex];
- q_grid[oldIndex] = 0;
- }
- }
- }
- }
-}
-
-void QGridLayoutEngine::regenerateGrid()
-{
- q_grid.fill(0);
-
- for (int i = q_items.count() - 1; i >= 0; --i) {
- QGridLayoutItem *item = q_items.at(i);
-
- for (int j = item->firstRow(); j <= item->lastRow(); ++j) {
- for (int k = item->firstColumn(); k <= item->lastColumn(); ++k) {
- setItemAt(j, k, item);
- }
- }
- }
-}
-
-void QGridLayoutEngine::setItemAt(int row, int column, QGridLayoutItem *item)
-{
- Q_ASSERT(row >= 0 && row < rowCount());
- Q_ASSERT(column >= 0 && column < columnCount());
- q_grid[(row * internalGridColumnCount()) + column] = item;
-}
-
-void QGridLayoutEngine::insertOrRemoveRows(int row, int delta, Qt::Orientation orientation)
-{
- int oldRowCount = rowCount(orientation);
- Q_ASSERT(uint(row) <= uint(oldRowCount));
-
- invalidate();
-
- // appending rows (or columns) is easy
- if (row == oldRowCount && delta > 0) {
- maybeExpandGrid(oldRowCount + delta - 1, -1, orientation);
- return;
- }
-
- q_infos[orientation == Qt::Vertical].insertOrRemoveRows(row, delta);
-
- for (int i = q_items.count() - 1; i >= 0; --i)
- q_items.at(i)->insertOrRemoveRows(row, delta, orientation);
-
- q_grid.resize(internalGridRowCount() * internalGridColumnCount());
- regenerateGrid();
-}
-
-void QGridLayoutEngine::fillRowData(QGridLayoutRowData *rowData, const QLayoutStyleInfo &styleInfo,
- qreal *colPositions, qreal *colSizes,
- Qt::Orientation orientation) const
-{
- const int ButtonMask = QSizePolicy::ButtonBox | QSizePolicy::PushButton;
- const QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
- const QGridLayoutRowInfo &columnInfo = q_infos[orientation == Qt::Horizontal];
- LayoutSide top = (orientation == Qt::Vertical) ? Top : Left;
- LayoutSide bottom = (orientation == Qt::Vertical) ? Bottom : Right;
-
- QStyle *style = styleInfo.style();
- QStyleOption option;
- option.initFrom(styleInfo.widget());
-
- const QLayoutParameter<qreal> &defaultSpacing = q_defaultSpacings[orientation == Qt::Vertical];
- qreal innerSpacing = 0.0;
- if (style)
- innerSpacing = (qreal)style->pixelMetric(orientation == Qt::Vertical ? QStyle::PM_LayoutVerticalSpacing
- : QStyle::PM_LayoutHorizontalSpacing,
- &option, styleInfo.widget());
- if (innerSpacing >= 0.0)
- defaultSpacing.setCachedValue(innerSpacing);
-
- for (int row = 0; row < rowInfo.count; ++row) {
- bool rowIsEmpty = true;
- bool rowIsIdenticalToPrevious = (row > 0);
-
- for (int column = 0; column < columnInfo.count; ++column) {
- QGridLayoutItem *item = itemAt(row, column, orientation);
-
- if (rowIsIdenticalToPrevious && item != itemAt(row - 1, column, orientation))
- rowIsIdenticalToPrevious = false;
-
- if (item)
- rowIsEmpty = false;
- }
-
- if ((rowIsEmpty || rowIsIdenticalToPrevious)
- && rowInfo.spacings.value(row).isDefault()
- && rowInfo.stretches.value(row).isDefault()
- && rowInfo.boxes.value(row) == QGridLayoutBox())
- rowData->ignore.setBit(row, true);
-
- if (rowInfo.spacings.value(row).isUser()) {
- rowData->spacings[row] = rowInfo.spacings.at(row).value();
- } else if (!defaultSpacing.isDefault()) {
- rowData->spacings[row] = defaultSpacing.value();
- }
-
- rowData->stretches[row] = rowInfo.stretches.value(row).value();
- }
-
- struct RowAdHocData {
- int q_row;
- unsigned int q_hasButtons : 8;
- unsigned int q_hasNonButtons : 8;
-
- inline RowAdHocData() : q_row(-1), q_hasButtons(false), q_hasNonButtons(false) {}
- inline void init(int row) {
- this->q_row = row;
- q_hasButtons = false;
- q_hasNonButtons = false;
- }
- inline bool hasOnlyButtons() const { return q_hasButtons && !q_hasNonButtons; }
- inline bool hasOnlyNonButtons() const { return q_hasNonButtons && !q_hasButtons; }
- };
- RowAdHocData lastRowAdHocData;
- RowAdHocData nextToLastRowAdHocData;
- RowAdHocData nextToNextToLastRowAdHocData;
-
- rowData->hasIgnoreFlag = false;
- for (int row = 0; row < rowInfo.count; ++row) {
- if (rowData->ignore.testBit(row))
- continue;
-
- QGridLayoutBox &rowBox = rowData->boxes[row];
- if (option.state & QStyle::State_Window) {
- nextToNextToLastRowAdHocData = nextToLastRowAdHocData;
- nextToLastRowAdHocData = lastRowAdHocData;
- lastRowAdHocData.init(row);
- }
-
- bool userRowStretch = rowInfo.stretches.value(row).isUser();
- int &rowStretch = rowData->stretches[row];
-
- bool hasIgnoreFlag = true;
- for (int column = 0; column < columnInfo.count; ++column) {
- QGridLayoutItem *item = itemAt(row, column, orientation);
- if (item) {
- int itemRow = item->firstRow(orientation);
- int itemColumn = item->firstColumn(orientation);
-
- if (itemRow == row && itemColumn == column) {
- int itemStretch = item->stretchFactor(orientation);
- if (!(item->sizePolicy(orientation) & QSizePolicy::IgnoreFlag))
- hasIgnoreFlag = false;
- int itemRowSpan = item->rowSpan(orientation);
-
- int effectiveRowSpan = 1;
- for (int i = 1; i < itemRowSpan; ++i) {
- if (!rowData->ignore.testBit(i + itemRow))
- ++effectiveRowSpan;
- }
-
- QGridLayoutBox *box;
- if (effectiveRowSpan == 1) {
- box = &rowBox;
- if (!userRowStretch && itemStretch != 0)
- rowStretch = qMax(rowStretch, itemStretch);
- } else {
- QGridLayoutMultiCellData &multiCell =
- rowData->multiCellMap[qMakePair(row, effectiveRowSpan)];
- box = &multiCell.q_box;
- multiCell.q_stretch = itemStretch;
- }
- // Items with constraints need to be passed the constraint
- if (colSizes && colPositions && item->hasDynamicConstraint() && orientation == item->dynamicConstraintOrientation()) {
- /* Get the width of the item by summing up the widths of the columns that it spans.
- * We need to have already calculated the widths of the columns by calling
- * q_columns->calculateGeometries() before hand and passing the value in the colSizes
- * and colPositions parameters.
- * The variable name is still colSizes even when it actually has the row sizes
- */
- qreal length = colSizes[item->lastColumn(orientation)];
- if (item->columnSpan(orientation) != 1)
- length += colPositions[item->lastColumn(orientation)] - colPositions[item->firstColumn(orientation)];
- box->combine(item->box(orientation, length));
- } else {
- box->combine(item->box(orientation));
- }
-
- if (effectiveRowSpan == 1) {
- QSizePolicy::ControlTypes controls = item->controlTypes(top);
- if (controls & ButtonMask)
- lastRowAdHocData.q_hasButtons = true;
- if (controls & ~ButtonMask)
- lastRowAdHocData.q_hasNonButtons = true;
- }
- }
- }
- }
- if (row < rowInfo.boxes.count()) {
- QGridLayoutBox rowBoxInfo = rowInfo.boxes.at(row);
- rowBoxInfo.normalize();
- rowBox.q_minimumSize = qMax(rowBox.q_minimumSize, rowBoxInfo.q_minimumSize);
- rowBox.q_maximumSize = qMax(rowBox.q_minimumSize,
- (rowBoxInfo.q_maximumSize != FLT_MAX ?
- rowBoxInfo.q_maximumSize : rowBox.q_maximumSize));
- rowBox.q_preferredSize = qBound(rowBox.q_minimumSize,
- qMax(rowBox.q_preferredSize, rowBoxInfo.q_preferredSize),
- rowBox.q_maximumSize);
- }
- if (hasIgnoreFlag)
- rowData->hasIgnoreFlag = true;
- }
-
- /*
- Heuristic: Detect button boxes that don't use QSizePolicy::ButtonBox.
- This is somewhat ad hoc but it usually does the trick.
- */
- bool lastRowIsButtonBox = (lastRowAdHocData.hasOnlyButtons()
- && nextToLastRowAdHocData.hasOnlyNonButtons());
- bool lastTwoRowsIsButtonBox = (lastRowAdHocData.hasOnlyButtons()
- && nextToLastRowAdHocData.hasOnlyButtons()
- && nextToNextToLastRowAdHocData.hasOnlyNonButtons()
- && orientation == Qt::Vertical);
-
- if (defaultSpacing.isDefault()) {
- int prevRow = -1;
- for (int row = 0; row < rowInfo.count; ++row) {
- if (rowData->ignore.testBit(row))
- continue;
-
- if (prevRow != -1 && !rowInfo.spacings.value(prevRow).isUser()) {
- qreal &rowSpacing = rowData->spacings[prevRow];
- for (int column = 0; column < columnInfo.count; ++column) {
- QGridLayoutItem *item1 = itemAt(prevRow, column, orientation);
- QGridLayoutItem *item2 = itemAt(row, column, orientation);
-
- if (item1 && item2 && item1 != item2) {
- QSizePolicy::ControlTypes controls1 = item1->controlTypes(bottom);
- QSizePolicy::ControlTypes controls2 = item2->controlTypes(top);
-
- if (controls2 & QSizePolicy::PushButton) {
- if ((row == nextToLastRowAdHocData.q_row && lastTwoRowsIsButtonBox)
- || (row == lastRowAdHocData.q_row && lastRowIsButtonBox)) {
- controls2 &= ~QSizePolicy::PushButton;
- controls2 |= QSizePolicy::ButtonBox;
- }
- }
-
- qreal spacing = style->combinedLayoutSpacing(controls1, controls2,
- orientation, &option,
- styleInfo.widget());
- if (orientation == Qt::Horizontal) {
- qreal width1 = rowData->boxes.at(prevRow).q_minimumSize;
- qreal width2 = rowData->boxes.at(row).q_minimumSize;
- QRectF rect1 = item1->geometryWithin(0.0, 0.0, width1, FLT_MAX, -1.0);
- QRectF rect2 = item2->geometryWithin(0.0, 0.0, width2, FLT_MAX, -1.0);
- spacing -= (width1 - (rect1.x() + rect1.width())) + rect2.x();
- } else {
- const QGridLayoutBox &box1 = rowData->boxes.at(prevRow);
- const QGridLayoutBox &box2 = rowData->boxes.at(row);
- qreal height1 = box1.q_minimumSize;
- qreal height2 = box2.q_minimumSize;
- qreal rowDescent1 = fixedDescent(box1.q_minimumDescent,
- box1.q_minimumAscent, height1);
- qreal rowDescent2 = fixedDescent(box2.q_minimumDescent,
- box2.q_minimumAscent, height2);
- QRectF rect1 = item1->geometryWithin(0.0, 0.0, FLT_MAX, height1,
- rowDescent1);
- QRectF rect2 = item2->geometryWithin(0.0, 0.0, FLT_MAX, height2,
- rowDescent2);
- spacing -= (height1 - (rect1.y() + rect1.height())) + rect2.y();
- }
- rowSpacing = qMax(spacing, rowSpacing);
- }
- }
- }
- prevRow = row;
- }
- } else if (lastRowIsButtonBox || lastTwoRowsIsButtonBox) {
- /*
- Even for styles that define a uniform spacing, we cheat a
- bit and use the window margin as the spacing. This
- significantly improves the look of dialogs.
- */
- int prevRow = lastRowIsButtonBox ? nextToLastRowAdHocData.q_row
- : nextToNextToLastRowAdHocData.q_row;
- if (!defaultSpacing.isUser() && !rowInfo.spacings.value(prevRow).isUser()) {
- qreal windowMargin = style->pixelMetric(orientation == Qt::Vertical
- ? QStyle::PM_LayoutBottomMargin
- : QStyle::PM_LayoutRightMargin,
- &option, styleInfo.widget());
-
- qreal &rowSpacing = rowData->spacings[prevRow];
- rowSpacing = qMax(windowMargin, rowSpacing);
- }
- }
-}
-
-void QGridLayoutEngine::ensureEffectiveFirstAndLastRows() const
-{
- if (q_cachedEffectiveFirstRows[Hor] == -1 && !q_items.isEmpty()) {
- int rowCount = this->rowCount();
- int columnCount = this->columnCount();
-
- q_cachedEffectiveFirstRows[Ver] = rowCount;
- q_cachedEffectiveFirstRows[Hor] = columnCount;
- q_cachedEffectiveLastRows[Ver] = -1;
- q_cachedEffectiveLastRows[Hor] = -1;
-
- for (int i = q_items.count() - 1; i >= 0; --i) {
- const QGridLayoutItem *item = q_items.at(i);
-
- for (int j = 0; j < NOrientations; ++j) {
- Qt::Orientation orientation = (j == Hor) ? Qt::Horizontal : Qt::Vertical;
- if (item->firstRow(orientation) < q_cachedEffectiveFirstRows[j])
- q_cachedEffectiveFirstRows[j] = item->firstRow(orientation);
- if (item->lastRow(orientation) > q_cachedEffectiveLastRows[j])
- q_cachedEffectiveLastRows[j] = item->lastRow(orientation);
- }
- }
- }
-}
-
-void QGridLayoutEngine::ensureColumnAndRowData(QGridLayoutRowData *rowData, QGridLayoutBox *totalBox,
- const QLayoutStyleInfo &styleInfo,
- qreal *colPositions, qreal *colSizes,
- Qt::Orientation orientation) const
-{
- rowData->reset(rowCount(orientation));
- fillRowData(rowData, styleInfo, colPositions, colSizes, orientation);
- const QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
- rowData->distributeMultiCells(rowInfo);
- *totalBox = rowData->totalBox(0, rowCount(orientation));
- //We have items whose width depends on their height
-}
-
-/**
- returns \c false if the layout has contradicting constraints (i.e. some items with a horizontal
- constraint and other items with a vertical constraint)
- */
-bool QGridLayoutEngine::ensureDynamicConstraint() const
-{
- if (q_cachedConstraintOrientation == UnknownConstraint) {
- for (int i = q_items.count() - 1; i >= 0; --i) {
- QGridLayoutItem *item = q_items.at(i);
- if (item->hasDynamicConstraint()) {
- Qt::Orientation itemConstraintOrientation = item->dynamicConstraintOrientation();
- if (q_cachedConstraintOrientation == UnknownConstraint) {
- q_cachedConstraintOrientation = itemConstraintOrientation;
- } else if (q_cachedConstraintOrientation != itemConstraintOrientation) {
- q_cachedConstraintOrientation = UnfeasibleConstraint;
- qWarning("QGridLayoutEngine: Unfeasible, cannot mix horizontal and"
- " vertical constraint in the same layout");
- return false;
- }
- }
- }
- if (q_cachedConstraintOrientation == UnknownConstraint)
- q_cachedConstraintOrientation = NoConstraint;
- }
- return true;
-}
-
-bool QGridLayoutEngine::hasDynamicConstraint() const
-{
- if (!ensureDynamicConstraint())
- return false;
- return q_cachedConstraintOrientation != NoConstraint;
-}
-
-/*
- * return value is only valid if hasConstraint() returns \c true
- */
-Qt::Orientation QGridLayoutEngine::constraintOrientation() const
-{
- (void)ensureDynamicConstraint();
- return (Qt::Orientation)q_cachedConstraintOrientation;
-}
-
-void QGridLayoutEngine::ensureGeometries(const QLayoutStyleInfo &styleInfo,
- const QSizeF &size) const
-{
- if (q_cachedDataForStyleInfo == styleInfo && q_cachedSize == size)
- return;
-
- q_cachedDataForStyleInfo = styleInfo;
- q_cachedSize = size;
-
- q_xx.resize(columnCount());
- q_widths.resize(columnCount());
- q_yy.resize(rowCount());
- q_heights.resize(rowCount());
- q_descents.resize(rowCount());
-
- if (constraintOrientation() != Qt::Horizontal) {
- // We might have items whose height depends on their width,
- // or none of the items has a dynamic constraint.
- ensureColumnAndRowData(&q_columnData, &q_totalBoxes[Hor], styleInfo, NULL, NULL, Qt::Horizontal);
- //Calculate column widths and positions, and put results in q_xx.data() and q_widths.data() so that we can use this information as
- //constraints to find the row heights
- q_columnData.calculateGeometries(0, columnCount(), size.width(), q_xx.data(), q_widths.data(),
- 0, q_totalBoxes[Hor], q_infos[Hor] );
- ensureColumnAndRowData(&q_rowData, &q_totalBoxes[Ver], styleInfo, q_xx.data(), q_widths.data(), Qt::Vertical);
- //Calculate row heights and positions, and put results in q_yy.data() and q_heights.data()
- q_rowData.calculateGeometries(0, rowCount(), size.height(), q_yy.data(), q_heights.data(),
- q_descents.data(), q_totalBoxes[Ver], q_infos[Ver]);
- } else {
- // We have items whose width depends on their height
- ensureColumnAndRowData(&q_rowData, &q_totalBoxes[Ver], styleInfo, NULL, NULL, Qt::Vertical);
- //Calculate row heights and positions, and put results in q_yy.data() and q_heights.data() so that we can use this information as
- //constraints to find the column widths
- q_rowData.calculateGeometries(0, rowCount(), size.height(), q_yy.data(), q_heights.data(),
- q_descents.data(), q_totalBoxes[Ver], q_infos[Ver]);
- ensureColumnAndRowData(&q_columnData, &q_totalBoxes[Hor], styleInfo, q_yy.data(), q_heights.data(), Qt::Horizontal);
- //Calculate row heights and positions, and put results in q_yy.data() and q_heights.data()
- q_columnData.calculateGeometries(0, columnCount(), size.width(), q_xx.data(), q_widths.data(),
- 0, q_totalBoxes[Hor], q_infos[Hor]);
- }
-}
-
-QT_END_NAMESPACE
-
-#endif //QT_NO_GRAPHICSVIEW
diff --git a/src/widgets/graphicsview/qgridlayoutengine_p.h b/src/widgets/graphicsview/qgridlayoutengine_p.h
deleted file mode 100644
index fbc5bd6ad2..0000000000
--- a/src/widgets/graphicsview/qgridlayoutengine_p.h
+++ /dev/null
@@ -1,458 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtWidgets module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGRIDLAYOUTENGINE_P_H
-#define QGRIDLAYOUTENGINE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of the graphics view layout classes. This header
-// file may change from version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qalgorithms.h"
-#include "qbitarray.h"
-#include "qlist.h"
-#include "qmap.h"
-#include "qpair.h"
-#include "qvector.h"
-#include "qgraphicslayout_p.h"
-#include <float.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGraphicsLayoutItem;
-class QStyle;
-class QWidget;
-
-// ### deal with Descent in a similar way
-enum {
- MinimumSize = Qt::MinimumSize,
- PreferredSize = Qt::PreferredSize,
- MaximumSize = Qt::MaximumSize,
- NSizes
-};
-
-// do not reorder
-enum {
- Hor,
- Ver,
- NOrientations
-};
-
-// do not reorder
-enum LayoutSide {
- Left,
- Top,
- Right,
- Bottom
-};
-
-enum {
- NoConstraint,
- HorizontalConstraint, // Width depends on the height
- VerticalConstraint, // Height depends on the width
- UnknownConstraint, // need to update cache
- UnfeasibleConstraint // not feasible, it be has some items with Vertical and others with Horizontal constraints
-};
-
-template <typename T>
-class QLayoutParameter
-{
-public:
- enum State { Default, User, Cached };
-
- inline QLayoutParameter() : q_value(T()), q_state(Default) {}
- inline QLayoutParameter(T value, State state = Default) : q_value(value), q_state(state) {}
-
- inline void setUserValue(T value) {
- q_value = value;
- q_state = User;
- }
- inline void setCachedValue(T value) const {
- if (q_state != User) {
- q_value = value;
- q_state = Cached;
- }
- }
- inline T value() const { return q_value; }
- inline T value(T defaultValue) const { return isUser() ? q_value : defaultValue; }
- inline bool isDefault() const { return q_state == Default; }
- inline bool isUser() const { return q_state == User; }
- inline bool isCached() const { return q_state == Cached; }
-
-private:
- mutable T q_value;
- mutable State q_state;
-};
-
-class QStretchParameter : public QLayoutParameter<int>
-{
-public:
- QStretchParameter() : QLayoutParameter<int>(-1) {}
-
-};
-
-class QGridLayoutBox
-{
-public:
- inline QGridLayoutBox()
- : q_minimumSize(0), q_preferredSize(0), q_maximumSize(FLT_MAX),
- q_minimumDescent(-1), q_minimumAscent(-1) {}
-
- void add(const QGridLayoutBox &other, int stretch, qreal spacing);
- void combine(const QGridLayoutBox &other);
- void normalize();
-
-#ifdef QT_DEBUG
- void dump(int indent = 0) const;
-#endif
- // This code could use the union-struct-array trick, but a compiler
- // bug prevents this from working.
- qreal q_minimumSize;
- qreal q_preferredSize;
- qreal q_maximumSize;
- qreal q_minimumDescent;
- qreal q_minimumAscent;
- inline qreal &q_sizes(int which)
- {
- qreal *t;
- switch (which) {
- case Qt::MinimumSize:
- t = &q_minimumSize;
- break;
- case Qt::PreferredSize:
- t = &q_preferredSize;
- break;
- case Qt::MaximumSize:
- t = &q_maximumSize;
- break;
- case Qt::MinimumDescent:
- t = &q_minimumDescent;
- break;
- case (Qt::MinimumDescent + 1):
- t = &q_minimumAscent;
- break;
- default:
- t = 0;
- break;
- }
- return *t;
- }
- inline const qreal &q_sizes(int which) const
- {
- const qreal *t;
- switch (which) {
- case Qt::MinimumSize:
- t = &q_minimumSize;
- break;
- case Qt::PreferredSize:
- t = &q_preferredSize;
- break;
- case Qt::MaximumSize:
- t = &q_maximumSize;
- break;
- case Qt::MinimumDescent:
- t = &q_minimumDescent;
- break;
- case (Qt::MinimumDescent + 1):
- t = &q_minimumAscent;
- break;
- default:
- t = 0;
- break;
- }
- return *t;
- }
-};
-
-bool operator==(const QGridLayoutBox &box1, const QGridLayoutBox &box2);
-inline bool operator!=(const QGridLayoutBox &box1, const QGridLayoutBox &box2)
- { return !operator==(box1, box2); }
-
-class QGridLayoutMultiCellData
-{
-public:
- inline QGridLayoutMultiCellData() : q_stretch(-1) {}
-
- QGridLayoutBox q_box;
- int q_stretch;
-};
-
-typedef QMap<QPair<int, int>, QGridLayoutMultiCellData> MultiCellMap;
-
-class QGridLayoutRowInfo;
-
-class QGridLayoutRowData
-{
-public:
- void reset(int count);
- void distributeMultiCells(const QGridLayoutRowInfo &rowInfo);
- void calculateGeometries(int start, int end, qreal targetSize, qreal *positions, qreal *sizes,
- qreal *descents, const QGridLayoutBox &totalBox,
- const QGridLayoutRowInfo &rowInfo);
- QGridLayoutBox totalBox(int start, int end) const;
- void stealBox(int start, int end, int which, qreal *positions, qreal *sizes);
-
-#ifdef QT_DEBUG
- void dump(int indent = 0) const;
-#endif
-
- QBitArray ignore; // ### rename q_
- QVector<QGridLayoutBox> boxes;
- MultiCellMap multiCellMap;
- QVector<int> stretches;
- QVector<qreal> spacings;
- bool hasIgnoreFlag;
-};
-
-class QGridLayoutEngine;
-
-class QGridLayoutItem
-{
-public:
- QGridLayoutItem(QGridLayoutEngine *engine, QGraphicsLayoutItem *layoutItem, int row, int column,
- int rowSpan = 1, int columnSpan = 1, Qt::Alignment alignment = 0,
- int itemAtIndex = -1);
-
- inline int firstRow() const { return q_firstRows[Ver]; }
- inline int firstColumn() const { return q_firstRows[Hor]; }
- inline int rowSpan() const { return q_rowSpans[Ver]; }
- inline int columnSpan() const { return q_rowSpans[Hor]; }
- inline int lastRow() const { return firstRow() + rowSpan() - 1; }
- inline int lastColumn() const { return firstColumn() + columnSpan() - 1; }
-
- int firstRow(Qt::Orientation orientation) const;
- int firstColumn(Qt::Orientation orientation) const;
- int lastRow(Qt::Orientation orientation) const;
- int lastColumn(Qt::Orientation orientation) const;
- int rowSpan(Qt::Orientation orientation) const;
- int columnSpan(Qt::Orientation orientation) const;
- void setFirstRow(int row, Qt::Orientation orientation = Qt::Vertical);
- void setRowSpan(int rowSpan, Qt::Orientation orientation = Qt::Vertical);
-
- int stretchFactor(Qt::Orientation orientation) const;
- void setStretchFactor(int stretch, Qt::Orientation orientation);
-
- inline Qt::Alignment alignment() const { return q_alignment; }
- inline void setAlignment(Qt::Alignment alignment) { q_alignment = alignment; }
-
- QSizePolicy::Policy sizePolicy(Qt::Orientation orientation) const;
-
- bool hasDynamicConstraint() const;
- Qt::Orientation dynamicConstraintOrientation() const;
-
- QSizePolicy::ControlTypes controlTypes(LayoutSide side) const;
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
- QGridLayoutBox box(Qt::Orientation orientation, qreal constraint = -1.0) const;
- QRectF geometryWithin(qreal x, qreal y, qreal width, qreal height, qreal rowDescent) const;
-
- QGraphicsLayoutItem *layoutItem() const { return q_layoutItem; }
-
- void setGeometry(const QRectF &rect);
- void transpose();
- void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation = Qt::Vertical);
- QSizeF effectiveMaxSize(const QSizeF &constraint) const;
-
-#ifdef QT_DEBUG
- void dump(int indent = 0) const;
-#endif
-
-private:
- QGridLayoutEngine *q_engine; // ### needed?
- QGraphicsLayoutItem *q_layoutItem;
- int q_firstRows[NOrientations];
- int q_rowSpans[NOrientations];
- int q_stretches[NOrientations];
- Qt::Alignment q_alignment;
-};
-
-class QGridLayoutRowInfo
-{
-public:
- inline QGridLayoutRowInfo() : count(0) {}
-
- void insertOrRemoveRows(int row, int delta);
-
-#ifdef QT_DEBUG
- void dump(int indent = 0) const;
-#endif
-
- int count;
- QVector<QStretchParameter> stretches;
- QVector<QLayoutParameter<qreal> > spacings;
- QVector<Qt::Alignment> alignments;
- QVector<QGridLayoutBox> boxes;
-};
-
-class QGridLayoutEngine
-{
-public:
- QGridLayoutEngine();
- inline ~QGridLayoutEngine() { qDeleteAll(q_items); }
-
- int rowCount(Qt::Orientation orientation) const;
- int columnCount(Qt::Orientation orientation) const;
- inline int rowCount() const { return q_infos[Ver].count; }
- inline int columnCount() const { return q_infos[Hor].count; }
- // returns the number of items inserted, which may be less than (rowCount * columnCount)
- int itemCount() const;
- QGridLayoutItem *itemAt(int index) const;
- int indexOf(QGraphicsLayoutItem *item) const;
-
- int effectiveFirstRow(Qt::Orientation orientation = Qt::Vertical) const;
- int effectiveLastRow(Qt::Orientation orientation = Qt::Vertical) const;
-
- void setSpacing(qreal spacing, Qt::Orientations orientations);
- qreal spacing(const QLayoutStyleInfo &styleInfo, Qt::Orientation orientation) const;
- // ### setSpacingAfterRow(), spacingAfterRow()
- void setRowSpacing(int row, qreal spacing, Qt::Orientation orientation = Qt::Vertical);
- qreal rowSpacing(int row, Qt::Orientation orientation = Qt::Vertical) const;
-
- void setRowStretchFactor(int row, int stretch, Qt::Orientation orientation = Qt::Vertical);
- int rowStretchFactor(int row, Qt::Orientation orientation = Qt::Vertical) const;
-
- void setStretchFactor(QGraphicsLayoutItem *layoutItem, int stretch,
- Qt::Orientation orientation);
- int stretchFactor(QGraphicsLayoutItem *layoutItem, Qt::Orientation orientation) const;
-
- void setRowSizeHint(Qt::SizeHint which, int row, qreal size,
- Qt::Orientation orientation = Qt::Vertical);
- qreal rowSizeHint(Qt::SizeHint which, int row,
- Qt::Orientation orientation = Qt::Vertical) const;
-
- void setRowAlignment(int row, Qt::Alignment alignment, Qt::Orientation orientation);
- Qt::Alignment rowAlignment(int row, Qt::Orientation orientation) const;
-
- void setAlignment(QGraphicsLayoutItem *layoutItem, Qt::Alignment alignment);
- Qt::Alignment alignment(QGraphicsLayoutItem *layoutItem) const;
- Qt::Alignment effectiveAlignment(const QGridLayoutItem *layoutItem) const;
-
-
- void insertItem(QGridLayoutItem *item, int index);
- void addItem(QGridLayoutItem *item);
- void removeItem(QGridLayoutItem *item);
- QGridLayoutItem *findLayoutItem(QGraphicsLayoutItem *layoutItem) const;
- QGridLayoutItem *itemAt(int row, int column, Qt::Orientation orientation = Qt::Vertical) const;
- inline void insertRow(int row, Qt::Orientation orientation = Qt::Vertical)
- { insertOrRemoveRows(row, +1, orientation); }
- inline void removeRows(int row, int count, Qt::Orientation orientation)
- { insertOrRemoveRows(row, -count, orientation); }
-
- void invalidate();
- void setGeometries(const QLayoutStyleInfo &styleInfo, const QRectF &contentsGeometry);
- QRectF cellRect(const QLayoutStyleInfo &styleInfo, const QRectF &contentsGeometry, int row,
- int column, int rowSpan, int columnSpan) const;
- QSizeF sizeHint(const QLayoutStyleInfo &styleInfo, Qt::SizeHint which,
- const QSizeF &constraint) const;
-
- // heightForWidth / widthForHeight support
- QSizeF dynamicallyConstrainedSizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
- bool ensureDynamicConstraint() const;
- bool hasDynamicConstraint() const;
- Qt::Orientation constraintOrientation() const;
-
-
- QSizePolicy::ControlTypes controlTypes(LayoutSide side) const;
- void transpose();
- void setVisualDirection(Qt::LayoutDirection direction);
- Qt::LayoutDirection visualDirection() const;
-#ifdef QT_DEBUG
- void dump(int indent = 0) const;
-#endif
-
-private:
- static int grossRoundUp(int n) { return ((n + 2) | 0x3) - 2; }
-
- void maybeExpandGrid(int row, int column, Qt::Orientation orientation = Qt::Vertical);
- void regenerateGrid();
- inline int internalGridRowCount() const { return grossRoundUp(rowCount()); }
- inline int internalGridColumnCount() const { return grossRoundUp(columnCount()); }
- void setItemAt(int row, int column, QGridLayoutItem *item);
- void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation = Qt::Vertical);
- void fillRowData(QGridLayoutRowData *rowData, const QLayoutStyleInfo &styleInfo,
- qreal *colPositions, qreal *colSizes,
- Qt::Orientation orientation = Qt::Vertical) const;
- void ensureEffectiveFirstAndLastRows() const;
- void ensureColumnAndRowData(QGridLayoutRowData *rowData, QGridLayoutBox *totalBox,
- const QLayoutStyleInfo &styleInfo,
- qreal *colPositions, qreal *colSizes,
- Qt::Orientation orientation) const;
-
- void ensureGeometries(const QLayoutStyleInfo &styleInfo, const QSizeF &size) const;
-
- // User input
- QVector<QGridLayoutItem *> q_grid;
- QList<QGridLayoutItem *> q_items;
- QLayoutParameter<qreal> q_defaultSpacings[NOrientations];
- QGridLayoutRowInfo q_infos[NOrientations];
- Qt::LayoutDirection m_visualDirection;
-
- // Lazily computed from the above user input
- mutable int q_cachedEffectiveFirstRows[NOrientations];
- mutable int q_cachedEffectiveLastRows[NOrientations];
- mutable quint8 q_cachedConstraintOrientation : 3;
-
- // Layout item input
- mutable QLayoutStyleInfo q_cachedDataForStyleInfo;
- mutable QGridLayoutRowData q_columnData;
- mutable QGridLayoutRowData q_rowData;
- mutable QGridLayoutBox q_totalBoxes[NOrientations];
-
- // Output
- mutable QSizeF q_cachedSize;
- mutable QVector<qreal> q_xx;
- mutable QVector<qreal> q_yy;
- mutable QVector<qreal> q_widths;
- mutable QVector<qreal> q_heights;
- mutable QVector<qreal> q_descents;
-
- friend class QGridLayoutItem;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/widgets/graphicsview/qsimplex_p.cpp b/src/widgets/graphicsview/qsimplex_p.cpp
index a2437d8ab1..cf023dc8f1 100644
--- a/src/widgets/graphicsview/qsimplex_p.cpp
+++ b/src/widgets/graphicsview/qsimplex_p.cpp
@@ -509,7 +509,7 @@ bool QSimplex::iterate()
Both solveMin and solveMax are interfaces to this method.
- The enum solverFactor admits 2 values: Minimum (-1) and Maximum (+1).
+ The enum SolverFactor admits 2 values: Minimum (-1) and Maximum (+1).
This method sets the original objective and runs the second phase
Simplex to obtain the optimal solution for the problem. As the internal
@@ -517,7 +517,7 @@ bool QSimplex::iterate()
minimization case by inverting the original objective and then
maximizing it.
*/
-qreal QSimplex::solver(solverFactor factor)
+qreal QSimplex::solver(SolverFactor factor)
{
// Remove old objective
clearRow(0);
diff --git a/src/widgets/graphicsview/qsimplex_p.h b/src/widgets/graphicsview/qsimplex_p.h
index 842044fa7f..8cb295e7ef 100644
--- a/src/widgets/graphicsview/qsimplex_p.h
+++ b/src/widgets/graphicsview/qsimplex_p.h
@@ -149,9 +149,10 @@ struct QSimplexConstraint
class QSimplex
{
+ Q_DISABLE_COPY(QSimplex)
public:
QSimplex();
- virtual ~QSimplex();
+ ~QSimplex();
qreal solveMin();
qreal solveMax();
@@ -163,8 +164,8 @@ public:
private:
// Matrix handling
- qreal valueAt(int row, int column);
- void setValueAt(int row, int column, qreal value);
+ inline qreal valueAt(int row, int column);
+ inline void setValueAt(int row, int column, qreal value);
void clearRow(int rowIndex);
void clearColumns(int first, int last);
void combineRows(int toIndex, int fromIndex, qreal factor);
@@ -179,8 +180,8 @@ private:
// Helpers
void clearDataStructures();
void solveMaxHelper();
- enum solverFactor { Minimum = -1, Maximum = 1 };
- qreal solver(solverFactor factor);
+ enum SolverFactor { Minimum = -1, Maximum = 1 };
+ qreal solver(SolverFactor factor);
void collectResults();
QList<QSimplexConstraint *> constraints;
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 7edad74f54..771753b7da 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -2939,14 +2939,13 @@ void QAbstractItemView::keyboardSearch(const QString &search)
}
// search from start with wraparound
- const QString searchString = sameKey ? QString(d->keyboardInput.at(0)) : d->keyboardInput;
QModelIndex current = start;
QModelIndexList match;
QModelIndex firstMatch;
QModelIndex startMatch;
QModelIndexList previous;
do {
- match = d->model->match(current, Qt::DisplayRole, searchString);
+ match = d->model->match(current, Qt::DisplayRole, d->keyboardInput);
if (match == previous)
break;
firstMatch = match.value(0);
diff --git a/src/widgets/itemviews/qfileiconprovider.cpp b/src/widgets/itemviews/qfileiconprovider.cpp
index 71697ddc40..b12ab736f4 100644
--- a/src/widgets/itemviews/qfileiconprovider.cpp
+++ b/src/widgets/itemviews/qfileiconprovider.cpp
@@ -53,8 +53,10 @@
#if defined(Q_OS_WIN)
# include <qt_windows.h>
-# include <commctrl.h>
-# include <objbase.h>
+# ifndef Q_OS_WINRT
+# include <commctrl.h>
+# include <objbase.h>
+# endif
#endif
#if defined(Q_OS_UNIX) && !defined(QT_NO_STYLE_GTK)
@@ -313,7 +315,7 @@ QIcon QFileIconProvider::icon(const QFileInfo &info) const
return retIcon;
if (info.isRoot())
-#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
{
UINT type = GetDriveType((wchar_t *)info.absoluteFilePath().utf16());
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 75a513fb67..f1bdfc8709 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -724,6 +724,22 @@ int QHeaderView::sectionViewportPosition(int logicalIndex) const
\sa sectionPosition()
*/
+template<typename Container>
+static void qMoveRange(Container& c,
+ typename Container::size_type rangeStart,
+ typename Container::size_type rangeEnd,
+ typename Container::size_type targetPosition)
+{
+ Q_ASSERT(targetPosition <= c.size());
+ Q_ASSERT(targetPosition < rangeStart || targetPosition >= rangeEnd);
+
+ const bool forwardMove = targetPosition > rangeStart;
+ typename Container::size_type first = std::min(rangeStart, targetPosition);
+ typename Container::size_type mid = forwardMove ? rangeEnd : rangeStart;
+ typename Container::size_type last = forwardMove ? targetPosition + 1 : rangeEnd;
+ std::rotate(c.begin() + first, c.begin() + mid, c.begin() + last);
+}
+
/*!
Moves the section at visual index \a from to occupy visual index \a to.
@@ -748,71 +764,32 @@ void QHeaderView::moveSection(int from, int to)
if (stretchLastSection() && to == d->lastVisibleVisualIndex())
d->lastSectionSize = sectionSize(from);
- //int oldHeaderLength = length(); // ### for debugging; remove later
d->initializeIndexMapping();
- QBitArray sectionHidden = d->sectionHidden;
int *visualIndices = d->visualIndices.data();
int *logicalIndices = d->logicalIndices.data();
int logical = logicalIndices[from];
int visual = from;
- int affected_count = qAbs(to - from) + 1;
- QVarLengthArray<int> sizes(affected_count);
- QVarLengthArray<ResizeMode> modes(affected_count);
-
- // move sections and indices
if (to > from) {
- sizes[to - from] = d->headerSectionSize(from);
- modes[to - from] = d->headerSectionResizeMode(from);
while (visual < to) {
- sizes[visual - from] = d->headerSectionSize(visual + 1);
- modes[visual - from] = d->headerSectionResizeMode(visual + 1);
- if (!sectionHidden.isEmpty())
- sectionHidden.setBit(visual, sectionHidden.testBit(visual + 1));
visualIndices[logicalIndices[visual + 1]] = visual;
logicalIndices[visual] = logicalIndices[visual + 1];
++visual;
}
} else {
- sizes[0] = d->headerSectionSize(from);
- modes[0] = d->headerSectionResizeMode(from);
while (visual > to) {
- sizes[visual - to] = d->headerSectionSize(visual - 1);
- modes[visual - to] = d->headerSectionResizeMode(visual - 1);
- if (!sectionHidden.isEmpty())
- sectionHidden.setBit(visual, sectionHidden.testBit(visual - 1));
visualIndices[logicalIndices[visual - 1]] = visual;
logicalIndices[visual] = logicalIndices[visual - 1];
--visual;
}
}
- if (!sectionHidden.isEmpty()) {
- sectionHidden.setBit(to, d->sectionHidden.testBit(from));
- d->sectionHidden = sectionHidden;
- }
visualIndices[logical] = to;
logicalIndices[to] = logical;
- //Q_ASSERT(oldHeaderLength == length());
- // move sizes
- // ### check for items of section sizes here
- if (to > from) {
- for (visual = from; visual <= to; ++visual) {
- int size = sizes[visual - from];
- ResizeMode mode = modes[visual - from];
- d->createSectionItems(visual, visual, size, mode);
- }
- } else {
- for (visual = to; visual <= from; ++visual) {
- int size = sizes[visual - to];
- ResizeMode mode = modes[visual - to];
- d->createSectionItems(visual, visual, size, mode);
- }
- }
- //Q_ASSERT(d->headerLength() == length());
- //Q_ASSERT(oldHeaderLength == length());
- //Q_ASSERT(d->logicalIndices.count() == d->sectionCount);
+ qMoveRange(d->sectionItems, from, from + 1, to);
+
+ d->sectionStartposRecalc = true;
if (d->hasAutoResizeSections())
d->doDelayedResizeSections();
@@ -860,11 +837,11 @@ void QHeaderView::swapSections(int first, int second)
d->visualIndices[secondLogical] = first;
d->logicalIndices[first] = secondLogical;
- if (!d->sectionHidden.isEmpty()) {
- bool firstHidden = d->sectionHidden.testBit(first);
- bool secondHidden = d->sectionHidden.testBit(second);
- d->sectionHidden.setBit(first, secondHidden);
- d->sectionHidden.setBit(second, firstHidden);
+ if (!d->hiddenSectionSize.isEmpty()) {
+ bool firstHidden = d->isVisualIndexHidden(first);
+ bool secondHidden = d->isVisualIndexHidden(second);
+ d->setVisualIndexHidden(first, secondHidden);
+ d->setVisualIndexHidden(second, firstHidden);
}
d->viewport->update();
@@ -992,11 +969,11 @@ bool QHeaderView::isSectionHidden(int logicalIndex) const
{
Q_D(const QHeaderView);
d->executePostedLayout();
- if (logicalIndex >= d->sectionHidden.count() || logicalIndex < 0 || logicalIndex >= d->sectionCount())
+ if (d->hiddenSectionSize.isEmpty() || logicalIndex < 0 || logicalIndex >= d->sectionCount())
return false;
int visual = visualIndex(logicalIndex);
Q_ASSERT(visual != -1);
- return d->sectionHidden.testBit(visual);
+ return d->isVisualIndexHidden(visual);
}
/*!
@@ -1035,20 +1012,13 @@ void QHeaderView::setSectionHidden(int logicalIndex, bool hide)
if (!d->hasAutoResizeSections())
resizeSection(logicalIndex, 0);
d->hiddenSectionSize.insert(logicalIndex, size);
- if (d->sectionHidden.count() < count())
- d->sectionHidden.resize(count());
- d->sectionHidden.setBit(visual, true);
+ d->setVisualIndexHidden(visual, true);
if (d->hasAutoResizeSections())
d->doDelayedResizeSections();
} else {
int size = d->hiddenSectionSize.value(logicalIndex, d->defaultSectionSize);
d->hiddenSectionSize.remove(logicalIndex);
- if (d->hiddenSectionSize.isEmpty()) {
- d->sectionHidden.clear();
- } else {
- Q_ASSERT(visual <= d->sectionHidden.count());
- d->sectionHidden.setBit(visual, false);
- }
+ d->setVisualIndexHidden(visual, false);
resizeSection(logicalIndex, size);
}
}
@@ -1901,17 +1871,6 @@ void QHeaderView::sectionsInserted(const QModelIndex &parent,
}
}
- // insert sections into sectionsHidden
- if (!d->sectionHidden.isEmpty()) {
- QBitArray sectionHidden(d->sectionHidden);
- sectionHidden.resize(sectionHidden.count() + insertCount);
- sectionHidden.fill(false, logicalFirst, logicalLast + 1);
- for (int j = logicalLast + 1; j < sectionHidden.count(); ++j)
- //here we simply copy the old sectionHidden
- sectionHidden.setBit(j, d->sectionHidden.testBit(j - insertCount));
- d->sectionHidden = sectionHidden;
- }
-
// insert sections into hiddenSectionSize
QHash<int, int> newHiddenSectionSize; // from logical index to section size
for (int i = 0; i < logicalFirst; ++i)
@@ -1960,19 +1919,6 @@ void QHeaderViewPrivate::updateHiddenSections(int logicalFirst, int logicalLast)
if (q->isSectionHidden(j))
newHiddenSectionSize[j - changeCount] = hiddenSectionSize[j];
hiddenSectionSize = newHiddenSectionSize;
-
- // remove sections from sectionsHidden
- if (!sectionHidden.isEmpty()) {
- const int newsize = qMin(sectionCount() - changeCount, sectionHidden.size());
- QBitArray newSectionHidden(newsize);
- for (int j = 0, k = 0; j < sectionHidden.size(); ++j) {
- const int logical = logicalIndex(j);
- if (logical < logicalFirst || logical > logicalLast) {
- newSectionHidden[k++] = sectionHidden[j];
- }
- }
- sectionHidden = newSectionHidden;
- }
}
void QHeaderViewPrivate::_q_sectionsRemoved(const QModelIndex &parent,
@@ -2061,8 +2007,11 @@ void QHeaderViewPrivate::_q_layoutAboutToBeChanged()
|| model->columnCount(root) == 0)
return;
- for (int i = 0; i < sectionHidden.count(); ++i)
- if (sectionHidden.testBit(i)) // ### note that we are using column or row 0
+ if (hiddenSectionSize.count() == 0)
+ return;
+
+ for (int i = 0; i < sectionItems.count(); ++i)
+ if (isVisualIndexHidden(i)) // ### note that we are using column or row 0
persistentHiddenSections.append(orientation == Qt::Horizontal
? model->index(0, logicalIndex(i), root)
: model->index(logicalIndex(i), 0, root));
@@ -2079,7 +2028,8 @@ void QHeaderViewPrivate::_q_layoutChanged()
return;
}
- QBitArray oldSectionHidden = sectionHidden;
+ QBitArray oldSectionHidden = sectionsHiddenToBitVector();
+ oldSectionHidden.resize(sectionItems.size());
bool sectionCountChanged = false;
for (int i = 0; i < persistentHiddenSections.count(); ++i) {
@@ -2193,8 +2143,6 @@ void QHeaderView::initializeSections(int start, int end)
d->stretchSections = newSectionCount;
else if (d->globalResizeMode == ResizeToContents)
d->contentsSections = newSectionCount;
- if (!d->sectionHidden.isEmpty())
- d->sectionHidden.resize(newSectionCount);
if (newSectionCount > oldCount)
d->createSectionItems(start, end, (end - start + 1) * d->defaultSectionSize, d->globalResizeMode);
@@ -3385,7 +3333,6 @@ void QHeaderViewPrivate::clear()
visualIndices.clear();
logicalIndices.clear();
sectionSelected.clear();
- sectionHidden.clear();
hiddenSectionSize.clear();
sectionItems.clear();
invalidateCachedSizeHint();
@@ -3526,7 +3473,7 @@ void QHeaderViewPrivate::setDefaultSectionSize(int size)
preventCursorChangeInSetOffset = true;
for (int i = 0; i < sectionItems.count(); ++i) {
QHeaderViewPrivate::SectionItem &section = sectionItems[i];
- if (sectionHidden.isEmpty() || !sectionHidden.testBit(i)) { // resize on not hidden.
+ if (hiddenSectionSize.isEmpty() || !isVisualIndexHidden(i)) { // resize on not hidden.
const int newSize = size;
if (newSize != section.size) {
length += newSize - section.size; //the whole length is changed
@@ -3629,11 +3576,11 @@ int QHeaderViewPrivate::viewSectionSizeHint(int logical) const
int QHeaderViewPrivate::adjustedVisualIndex(int visualIndex) const
{
- if (!sectionHidden.isEmpty()) {
+ if (!hiddenSectionSize.isEmpty()) {
int adjustedVisualIndex = visualIndex;
int currentVisualIndex = 0;
for (int i = 0; i < sectionItems.count(); ++i) {
- if (sectionHidden.testBit(i))
+ if (isVisualIndexHidden(i))
++adjustedVisualIndex;
else
++currentVisualIndex;
@@ -3669,7 +3616,7 @@ void QHeaderViewPrivate::write(QDataStream &out) const
out << visualIndices;
out << logicalIndices;
- out << sectionHidden;
+ out << sectionsHiddenToBitVector();
out << hiddenSectionSize;
out << length;
@@ -3706,6 +3653,7 @@ bool QHeaderViewPrivate::read(QDataStream &in)
in >> visualIndices;
in >> logicalIndices;
+ QBitArray sectionHidden;
in >> sectionHidden;
in >> hiddenSectionSize;
@@ -3739,6 +3687,7 @@ bool QHeaderViewPrivate::read(QDataStream &in)
newSectionItems.append(sectionItems[u]);
}
sectionItems = newSectionItems;
+ setHiddenSectionsFromBitVector(sectionHidden);
recalcSectionStartPos();
int tmpint;
diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h
index b2af821e9b..81f1b176ee 100644
--- a/src/widgets/itemviews/qheaderview_p.h
+++ b/src/widgets/itemviews/qheaderview_p.h
@@ -171,11 +171,11 @@ public:
}
inline bool isVisualIndexHidden(int visual) const {
- return !sectionHidden.isEmpty() && sectionHidden.at(visual);
+ return sectionItems.at(visual).isHidden;
}
inline void setVisualIndexHidden(int visual, bool hidden) {
- if (!sectionHidden.isEmpty()) sectionHidden.setBit(visual, hidden);
+ sectionItems[visual].isHidden = hidden;
}
inline bool hasAutoResizeSections() const {
@@ -258,7 +258,6 @@ public:
mutable QVector<int> visualIndices; // visualIndex = visualIndices.at(logicalIndex)
mutable QVector<int> logicalIndices; // logicalIndex = row or column in the model
mutable QBitArray sectionSelected; // from logical index to bit
- mutable QBitArray sectionHidden; // from visual index to bit
mutable QHash<int, int> hiddenSectionSize; // from logical index to section size
mutable QHash<int, int> cascadingSectionSize; // from visual index to section size
mutable QSize cachedSizeHint;
@@ -301,7 +300,7 @@ public:
struct SectionItem {
uint size : 20;
- uint reservedForIsHidden : 1;
+ uint isHidden : 1;
uint resizeMode : 5; // (holding QHeaderView::ResizeMode)
uint currentlyUnusedPadding : 6;
@@ -311,9 +310,9 @@ public:
int tmpDataStreamSectionCount; // recalcSectionStartPos() or set sectionStartposRecalc to true
}; // to ensure that calculated_startpos will be calculated afterwards.
- inline SectionItem() : size(0), resizeMode(QHeaderView::Interactive) {}
+ inline SectionItem() : size(0), isHidden(0), resizeMode(QHeaderView::Interactive) {}
inline SectionItem(int length, QHeaderView::ResizeMode mode)
- : size(length), resizeMode(mode), calculated_startpos(-1) {}
+ : size(length), isHidden(0), resizeMode(mode), calculated_startpos(-1) {}
inline int sectionSize() const { return size; }
inline int calculatedEndPos() const { return calculated_startpos + size; }
#ifndef QT_NO_DATASTREAM
@@ -339,6 +338,23 @@ public:
return len;
}
+ QBitArray sectionsHiddenToBitVector() const
+ {
+ QBitArray sectionHidden;
+ if (!hiddenSectionSize.isEmpty()) {
+ sectionHidden.resize(sectionItems.size());
+ for (int u = 0; u < sectionItems.size(); ++u)
+ sectionHidden[u] = sectionItems.at(u).isHidden;
+ }
+ return sectionHidden;
+ }
+
+ void setHiddenSectionsFromBitVector(const QBitArray &sectionHidden) {
+ SectionItem *sectionData = sectionItems.data();
+ for (int i = 0; i < sectionHidden.count(); ++i)
+ sectionData[i].isHidden = sectionHidden.at(i);
+ }
+
int headerSectionSize(int visual) const;
int headerSectionPosition(int visual) const;
int headerVisualIndexAt(int position) const;
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index b3ef21e3e5..b4e155c087 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -428,8 +428,8 @@ QItemEditorCreatorBase::~QItemEditorCreatorBase()
/*!
\class QItemEditorCreator
\brief The QItemEditorCreator class makes it possible to create
- item editor creator bases without subclassing
- QItemEditorCreatorBase.
+ item editor creator bases without subclassing
+ QItemEditorCreatorBase.
\since 4.2
\ingroup model-view
@@ -450,7 +450,7 @@ QItemEditorCreatorBase::~QItemEditorCreatorBase()
property, you should use QStandardItemEditorCreator instead.
\sa QItemEditorCreatorBase, QStandardItemEditorCreator,
- QItemEditorFactory, {Color Editor Factory Example}
+ QItemEditorFactory, {Color Editor Factory Example}
*/
/*!
@@ -506,7 +506,7 @@ QItemEditorCreatorBase::~QItemEditorCreatorBase()
\snippet code/src_gui_itemviews_qitemeditorfactory.cpp 3
\sa QItemEditorCreatorBase, QItemEditorCreator,
- QItemEditorFactory, QItemDelegate, {Color Editor Factory Example}
+ QItemEditorFactory, QItemDelegate, {Color Editor Factory Example}
*/
/*!
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 43c1ea9cae..dd430435f3 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -1353,8 +1353,8 @@ bool QTreeViewPrivate::expandOrCollapseItemAtPos(const QPoint &pos)
Q_Q(QTreeView);
// we want to handle mousePress in EditingState (persistent editors)
if ((state != QAbstractItemView::NoState
- && state != QAbstractItemView::EditingState)
- || !viewport->rect().contains(pos))
+ && state != QAbstractItemView::EditingState)
+ || !viewport->rect().contains(pos))
return true;
int i = itemDecorationAt(pos);
@@ -1771,14 +1771,14 @@ void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option,
int x = 0;
if (!option.showDecorationSelected)
x = header->sectionPosition(0) + d->indentationForItem(d->current);
- QRect focusRect(x - header->offset(), y, header->length() - x, height);
+ QRect focusRect(x - header->offset(), y, header->length() - x, height);
o.rect = style()->visualRect(layoutDirection(), d->viewport->rect(), focusRect);
style()->drawPrimitive(QStyle::PE_FrameFocusRect, &o, painter);
// if we show focus on all columns and the first section is moved,
// we have to split the focus rect into two rects
if (allColumnsShowFocus && !option.showDecorationSelected
&& header->sectionsMoved() && (header->visualIndex(0) != 0)) {
- QRect sectionRect(0, y, header->sectionPosition(0), height);
+ QRect sectionRect(0, y, header->sectionPosition(0), height);
o.rect = style()->visualRect(layoutDirection(), d->viewport->rect(), sectionRect);
style()->drawPrimitive(QStyle::PE_FrameFocusRect, &o, painter);
}
@@ -1891,11 +1891,11 @@ void QTreeView::drawBranches(QPainter *painter, const QRect &rect,
*/
void QTreeView::mousePressEvent(QMouseEvent *event)
{
- Q_D(QTreeView);
+ Q_D(QTreeView);
bool handled = false;
if (style()->styleHint(QStyle::SH_ListViewExpand_SelectMouseType, 0, this) == QEvent::MouseButtonPress)
handled = d->expandOrCollapseItemAtPos(event->pos());
- if (!handled && d->itemDecorationAt(event->pos()) == -1)
+ if (!handled && d->itemDecorationAt(event->pos()) == -1)
QAbstractItemView::mousePressEvent(event);
}
@@ -2598,7 +2598,7 @@ void QTreeView::columnCountChanged(int oldCount, int newCount)
if (isVisible())
updateGeometries();
- viewport()->update();
+ viewport()->update();
}
/*!
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index e75f602e90..cd57b5828a 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -493,8 +493,7 @@ bool QTreeModel::removeRows(int row, int count, const QModelIndex &parent) {
beginRemoveRows(parent, row, row + count - 1);
- bool blockSignal = signalsBlocked();
- blockSignals(true);
+ QSignalBlocker blocker(this);
QTreeWidgetItem *itm = item(parent);
for (int i = row + count - 1; i >= row; --i) {
@@ -504,7 +503,7 @@ bool QTreeModel::removeRows(int row, int count, const QModelIndex &parent) {
delete child;
child = 0;
}
- blockSignals(blockSignal);
+ blocker.unblock();
endRemoveRows();
return true;
@@ -2824,7 +2823,7 @@ void QTreeWidget::setCurrentItem(QTreeWidgetItem *item, int column)
\sa currentItem()
*/
void QTreeWidget::setCurrentItem(QTreeWidgetItem *item, int column,
- QItemSelectionModel::SelectionFlags command)
+ QItemSelectionModel::SelectionFlags command)
{
Q_D(QTreeWidget);
d->selectionModel->setCurrentIndex(d->index(item, column), command);
@@ -2860,7 +2859,7 @@ QRect QTreeWidget::visualItemRect(const QTreeWidgetItem *item) const
{
Q_D(const QTreeWidget);
//the visual rect for an item is across all columns. So we need to determine
- //what is the first and last column and get their visual index rects
+ //what is the first and last column and get their visual index rects
QModelIndex base = d->index(item);
const int firstVisiblesection = header()->logicalIndexAt(- header()->offset());
const int lastVisibleSection = header()->logicalIndexAt(header()->length() - header()->offset() - 1);
diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri
index 444b9b687f..857fe4ac91 100644
--- a/src/widgets/kernel/kernel.pri
+++ b/src/widgets/kernel/kernel.pri
@@ -79,3 +79,8 @@ wince*: {
SOURCES += \
kernel/qwidgetsfunctions_wince.cpp
}
+
+contains(QT_CONFIG, opengl) {
+ HEADERS += kernel/qopenglwidget_p.h
+ SOURCES += kernel/qopenglwidget.cpp
+}
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index c9d6593662..9bc1576dc6 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -377,7 +377,6 @@ QPalette *QApplicationPrivate::set_pal = 0; // default palette set by pro
QFont *QApplicationPrivate::sys_font = 0; // default system font
QFont *QApplicationPrivate::set_font = 0; // default font set by programmer
-QIcon *QApplicationPrivate::app_icon = 0;
QWidget *QApplicationPrivate::main_widget = 0; // main application widget
QWidget *QApplicationPrivate::focus_widget = 0; // has keyboard input focus
QWidget *QApplicationPrivate::hidden_focus_widget = 0; // will get keyboard input focus after show()
@@ -446,7 +445,8 @@ void QApplicationPrivate::process_cmdline()
continue;
}
QByteArray arg = argv[i];
- arg = arg;
+ if (arg.startsWith("--"))
+ arg.remove(0, 1);
QString s;
if (arg == "-qdevel" || arg == "-qdebug") {
// obsolete argument
@@ -729,8 +729,6 @@ QApplication::~QApplication()
delete QApplicationPrivate::app_style;
QApplicationPrivate::app_style = 0;
- delete QApplicationPrivate::app_icon;
- QApplicationPrivate::app_icon = 0;
#ifndef QT_NO_DRAGANDDROP
if (qt_is_gui_used)
@@ -1560,6 +1558,7 @@ QString QApplicationPrivate::desktopStyleKey()
return QString();
}
+#if QT_VERSION < 0x060000 // remove these forwarders in Qt 6
/*!
\property QApplication::windowIcon
\brief the default window icon
@@ -1568,23 +1567,32 @@ QString QApplicationPrivate::desktopStyleKey()
*/
QIcon QApplication::windowIcon()
{
- return QApplicationPrivate::app_icon ? *QApplicationPrivate::app_icon : QIcon();
+ return QGuiApplication::windowIcon();
}
void QApplication::setWindowIcon(const QIcon &icon)
{
- if (!QApplicationPrivate::app_icon)
- QApplicationPrivate::app_icon = new QIcon();
- *QApplicationPrivate::app_icon = icon;
- if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) {
- QEvent e(QEvent::ApplicationWindowIconChange);
- QWidgetList all = QApplication::allWidgets();
- for (QWidgetList::ConstIterator it = all.constBegin(); it != all.constEnd(); ++it) {
- QWidget *w = *it;
- if (w->isWindow())
- sendEvent(w, &e);
- }
+ QGuiApplication::setWindowIcon(icon);
+}
+#endif
+
+void QApplicationPrivate::notifyWindowIconChanged()
+{
+ QEvent ev(QEvent::ApplicationWindowIconChange);
+ const QWidgetList list = QApplication::topLevelWidgets();
+ QWindowList windowList = QGuiApplication::topLevelWindows();
+
+ // send to all top-level QWidgets
+ for (int i = 0; i < list.size(); ++i) {
+ QWidget *w = list.at(i);
+ windowList.removeOne(w->windowHandle());
+ QCoreApplication::sendEvent(w, &ev);
}
+
+ // in case there are any plain QWindows in this QApplication-using
+ // application, also send the notification to them
+ for (int i = 0; i < windowList.size(); ++i)
+ QCoreApplication::sendEvent(windowList.at(i), &ev);
}
/*!
@@ -1725,6 +1733,41 @@ QFontMetrics QApplication::fontMetrics()
return desktop()->fontMetrics();
}
+bool QApplicationPrivate::tryCloseAllWidgetWindows(QWindowList *processedWindows)
+{
+ Q_ASSERT(processedWindows);
+ while (QWidget *w = QApplication::activeModalWidget()) {
+ if (!w->isVisible() || w->data->is_closing)
+ break;
+ QWindow *window = w->windowHandle();
+ if (!w->close()) // Qt::WA_DeleteOnClose may cause deletion.
+ return false;
+ if (window)
+ processedWindows->append(window);
+ }
+
+ QWidgetList list = QApplication::topLevelWidgets();
+ for (int i = 0; i < list.size(); ++i) {
+ QWidget *w = list.at(i);
+ if (w->isVisible() && w->windowType() != Qt::Desktop && !w->data->is_closing) {
+ QWindow *window = w->windowHandle();
+ if (!w->close()) // Qt::WA_DeleteOnClose may cause deletion.
+ return false;
+ if (window)
+ processedWindows->append(window);
+ list = QApplication::topLevelWidgets();
+ i = -1;
+ }
+ }
+ return true;
+}
+
+bool QApplicationPrivate::tryCloseAllWindows()
+{
+ QWindowList processedWindows;
+ return QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows)
+ && QGuiApplicationPrivate::tryCloseRemainingWindows(processedWindows);
+}
/*!
Closes all top-level windows.
@@ -1746,24 +1789,8 @@ QFontMetrics QApplication::fontMetrics()
*/
void QApplication::closeAllWindows()
{
- bool did_close = true;
- QWidget *w;
- while ((w = activeModalWidget()) && did_close) {
- if (!w->isVisible() || w->data->is_closing)
- break;
- did_close = w->close();
- }
- QWidgetList list = QApplication::topLevelWidgets();
- for (int i = 0; did_close && i < list.size(); ++i) {
- w = list.at(i);
- if (w->isVisible()
- && w->windowType() != Qt::Desktop
- && !w->data->is_closing) {
- did_close = w->close();
- list = QApplication::topLevelWidgets();
- i = -1;
- }
- }
+ QWindowList processedWindows;
+ QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows);
}
/*!
@@ -2611,7 +2638,7 @@ QDesktopWidget *QApplication::desktop()
void QApplication::setStartDragTime(int ms)
{
- Q_UNUSED(ms)
+ QGuiApplication::styleHints()->setStartDragTime(ms);
}
/*!
@@ -2644,7 +2671,7 @@ int QApplication::startDragTime()
void QApplication::setStartDragDistance(int l)
{
- Q_UNUSED(l);
+ QGuiApplication::styleHints()->setStartDragDistance(l);
}
/*!
@@ -2716,9 +2743,11 @@ bool QApplicationPrivate::shouldQuit()
QWindowList processedWindows;
for (int i = 0; i < list.size(); ++i) {
QWidget *w = list.at(i);
- processedWindows.push_back(w->windowHandle());
- if (w->isVisible() && !w->parentWidget() && w->testAttribute(Qt::WA_QuitOnClose))
- return false;
+ if (QWindow *window = w->windowHandle()) { // Menus, popup widgets may not have a QWindow
+ processedWindows.push_back(window);
+ if (w->isVisible() && !w->parentWidget() && w->testAttribute(Qt::WA_QuitOnClose))
+ return false;
+ }
}
return QGuiApplicationPrivate::shouldQuitInternal(processedWindows);
}
@@ -2767,6 +2796,13 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QApplicationPrivate::mouse_buttons |= me->button();
break;
}
+ case QEvent::MouseButtonDblClick:
+ {
+ QMouseEvent *me = static_cast<QMouseEvent*>(e);
+ QApplicationPrivate::modifier_buttons = me->modifiers();
+ QApplicationPrivate::mouse_buttons |= me->button();
+ break;
+ }
case QEvent::MouseButtonRelease:
{
QMouseEvent *me = static_cast<QMouseEvent*>(e);
@@ -2995,6 +3031,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
mouse->modifiers());
me.spont = mouse->spontaneous();
me.setTimestamp(mouse->timestamp());
+ QGuiApplicationPrivate::setMouseEventFlags(&me, mouse->flags());
// throw away any mouse-tracking-only mouse events
if (!w->hasMouseTracking()
&& mouse->type() == QEvent::MouseMove && mouse->buttons() == 0) {
@@ -3611,7 +3648,7 @@ bool QApplication::keypadNavigationEnabled()
*/
void QApplication::setCursorFlashTime(int msecs)
{
- Q_UNUSED(msecs);
+ QGuiApplication::styleHints()->setCursorFlashTime(msecs);
}
int QApplication::cursorFlashTime()
@@ -3626,12 +3663,10 @@ int QApplication::cursorFlashTime()
The default value on X11 is 400 milliseconds. On Windows and Mac OS, the
operating system's value is used.
-
- Setting the interval is not supported anymore in Qt 5.
*/
void QApplication::setDoubleClickInterval(int ms)
{
- Q_UNUSED(ms);
+ QGuiApplication::styleHints()->setMouseDoubleClickInterval(ms);
}
int QApplication::doubleClickInterval()
@@ -3659,7 +3694,7 @@ int QApplication::doubleClickInterval()
*/
void QApplication::setKeyboardInputInterval(int ms)
{
- Q_UNUSED(ms);
+ QGuiApplication::styleHints()->setKeyboardInputInterval(ms);
}
int QApplication::keyboardInputInterval()
@@ -3750,6 +3785,7 @@ void QApplicationPrivate::giveFocusAccordingToFocusPolicy(QWidget *widget, QEven
switch (event->type()) {
case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonDblClick:
case QEvent::TouchBegin:
if (setFocusOnRelease)
return;
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index 83673eef4e..9cd18d5cd9 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -126,10 +126,10 @@ public:
static void setFont(const QFont &, const char* className = 0);
static QFontMetrics fontMetrics();
+#if QT_VERSION < 0x060000 // remove these forwarders in Qt 6
static void setWindowIcon(const QIcon &icon);
static QIcon windowIcon();
-
-
+#endif
static QWidgetList allWidgets();
static QWidgetList topLevelWidgets();
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 29c6902c78..93c9ffe002 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -120,6 +120,7 @@ public:
virtual void notifyActiveWindowChange(QWindow *);
virtual bool shouldQuit();
+ bool tryCloseAllWindows() Q_DECL_OVERRIDE;
#if defined(Q_WS_X11)
#ifndef QT_NO_SETTINGS
@@ -137,6 +138,8 @@ public:
void createEventDispatcher();
static void dispatchEnterLeave(QWidget *enter, QWidget *leave, const QPointF &globalPosF);
+ void notifyWindowIconChanged() Q_DECL_OVERRIDE;
+
//modality
bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const Q_DECL_OVERRIDE;
static bool isBlockedByModal(QWidget *widget);
@@ -144,7 +147,7 @@ public:
static bool tryModalHelper(QWidget *widget, QWidget **rettop = 0);
#ifdef Q_WS_MAC
static QWidget *tryModalHelper_sys(QWidget *top);
- bool canQuit();
+ bool canQuit();
#endif
bool notify_helper(QObject *receiver, QEvent * e);
@@ -198,7 +201,6 @@ public:
static QWidget *focus_widget;
static QWidget *hidden_focus_widget;
static QWidget *active_window;
- static QIcon *app_icon;
#ifndef QT_NO_WHEELEVENT
static int wheel_scroll_lines;
#endif
@@ -293,6 +295,7 @@ public:
QPixmap applyQIconStyleHelper(QIcon::Mode mode, const QPixmap& base) const;
private:
static QApplicationPrivate *self;
+ static bool tryCloseAllWidgetWindows(QWindowList *processedWindows);
static void giveFocusAccordingToFocusPolicy(QWidget *w, QEvent *event, QPoint localPos);
static bool shouldSetFocus(QWidget *w, Qt::FocusPolicy policy);
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 1f8e950d00..7977ae3528 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -451,7 +451,7 @@ void qt_init(QApplicationPrivate *priv, int type)
QApplicationPrivate::initializeWidgetFontHash();
}
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
// #fixme: Remove.
static HDC displayDC = 0; // display device context
@@ -470,7 +470,7 @@ void qt_cleanup()
QColormap::cleanup();
QApplicationPrivate::active_window = 0; //### this should not be necessary
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
if (displayDC) {
ReleaseDC(0, displayDC);
displayDC = 0;
diff --git a/src/widgets/kernel/qformlayout.h b/src/widgets/kernel/qformlayout.h
index a1356c734f..0b8fd65a3f 100644
--- a/src/widgets/kernel/qformlayout.h
+++ b/src/widgets/kernel/qformlayout.h
@@ -143,7 +143,7 @@ public:
int rowCount() const;
#if 0
- void dump() const;
+ void dump() const;
#endif
private:
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
new file mode 100644
index 0000000000..a5f81a9df8
--- /dev/null
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -0,0 +1,183 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWidgets module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qopenglwidget_p.h"
+#include <QOpenGLContext>
+#include <QtWidgets/private/qwidget_p.h>
+
+#include <QOpenGLFramebufferObject>
+#include <QWindow>
+#include <qpa/qplatformwindow.h>
+#include <QDebug>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QScreen>
+
+QT_BEGIN_NAMESPACE
+
+class QOpenGLWidgetPrivate : public QWidgetPrivate
+{
+ Q_DECLARE_PUBLIC(QOpenGLWidget)
+public:
+ QOpenGLWidgetPrivate()
+ : fbo(0), uninitialized(true)
+ {
+ setRenderToTexture();
+ }
+ GLuint textureId() const { return fbo ? fbo->texture() : 0; }
+
+ const QSurface *surface() const { return q_func()->window()->windowHandle(); }
+ QSurface *surface() { return q_func()->window()->windowHandle(); }
+ void initialize();
+
+ QOpenGLContext context;
+ QOpenGLFramebufferObject *fbo;
+ bool uninitialized;
+
+ int w,h;
+};
+
+void QOpenGLWidgetPrivate::initialize()
+{
+ Q_Q(QOpenGLWidget);
+ if (!uninitialized)
+ return;
+ context.setShareContext(get(q->window())->shareContext());
+ context.setFormat(surface()->format());
+ context.create();
+ context.makeCurrent(surface());
+ q->initializeGL();
+ uninitialized = false;
+}
+
+QOpenGLWidget::QOpenGLWidget(QWidget *parent, Qt::WindowFlags f)
+ : QWidget(*(new QOpenGLWidgetPrivate), parent, f)
+{
+}
+
+QOpenGLWidget::~QOpenGLWidget()
+{
+}
+
+bool QOpenGLWidget::isValid() const
+{
+ Q_D(const QOpenGLWidget);
+ return d->context.isValid();
+}
+
+void QOpenGLWidget::makeCurrent()
+{
+ Q_D(QOpenGLWidget);
+ d->context.makeCurrent(d->surface());
+ d->fbo->bind();
+}
+
+void QOpenGLWidget::doneCurrent()
+{
+ Q_D(QOpenGLWidget);
+ d->context.doneCurrent();
+}
+
+QSurfaceFormat QOpenGLWidget::format() const
+{
+ Q_D(const QOpenGLWidget);
+ return d->surface()->format();
+}
+
+GLuint QOpenGLWidget::defaultFramebufferObject() const
+{
+ Q_D(const QOpenGLWidget);
+ return d->fbo ? d->fbo->handle() : 0;
+}
+
+void QOpenGLWidget::initializeGL()
+{
+
+}
+
+void QOpenGLWidget::resizeGL(int w, int h)
+{
+ Q_UNUSED(w);
+ Q_UNUSED(h);
+}
+
+void QOpenGLWidget::paintGL()
+{
+}
+
+void QOpenGLWidget::updateGL()
+{
+ makeCurrent();
+ paintGL();
+ glFlush();
+ doneCurrent();
+ update();
+}
+
+
+void QOpenGLWidget::resizeEvent(QResizeEvent *)
+{
+ Q_D(QOpenGLWidget);
+ d->w = width();
+ d->h = height();
+ d->initialize();
+
+ d->context.makeCurrent(d->surface());
+ delete d->fbo; // recreate when resized
+ d->fbo = new QOpenGLFramebufferObject(size());
+ d->fbo->bind();
+ glBindTexture(GL_TEXTURE_2D, d->fbo->texture());
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+
+ resizeGL(width(), height());
+ paintGL();
+ glFlush();
+}
+
+void QOpenGLWidget::paintEvent(QPaintEvent *)
+{
+ qWarning("QOpenGLWidget does not support paintEvent() yet.");
+ return;
+}
+
+QT_END_NAMESPACE
diff --git a/src/widgets/kernel/qopenglwidget_p.h b/src/widgets/kernel/qopenglwidget_p.h
new file mode 100644
index 0000000000..1c7f0bfeec
--- /dev/null
+++ b/src/widgets/kernel/qopenglwidget_p.h
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWidgets module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It may change from version to version
+// without notice, or even be removed.
+//
+// We mean it.
+//
+#ifndef QOPENGLWIDGET_H
+#define QOPENGLWIDGET_H
+
+#include <QWidget>
+#include <QSurfaceFormat>
+
+#include <QtGui/qopengl.h>
+
+QT_BEGIN_NAMESPACE
+
+class QOpenGLWidgetPrivate;
+
+class Q_WIDGETS_EXPORT QOpenGLWidget : public QWidget
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QOpenGLWidget)
+
+public:
+ explicit QOpenGLWidget(QWidget* parent=0,
+ Qt::WindowFlags f=0);
+
+// This API is not finalized yet. The commented-out functions below are
+// QGLWidget functions that have not been implemented for QOpenGLWidget.
+// Some of them may not end up in the final version (which is planned for a
+// future release of Qt).
+
+// explicit QOpenGLWidget(const QSurfaceFormat& format, QWidget* parent=0,
+// Qt::WindowFlags f=0);
+ ~QOpenGLWidget();
+
+// void qglClearColor(const QColor& c) const;
+
+ bool isValid() const;
+// bool isSharing() const;
+
+ void makeCurrent();
+ void doneCurrent();
+
+// void swapBuffers();
+
+ QSurfaceFormat format() const;
+ GLuint defaultFramebufferObject() const;
+
+// QPixmap renderPixmap(int w = 0, int h = 0, bool useContext = false);
+ QImage grabFrameBuffer(bool withAlpha = false);
+
+// static QImage convertToGLFormat(const QImage& img);
+
+// QPaintEngine *paintEngine() const;
+
+// void drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget = GL_TEXTURE_2D);
+// void drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget = GL_TEXTURE_2D);
+
+public Q_SLOTS:
+ void updateGL();
+
+protected:
+// bool event(QEvent *);
+ virtual void initializeGL();
+ virtual void resizeGL(int w, int h);
+ virtual void paintGL();
+
+// void setAutoBufferSwap(bool on);
+// bool autoBufferSwap() const;
+
+ void paintEvent(QPaintEvent*);
+ void resizeEvent(QResizeEvent*);
+
+// virtual void glInit();
+// virtual void glDraw();
+
+// QOpenGLWidget(QOpenGLWidgetPrivate &dd,
+// const QGLFormat &format = QGLFormat(),
+// QWidget *parent = 0,
+// const QOpenGLWidget* shareWidget = 0,
+// Qt::WindowFlags f = 0);
+private:
+ Q_DISABLE_COPY(QOpenGLWidget)
+
+
+};
+
+QT_END_NAMESPACE
+
+#endif // QOPENGLWIDGET_H
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index ee7f779a3a..46aa93fe48 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -78,6 +78,7 @@
#include "private/qstyle_p.h"
#include "qfileinfo.h"
#include <QtGui/qinputmethod.h>
+#include <QtGui/qopenglcontext.h>
#include <private/qgraphicseffect_p.h>
#include <qbackingstore.h>
@@ -270,6 +271,8 @@ QWidgetPrivate::QWidgetPrivate(int version)
, isMoved(0)
, usesDoubleBufferedGLContext(0)
, mustHaveWindowHandle(0)
+ , renderToTexture(0)
+ , textureChildSeen(0)
#ifndef QT_NO_IM
, inheritsInputMethodHints(0)
#endif
@@ -353,10 +356,10 @@ void QWidgetPrivate::scrollChildren(int dx, int dy)
}
}
-void QWidgetPrivate::updateWidgetTransform()
+void QWidgetPrivate::updateWidgetTransform(QEvent *event)
{
Q_Q(QWidget);
- if (q == qGuiApp->focusObject()) {
+ if (q == qGuiApp->focusObject() || event->type() == QEvent::FocusIn) {
QTransform t;
QPoint p = q->mapTo(q->topLevelWidget(), QPoint(0,0));
t.translate(p.x(), p.y());
@@ -1188,7 +1191,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
if (++QWidgetPrivate::instanceCounter > QWidgetPrivate::maxInstances)
QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter;
- if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation))
+ if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation)) // ### fixme: Qt 6: Remove AA_ImmediateWidgetCreation.
q->create();
QEvent e(QEvent::Create);
@@ -1558,6 +1561,7 @@ void QWidgetPrivate::createTLExtra()
x->inRepaint = false;
x->embedded = 0;
x->window = 0;
+ x->shareContext = 0;
x->screenIndex = 0;
#ifdef Q_WS_MAC
x->wasMaximized = false;
@@ -4178,7 +4182,7 @@ const QPalette &QWidget::palette() const
if (!isEnabled()) {
data->pal.setCurrentColorGroup(QPalette::Disabled);
} else if ((!isVisible() || isActiveWindow())
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
&& !QApplicationPrivate::isBlockedByModal(const_cast<QWidget *>(this))
#endif
) {
@@ -5133,9 +5137,17 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
<< "geometry ==" << QRect(q->mapTo(q->window(), QPoint(0, 0)), q->size());
#endif
- //actually send the paint event
- QPaintEvent e(toBePainted);
- QCoreApplication::sendSpontaneousEvent(q, &e);
+ if (renderToTexture) {
+ // This widget renders into a texture which is composed later. We just need to
+ // punch a hole in the backingstore, so the texture will be visible.
+ QPainter p(q);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ p.fillRect(q->rect(), Qt::transparent);
+ } else {
+ //actually send the paint event
+ QPaintEvent e(toBePainted);
+ QCoreApplication::sendSpontaneousEvent(q, &e);
+ }
// Native widgets need to be marked dirty on screen so painting will be done in correct context
if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow()))
@@ -6747,12 +6759,25 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
if (maximized || fullScreen) {
// set geometry before setting the window state to make
// sure the window is maximized to the right screen.
- // Skip on windows: the window is restored into a broken
- // half-maximized state.
+ Qt::WindowStates ws = windowState();
#ifndef Q_OS_WIN
setGeometry(restoredNormalGeometry);
-#endif
- Qt::WindowStates ws = windowState();
+#else
+ if (ws & Qt::WindowFullScreen) {
+ // Full screen is not a real window state on Windows.
+ move(availableGeometry.topLeft());
+ } else if (ws & Qt::WindowMaximized) {
+ // Setting a geometry on an already maximized window causes this to be
+ // restored into a broken, half-maximized state, non-resizable state (QTBUG-4397).
+ // Move the window in normal state if needed.
+ if (restoredScreenNumber != desktop->screenNumber(this)) {
+ setWindowState(Qt::WindowNoState);
+ setGeometry(restoredNormalGeometry);
+ }
+ } else {
+ setGeometry(restoredNormalGeometry);
+ }
+#endif // Q_OS_WIN
if (maximized)
ws |= Qt::WindowMaximized;
if (fullScreen)
@@ -8058,7 +8083,7 @@ bool QWidget::event(QEvent *event)
break;
case QEvent::FocusIn:
focusInEvent((QFocusEvent*)event);
- d->updateWidgetTransform();
+ d->updateWidgetTransform(event);
break;
case QEvent::FocusOut:
@@ -8100,12 +8125,12 @@ bool QWidget::event(QEvent *event)
case QEvent::Move:
moveEvent((QMoveEvent*)event);
- d->updateWidgetTransform();
+ d->updateWidgetTransform(event);
break;
case QEvent::Resize:
resizeEvent((QResizeEvent*)event);
- d->updateWidgetTransform();
+ d->updateWidgetTransform(event);
break;
case QEvent::Close:
@@ -9479,27 +9504,36 @@ void QWidget::updateGeometry()
*/
void QWidget::setWindowFlags(Qt::WindowFlags flags)
{
- if (data->window_flags == flags)
- return;
-
Q_D(QWidget);
+ d->setWindowFlags(flags);
+}
+
+/*! \internal
+
+ Implemented in QWidgetPrivate so that QMdiSubWindowPrivate can reimplement it.
+*/
+void QWidgetPrivate::setWindowFlags(Qt::WindowFlags flags)
+{
+ Q_Q(QWidget);
+ if (q->data->window_flags == flags)
+ return;
- if ((data->window_flags | flags) & Qt::Window) {
+ if ((q->data->window_flags | flags) & Qt::Window) {
// the old type was a window and/or the new type is a window
- QPoint oldPos = pos();
- bool visible = isVisible();
- setParent(parentWidget(), flags);
+ QPoint oldPos = q->pos();
+ bool visible = q->isVisible();
+ q->setParent(q->parentWidget(), flags);
// if both types are windows or neither of them are, we restore
// the old position
- if (!((data->window_flags ^ flags) & Qt::Window)
- && (visible || testAttribute(Qt::WA_Moved))) {
- move(oldPos);
+ if (!((q->data->window_flags ^ flags) & Qt::Window)
+ && (visible || q->testAttribute(Qt::WA_Moved))) {
+ q->move(oldPos);
}
// for backward-compatibility we change Qt::WA_QuitOnClose attribute value only when the window was recreated.
- d->adjustQuitOnCloseAttribute();
+ adjustQuitOnCloseAttribute();
} else {
- data->window_flags = flags;
+ q->data->window_flags = flags;
}
}
@@ -9615,6 +9649,13 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
if (desktopWidget)
parent = 0;
+#ifndef QT_NO_OPENGL
+ if (d->textureChildSeen && parent) {
+ // set the textureChildSeen flag up the whole parent chain
+ QWidgetPrivate::get(parent)->setTextureChildSeen();
+ }
+#endif
+
if (QWidgetBackingStore *oldBs = oldtlw->d_func()->maybeBackingStore()) {
if (newParent)
oldBs->removeDirtyWidget(this);
@@ -9623,6 +9664,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
oldBs->moveStaticWidgets(this);
}
+ // ### fixme: Qt 6: Remove AA_ImmediateWidgetCreation.
if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation) && !testAttribute(Qt::WA_WState_Created))
create();
@@ -11085,7 +11127,25 @@ void QWidgetPrivate::adjustQuitOnCloseAttribute()
}
}
-
+QOpenGLContext *QWidgetPrivate::shareContext() const
+{
+#ifdef QT_NO_OPENGL
+ return 0;
+#else
+ if (!extra || !extra->topextra || !extra->topextra->window) {
+ qWarning() << "Asking for share context for widget that does not have a window handle";
+ return 0;
+ }
+ QWidgetPrivate *that = const_cast<QWidgetPrivate *>(this);
+ if (!extra->topextra->shareContext) {
+ QOpenGLContext *ctx = new QOpenGLContext();
+ ctx->setFormat(extra->topextra->window->format());
+ ctx->create();
+ that->extra->topextra->shareContext = ctx;
+ }
+ return that->extra->topextra->shareContext;
+#endif // QT_NO_OPENGL
+}
Q_WIDGETS_EXPORT QWidgetData *qt_qwidget_data(QWidget *widget)
{
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 943b7057b5..bdfc57f7c3 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -60,6 +60,7 @@
#include "QtCore/qset.h"
#include "QtGui/qregion.h"
#include "QtGui/qinputmethod.h"
+#include "QtGui/qopengl.h"
#include "QtWidgets/qsizepolicy.h"
#include "QtWidgets/qstyle.h"
#include "QtWidgets/qapplication.h"
@@ -80,6 +81,7 @@ class QPixmap;
class QWidgetBackingStore;
class QGraphicsProxyWidget;
class QWidgetItemV2;
+class QOpenGLContext;
class QStyle;
@@ -216,6 +218,7 @@ struct QTLWExtra {
bool wasMaximized;
#endif
QWidgetWindow *window;
+ QOpenGLContext *shareContext;
quint32 screenIndex; // index in qplatformscreenlist
};
@@ -324,6 +327,8 @@ public:
explicit QWidgetPrivate(int version = QObjectPrivateVersion);
~QWidgetPrivate();
+ static QWidgetPrivate *get(QWidget *w) { return w->d_func(); }
+
QWExtra *extraData() const;
QTLWExtra *topData() const;
QTLWExtra *maybeTopData() const;
@@ -438,7 +443,7 @@ public:
void syncBackingStore(const QRegion &region);
// tells the input method about the widgets transform
- void updateWidgetTransform();
+ void updateWidgetTransform(QEvent *event);
void reparentFocusWidgets(QWidget *oldtlw);
@@ -489,6 +494,7 @@ public:
void setWindowTitle_helper(const QString &cap);
void setWindowFilePath_helper(const QString &filePath);
void setWindowModified_helper();
+ virtual void setWindowFlags(Qt::WindowFlags windowFlags);
bool setMinimumSize_helper(int &minw, int &minh);
bool setMaximumSize_helper(int &maxw, int &maxh);
@@ -537,6 +543,8 @@ public:
}
}
}
+#else
+ Q_UNUSED(widget);
#endif
return screen;
}
@@ -615,6 +623,27 @@ public:
inline QRect mapFromWS(const QRect &r) const
{ QRect rr(r); rr.translate(data.wrect.topLeft()); return rr; }
+ QOpenGLContext *shareContext() const;
+
+#ifndef QT_NO_OPENGL
+ virtual GLuint textureId() const { return 0; }
+
+ void setRenderToTexture() { renderToTexture = true; textureChildSeen = true; }
+ void setTextureChildSeen()
+ {
+ Q_Q(QWidget);
+ if (textureChildSeen)
+ return;
+ textureChildSeen = 1;
+
+ if (!q->isWindow()) {
+ QWidget *parent = q->parentWidget();
+ if (parent)
+ get(parent)->setTextureChildSeen();
+ }
+ }
+#endif
+
// Variables.
// Regular pointers (keep them together to avoid gaps on 64 bit architectures).
QWExtra *extra;
@@ -695,6 +724,8 @@ public:
uint isMoved : 1;
uint usesDoubleBufferedGLContext : 1;
uint mustHaveWindowHandle : 1;
+ uint renderToTexture : 1;
+ uint textureChildSeen : 1;
#ifndef QT_NO_IM
uint inheritsInputMethodHints : 1;
#endif
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index 0a4bc990e6..c2260b6e7d 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -49,6 +49,7 @@
#include "QtWidgets/qdesktopwidget.h"
#include <qpa/qplatformwindow.h>
#include "QtGui/qsurfaceformat.h"
+#include <QtGui/qopenglcontext.h>
#include <qpa/qplatformopenglcontext.h>
#include <qpa/qplatformintegration.h>
#include "QtGui/private/qwindow_p.h"
@@ -953,6 +954,10 @@ void QWidgetPrivate::deleteTLSysExtra()
delete extra->topextra->backingStore;
extra->topextra->backingStore = 0;
+#ifndef QT_NO_OPENGL
+ delete extra->topextra->shareContext;
+ extra->topextra->shareContext = 0;
+#endif
}
}
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 4a94cd6cb8..dc918657b4 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -57,6 +57,8 @@
#include <private/qpaintengine_raster_p.h>
#include <private/qgraphicseffect_p.h>
+#include <qpa/qplatformbackingstore.h>
+
#if defined(Q_OS_WIN) && !defined(QT_NO_PAINT_DEBUG)
# include <QtCore/qt_windows.h>
# include <qpa/qplatformnativeinterface.h>
@@ -72,10 +74,15 @@ extern QRegion qt_dirtyRegion(QWidget *);
* \a region is the region to be updated in \a widget coordinates.
*/
static inline void qt_flush(QWidget *widget, const QRegion &region, QBackingStore *backingStore,
- QWidget *tlw, const QPoint &tlwOffset)
+ QWidget *tlw, const QPoint &tlwOffset, QPlatformTextureList *widgetTextures = 0,
+ QOpenGLContext *context = 0)
{
+#ifdef QT_NO_OPENGL
+ Q_UNUSED(widgetTextures);
+ Q_UNUSED(context);
+#endif
Q_ASSERT(widget);
- Q_ASSERT(!region.isEmpty());
+ Q_ASSERT(!region.isEmpty() || (context && widgetTextures && widgetTextures->count()));
Q_ASSERT(backingStore);
Q_ASSERT(tlw);
@@ -104,14 +111,20 @@ static inline void qt_flush(QWidget *widget, const QRegion &region, QBackingStor
if (tlw->testAttribute(Qt::WA_DontShowOnScreen) || widget->testAttribute(Qt::WA_DontShowOnScreen))
return;
+ QPoint offset = tlwOffset;
if (widget != tlw)
- backingStore->flush(region, widget->windowHandle(), tlwOffset + widget->mapTo(tlw, QPoint()));
+ offset += widget->mapTo(tlw, QPoint());
+
+#ifndef QT_NO_OPENGL
+ if (widgetTextures)
+ backingStore->handle()->composeAndFlush(widget->windowHandle(), region, offset, widgetTextures, context);
else
- backingStore->flush(region, widget->windowHandle(), tlwOffset);
+#endif
+ backingStore->flush(region, widget->windowHandle(), offset);
}
#ifndef QT_NO_PAINT_DEBUG
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
static void showYellowThing_win(QWidget *widget, const QRegion &region, int msec)
{
@@ -151,7 +164,7 @@ static void showYellowThing_win(QWidget *widget, const QRegion &region, int msec
QGuiApplication::platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("releaseDC"), nativeWindow);
::Sleep(msec);
}
-#endif // Q_OS_WIN
+#endif // defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePainted, int msec, bool unclipped)
{
@@ -166,7 +179,7 @@ void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePa
widget = nativeParent;
}
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
Q_UNUSED(unclipped);
showYellowThing_win(widget, paintRegion, msec);
#else
@@ -430,7 +443,7 @@ QRegion QWidgetBackingStore::staticContents(QWidget *parent, const QRect &within
return region;
}
-static inline void sendUpdateRequest(QWidget *widget, bool updateImmediately)
+void QWidgetBackingStore::sendUpdateRequest(QWidget *widget, bool updateImmediately)
{
if (!widget)
return;
@@ -439,6 +452,7 @@ static inline void sendUpdateRequest(QWidget *widget, bool updateImmediately)
QEvent event(QEvent::UpdateRequest);
QApplication::sendEvent(widget, &event);
} else {
+ updateRequestSent = true;
QApplication::postEvent(widget, new QEvent(QEvent::UpdateRequest), Qt::LowEventPriority);
}
}
@@ -488,6 +502,7 @@ void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget, bool up
return;
}
+ //### FIXME fullUpdatePending seems to be always false????
if (fullUpdatePending) {
if (updateImmediately)
sendUpdateRequest(tlw, updateImmediately);
@@ -495,6 +510,13 @@ void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget, bool up
}
const QPoint offset = widget->mapTo(tlw, QPoint());
+
+ if (QWidgetPrivate::get(widget)->renderToTexture) {
+ if (!updateRequestSent || updateImmediately)
+ sendUpdateRequest(tlw, updateImmediately);
+ return;
+ }
+
const QRect widgetRect = widget->d_func()->effectiveRectFor(widget->rect());
if (qt_region_strictContains(dirty, widgetRect.translated(offset))) {
if (updateImmediately)
@@ -503,7 +525,7 @@ void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget, bool up
}
if (invalidateBuffer) {
- const bool eventAlreadyPosted = !dirty.isEmpty();
+ const bool eventAlreadyPosted = !dirty.isEmpty() || updateRequestSent;
#ifndef QT_NO_GRAPHICSEFFECT
if (widget->d_func()->graphicsEffect)
dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect()).translated(offset);
@@ -583,6 +605,13 @@ void QWidgetBackingStore::markDirty(const QRect &rect, QWidget *widget, bool upd
return;
}
+ if (QWidgetPrivate::get(widget)->renderToTexture) {
+ if (!updateRequestSent || updateImmediately)
+ sendUpdateRequest(tlw, updateImmediately);
+ return;
+ }
+
+
const QRect widgetRect = widget->d_func()->effectiveRectFor(rect);
const QRect translatedRect(widgetRect.translated(widget->mapTo(tlw, QPoint())));
if (qt_region_strictContains(dirty, translatedRect)) {
@@ -703,7 +732,12 @@ void QWidgetBackingStore::updateLists(QWidget *cur)
}
QWidgetBackingStore::QWidgetBackingStore(QWidget *topLevel)
- : tlw(topLevel), dirtyOnScreenWidgets(0), fullUpdatePending(0)
+ : tlw(topLevel),
+ dirtyOnScreenWidgets(0),
+ widgetTextures(0),
+ fullUpdatePending(0),
+ updateRequestSent(0),
+ textureListWatcher(0)
{
store = tlw->backingStore();
Q_ASSERT(store);
@@ -892,17 +926,17 @@ static inline bool discardSyncRequest(QWidget *tlw, QTLWExtra *tlwExtra)
void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedRegion)
{
QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
- if (discardSyncRequest(tlw, tlwExtra) || tlwExtra->inTopLevelResize)
+ if (!tlw->isVisible() || !tlwExtra || tlwExtra->inTopLevelResize)
return;
- if (!exposedWidget || !exposedWidget->internalWinId() || !exposedWidget->isVisible()
+ if (!exposedWidget || !exposedWidget->internalWinId() || !exposedWidget->isVisible() || !exposedWidget->testAttribute(Qt::WA_Mapped)
|| !exposedWidget->updatesEnabled() || exposedRegion.isEmpty()) {
return;
}
// Nothing to repaint.
if (!isDirty()) {
- qt_flush(exposedWidget, exposedRegion, store, tlw, tlwOffset);
+ qt_flush(exposedWidget, exposedRegion, store, tlw, tlwOffset, widgetTextures, tlw->d_func()->shareContext());
return;
}
@@ -910,7 +944,42 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
markDirtyOnScreen(exposedRegion, exposedWidget, exposedWidget->mapTo(tlw, QPoint()));
else
markDirtyOnScreen(exposedRegion, exposedWidget, QPoint());
- sync();
+
+ doSync();
+}
+
+#ifndef QT_NO_OPENGL
+static void findTextureWidgetsRecursively(QWidget *tlw, QWidget *widget, QPlatformTextureList *widgetTextures)
+{
+ QWidgetPrivate *wd = QWidgetPrivate::get(widget);
+ if (wd->renderToTexture)
+ widgetTextures->appendTexture(wd->textureId(), QRect(widget->mapTo(tlw, QPoint()), widget->size()));
+
+ for (int i = 0; i < wd->children.size(); ++i) {
+ QWidget *w = qobject_cast<QWidget *>(wd->children.at(i));
+ if (w && !w->isWindow() && !w->isHidden() && QWidgetPrivate::get(w)->textureChildSeen)
+ findTextureWidgetsRecursively(tlw, w, widgetTextures);
+ }
+}
+#endif
+
+QPlatformTextureListWatcher::QPlatformTextureListWatcher(QWidgetBackingStore *backingStore)
+ : m_locked(false),
+ m_backingStore(backingStore)
+{
+}
+
+void QPlatformTextureListWatcher::watch(QPlatformTextureList *textureList)
+{
+ connect(textureList, SIGNAL(locked(bool)), SLOT(onLockStatusChanged(bool)));
+ m_locked = textureList->isLocked();
+}
+
+void QPlatformTextureListWatcher::onLockStatusChanged(bool locked)
+{
+ m_locked = locked;
+ if (!locked)
+ m_backingStore->sync();
}
/*!
@@ -918,6 +987,7 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
*/
void QWidgetBackingStore::sync()
{
+ updateRequestSent = false;
QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
if (discardSyncRequest(tlw, tlwExtra)) {
// If the top-level is minimized, it's not visible on the screen so we can delay the
@@ -935,10 +1005,26 @@ void QWidgetBackingStore::sync()
return;
}
+ if (textureListWatcher && !textureListWatcher->isLocked()) {
+ textureListWatcher->deleteLater();
+ textureListWatcher = 0;
+ } else if (widgetTextures && widgetTextures->isLocked()) {
+ if (!textureListWatcher)
+ textureListWatcher = new QPlatformTextureListWatcher(this);
+ if (!textureListWatcher->isLocked())
+ textureListWatcher->watch(widgetTextures);
+ return;
+ }
+
+ doSync();
+}
+
+void QWidgetBackingStore::doSync()
+{
const bool updatesDisabled = !tlw->updatesEnabled();
bool repaintAllWidgets = false;
- const bool inTopLevelResize = tlwExtra->inTopLevelResize;
+ const bool inTopLevelResize = tlw->d_func()->maybeTopData()->inTopLevelResize;
const QRect tlwRect(topLevelRect());
const QRect surfaceGeometry(tlwRect.topLeft(), store->size());
if ((fullUpdatePending || inTopLevelResize || surfaceGeometry.size() != tlwRect.size()) && !updatesDisabled) {
@@ -1018,7 +1104,15 @@ void QWidgetBackingStore::sync()
}
dirtyWidgets.clear();
+#ifndef QT_NO_OPENGL
+ delete widgetTextures;
+ widgetTextures = 0;
+ if (tlw->d_func()->textureChildSeen) {
+ widgetTextures = new QPlatformTextureList;
+ findTextureWidgetsRecursively(tlw, tlw, widgetTextures);
+ }
fullUpdatePending = false;
+#endif
if (toClean.isEmpty()) {
// Nothing to repaint. However, we might have newly exposed areas on the
@@ -1032,6 +1126,7 @@ void QWidgetBackingStore::sync()
if (tlw->d_func()->extra->proxyWidget) {
updateStaticContentsSize();
dirty = QRegion();
+ updateRequestSent = false;
const QVector<QRect> rects(toClean.rects());
for (int i = 0; i < rects.size(); ++i)
tlw->d_func()->extra->proxyWidget->update(rects.at(i));
@@ -1045,6 +1140,7 @@ void QWidgetBackingStore::sync()
for (int i = 0; i < opaqueNonOverlappedWidgets.size(); ++i)
resetWidget(opaqueNonOverlappedWidgets[i]);
dirty = QRegion();
+ updateRequestSent = false;
return;
}
@@ -1053,6 +1149,7 @@ void QWidgetBackingStore::sync()
updateStaticContentsSize();
const QRegion dirtyCopy(dirty);
dirty = QRegion();
+ updateRequestSent = false;
// Paint opaque non overlapped widgets.
for (int i = 0; i < opaqueNonOverlappedWidgets.size(); ++i) {
@@ -1093,12 +1190,19 @@ void QWidgetBackingStore::flush(QWidget *widget)
{
if (!dirtyOnScreen.isEmpty()) {
QWidget *target = widget ? widget : tlw;
- qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset);
+ qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset, widgetTextures, tlw->d_func()->shareContext());
dirtyOnScreen = QRegion();
}
- if (!dirtyOnScreenWidgets || dirtyOnScreenWidgets->isEmpty())
+ if (!dirtyOnScreenWidgets || dirtyOnScreenWidgets->isEmpty()) {
+#ifndef QT_NO_OPENGL
+ if (widgetTextures && widgetTextures->count()) {
+ QWidget *target = widget ? widget : tlw;
+ qt_flush(target, QRegion(), store, tlw, tlwOffset, widgetTextures, tlw->d_func()->shareContext());
+ }
+#endif
return;
+ }
for (int i = 0; i < dirtyOnScreenWidgets->size(); ++i) {
QWidget *w = dirtyOnScreenWidgets->at(i);
diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h
index b6c3e13cb0..2fe58fa4a7 100644
--- a/src/widgets/kernel/qwidgetbackingstore_p.h
+++ b/src/widgets/kernel/qwidgetbackingstore_p.h
@@ -60,6 +60,9 @@
QT_BEGIN_NAMESPACE
+class QPlatformTextureList;
+class QWidgetBackingStore;
+
struct BeginPaintInfo {
inline BeginPaintInfo() : wasFlushed(0), nothingToPaint(0), backingStoreRecreated(0) {}
uint wasFlushed : 1;
@@ -67,6 +70,23 @@ struct BeginPaintInfo {
uint backingStoreRecreated : 1;
};
+class QPlatformTextureListWatcher : public QObject
+{
+ Q_OBJECT
+
+public:
+ QPlatformTextureListWatcher(QWidgetBackingStore *backingStore);
+ void watch(QPlatformTextureList *textureList);
+ bool isLocked() const { return m_locked; }
+
+private slots:
+ void onLockStatusChanged(bool locked);
+
+private:
+ bool m_locked;
+ QWidgetBackingStore *m_backingStore;
+};
+
class Q_AUTOTEST_EXPORT QWidgetBackingStore
{
public:
@@ -102,14 +122,21 @@ private:
QVector<QWidget *> dirtyWidgets;
QVector<QWidget *> *dirtyOnScreenWidgets;
QList<QWidget *> staticWidgets;
+ QPlatformTextureList *widgetTextures;
QBackingStore *store;
uint fullUpdatePending : 1;
+ uint updateRequestSent : 1;
QPoint tlwOffset;
+ QPlatformTextureListWatcher *textureListWatcher;
+
+ void sendUpdateRequest(QWidget *widget, bool updateImmediately);
+
static bool flushPaint(QWidget *widget, const QRegion &rgn);
static void unflushPaint(QWidget *widget, const QRegion &rgn);
+ void doSync();
bool bltRect(const QRect &rect, int dx, int dy, QWidget *widget);
void releaseBuffer();
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 167102c633..0e40dd866f 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -50,6 +50,7 @@
#include <private/qwidgetbackingstore_p.h>
#include <qpa/qwindowsysteminterface_p.h>
#include <qpa/qplatformtheme.h>
+#include <qpa/qplatformwindow.h>
#include <private/qgesturemanager_p.h>
QT_BEGIN_NAMESPACE
@@ -91,6 +92,12 @@ QWidgetWindow::QWidgetWindow(QWidget *widget)
, m_widget(widget)
{
updateObjectName();
+ // Enable QOpenGLWidget/QQuickWidget children if the platform plugin supports it,
+ // and the application developer has not explicitly disabled it.
+ if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::RasterGLSurface)
+ && !QApplication::testAttribute(Qt::AA_ForceRasterWidgets)) {
+ setSurfaceType(QSurface::RasterGLSurface);
+ }
connect(m_widget, &QObject::objectNameChanged, this, &QWidgetWindow::updateObjectName);
}
@@ -473,7 +480,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
if (!widget)
widget = m_widget;
- if (event->type() == QEvent::MouseButtonPress)
+ if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonDblClick)
qt_button_down = widget;
QWidget *receiver = QApplicationPrivate::pickMouseReceiver(m_widget, event->windowPos().toPoint(), &mapped, event->type(), event->buttons(),
@@ -484,12 +491,17 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
QApplicationPrivate::mouse_buttons &= ~event->button();
return;
}
-
- QMouseEvent translated(event->type(), mapped, event->windowPos(), event->screenPos(), event->button(), event->buttons(), event->modifiers());
- translated.setTimestamp(event->timestamp());
- QApplicationPrivate::sendMouseEvent(receiver, &translated, widget, m_widget, &qt_button_down,
- qt_last_mouse_receiver);
-
+ if ((event->type() != QEvent::MouseButtonPress)
+ || !(event->flags().testFlag(Qt::MouseEventCreatedDoubleClick))) {
+
+ // The preceding statement excludes MouseButtonPress events which caused
+ // creation of a MouseButtonDblClick event. QTBUG-25831
+ QMouseEvent translated(event->type(), mapped, event->windowPos(), event->screenPos(),
+ event->button(), event->buttons(), event->modifiers());
+ translated.setTimestamp(event->timestamp());
+ QApplicationPrivate::sendMouseEvent(receiver, &translated, widget, m_widget,
+ &qt_button_down, qt_last_mouse_receiver);
+ }
#ifndef QT_NO_CONTEXTMENU
if (event->type() == contextMenuTrigger && event->button() == Qt::RightButton) {
QContextMenuEvent e(QContextMenuEvent::Mouse, mapped, event->globalPos(), event->modifiers());
@@ -542,6 +554,24 @@ void QWidgetWindow::updateGeometry()
m_widget->data->fstrut_dirty = false;
}
+Qt::WindowState effectiveState(Qt::WindowStates state);
+
+// Store normal geometry used for saving application settings.
+void QWidgetWindow::updateNormalGeometry()
+{
+ QTLWExtra *tle = m_widget->d_func()->maybeTopData();
+ if (!tle)
+ return;
+ // Ask platform window, default to widget geometry.
+ QRect normalGeometry;
+ if (const QPlatformWindow *pw = handle())
+ normalGeometry = pw->normalGeometry();
+ if (!normalGeometry.isValid() && effectiveState(m_widget->windowState()) == Qt::WindowNoState)
+ normalGeometry = m_widget->geometry();
+ if (normalGeometry.isValid())
+ tle->normalGeometry = normalGeometry;
+}
+
void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
{
updateGeometry();
@@ -654,6 +684,11 @@ void QWidgetWindow::handleDragLeaveEvent(QDragLeaveEvent *event)
void QWidgetWindow::handleDropEvent(QDropEvent *event)
{
+ if (m_dragTarget.isNull()) {
+ qWarning() << Q_FUNC_INFO << m_widget << ": No drag target set.";
+ event->ignore();
+ return;
+ }
const QPoint mapped = m_dragTarget.data()->mapFromGlobal(m_widget->mapToGlobal(event->pos()));
QDropEvent translated(mapped, event->possibleActions(), event->mimeData(), event->mouseButtons(), event->keyboardModifiers());
QGuiApplication::sendSpontaneousEvent(m_dragTarget.data(), &translated);
@@ -682,8 +717,6 @@ void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
}
}
-Qt::WindowState effectiveState(Qt::WindowStates state);
-
void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event)
{
// QWindow does currently not know 'active'.
@@ -702,16 +735,12 @@ void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event
widgetState |= Qt::WindowMinimized;
break;
case Qt::WindowMaximized:
- if (effectiveState(widgetState) == Qt::WindowNoState)
- if (QTLWExtra *tle = m_widget->d_func()->maybeTopData())
- tle->normalGeometry = m_widget->geometry();
+ updateNormalGeometry();
widgetState |= Qt::WindowMaximized;
widgetState &= ~(Qt::WindowMinimized | Qt::WindowFullScreen);
break;
case Qt::WindowFullScreen:
- if (effectiveState(widgetState) == Qt::WindowNoState)
- if (QTLWExtra *tle = m_widget->d_func()->maybeTopData())
- tle->normalGeometry = m_widget->geometry();
+ updateNormalGeometry();
widgetState |= Qt::WindowFullScreen;
widgetState &= ~(Qt::WindowMinimized);
break;
diff --git a/src/widgets/kernel/qwidgetwindow_qpa_p.h b/src/widgets/kernel/qwidgetwindow_qpa_p.h
index ffde44dd27..8d6f14a669 100644
--- a/src/widgets/kernel/qwidgetwindow_qpa_p.h
+++ b/src/widgets/kernel/qwidgetwindow_qpa_p.h
@@ -104,6 +104,7 @@ private slots:
private:
void updateGeometry();
+ void updateNormalGeometry();
enum FocusWidgets {
FirstFocusWidget,
diff --git a/src/widgets/kernel/win.pri b/src/widgets/kernel/win.pri
index d5cba740d1..76bb709e2b 100644
--- a/src/widgets/kernel/win.pri
+++ b/src/widgets/kernel/win.pri
@@ -2,6 +2,6 @@
# --------------------------------------------------------------------
INCLUDEPATH += ../3rdparty/wintab
-!wince* {
+!wince*:!winrt {
LIBS_PRIVATE *= -lshell32
}
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 79a52c00cb..d8530bca1e 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -143,8 +143,6 @@ const int QMacStylePrivate::SmallButtonH = 30;
const int QMacStylePrivate::BevelButtonW = 50;
const int QMacStylePrivate::BevelButtonH = 22;
const int QMacStylePrivate::PushButtonContentPadding = 6;
-const qreal QMacStylePrivate::ScrollBarFadeOutDuration = 200.0;
-const qreal QMacStylePrivate::ScrollBarFadeOutDelay = 450.0;
QSet<QPointer<QObject> > QMacStylePrivate::scrollBars;
@@ -5049,24 +5047,23 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
styleObject->setProperty("_q_stylestate", static_cast<int>(slider->state));
styleObject->setProperty("_q_stylecontrols", static_cast<uint>(slider->activeSubControls));
- QScrollbarAnimation *anim = qobject_cast<QScrollbarAnimation *>(d->animation(styleObject));
+ QScrollbarStyleAnimation *anim = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject));
if (transient) {
if (!anim) {
- anim = new QScrollbarAnimation(styleObject);
- anim->setFadingOut();
+ anim = new QScrollbarStyleAnimation(QScrollbarStyleAnimation::Deactivating, styleObject);
d->startAnimation(anim);
- } else if (anim->isFadingOut()) {
+ } else if (anim->mode() == QScrollbarStyleAnimation::Deactivating) {
// the scrollbar was already fading out while the
// state changed -> restart the fade out animation
anim->setCurrentTime(0);
}
- } else if (anim && anim->isFadingOut()) {
+ } else if (anim && anim->mode() == QScrollbarStyleAnimation::Deactivating) {
d->stopAnimation(styleObject);
}
}
- QScrollbarAnimation *anim = qobject_cast<QScrollbarAnimation *>(d->animation(styleObject));
- if (anim && anim->isFadingOut()) {
+ QScrollbarStyleAnimation *anim = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject));
+ if (anim && anim->mode() == QScrollbarStyleAnimation::Deactivating) {
// once a scrollbar was active (hovered/pressed), it retains
// the active look even if it's no longer active while fading out
if (oldActiveControls)
@@ -5080,11 +5077,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
if (shouldExpand) {
if (!anim && !oldActiveControls) {
// Start expand animation only once and when entering
- anim = new QScrollbarAnimation(styleObject);
- anim->setExpanding();
+ anim = new QScrollbarStyleAnimation(QScrollbarStyleAnimation::Activating, styleObject);
d->startAnimation(anim);
}
- if (anim && !anim->isFadingOut()) {
+ if (anim && anim->mode() == QScrollbarStyleAnimation::Activating) {
expandScale = 1.0 + (maxExpandScale - 1.0) * anim->currentValue();
expandOffset = 5.5 * anim->currentValue() - 1;
} else {
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index efeaa66e39..6f42f0ea79 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -156,8 +156,6 @@ public:
static const int BevelButtonW;
static const int BevelButtonH;
static const int PushButtonContentPadding;
- static const qreal ScrollBarFadeOutDuration;
- static const qreal ScrollBarFadeOutDelay;
enum Animates { AquaPushButton, AquaProgressBar, AquaListViewItemOpen, AquaScrollBar };
static ThemeDrawState getDrawState(QStyle::State flags);
@@ -216,49 +214,6 @@ public:
void *indicatorBranchButtonCell;
};
-class QScrollbarAnimation : public QNumberStyleAnimation
-{
- Q_OBJECT
-
-public:
- QScrollbarAnimation(QObject *target) : QNumberStyleAnimation(target), _active(false)
- { }
-
- bool wasActive() const { return _active; }
- void setActive(bool active) { _active = active; }
-
- bool isFadingOut() const { return _isFadingOut; }
-
- void setFadingOut()
- {
- _isFadingOut = true;
- setDuration(QMacStylePrivate::ScrollBarFadeOutDelay + QMacStylePrivate::ScrollBarFadeOutDuration);
- setDelay(QMacStylePrivate::ScrollBarFadeOutDelay);
- setStartValue(1.0);
- setEndValue(0.0);
- }
-
- void setExpanding()
- {
- _isFadingOut = false;
- setDuration(QMacStylePrivate::ScrollBarFadeOutDuration);
- setStartValue(0.0);
- setEndValue(1.0);
- }
-
-private slots:
- void updateCurrentTime(int time)
- {
- QNumberStyleAnimation::updateCurrentTime(time);
- if (_isFadingOut && qFuzzyIsNull(currentValue()))
- target()->setProperty("visible", false);
- }
-
-private:
- bool _active;
- bool _isFadingOut;
-};
-
QT_END_NAMESPACE
#endif // QMACSTYLE_MAC_P_P_H
diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h
index bbb216bf92..04112169ca 100644
--- a/src/widgets/styles/qstyle.h
+++ b/src/widgets/styles/qstyle.h
@@ -685,7 +685,7 @@ public:
SH_Menu_FadeOutOnHide,
SH_SpinBox_ClickAutoRepeatThreshold,
SH_ItemView_PaintAlternatingRowColorsForEmptyArea,
- SH_FormLayoutWrapPolicy,
+ SH_FormLayoutWrapPolicy,
SH_TabWidget_DefaultTabPosition,
SH_ToolBar_Movable,
SH_FormLayoutFieldGrowthPolicy,
diff --git a/src/widgets/styles/qstyleanimation.cpp b/src/widgets/styles/qstyleanimation.cpp
index 90fb371982..85dc357ab5 100644
--- a/src/widgets/styles/qstyleanimation.cpp
+++ b/src/widgets/styles/qstyleanimation.cpp
@@ -46,6 +46,9 @@
QT_BEGIN_NAMESPACE
+static const qreal ScrollBarFadeOutDuration = 200.0;
+static const qreal ScrollBarFadeOutDelay = 450.0;
+
QStyleAnimation::QStyleAnimation(QObject *target) : QAbstractAnimation(target),
_delay(0), _duration(-1), _startTime(QTime::currentTime())
{
@@ -301,4 +304,43 @@ void QBlendStyleAnimation::updateCurrentTime(int time)
_current = blendedImage(_start, _end, alpha);
}
+QScrollbarStyleAnimation::QScrollbarStyleAnimation(Mode mode, QObject *target) : QNumberStyleAnimation(target), _mode(mode), _active(false)
+{
+ switch (mode) {
+ case Activating:
+ setDuration(ScrollBarFadeOutDuration);
+ setStartValue(0.0);
+ setEndValue(1.0);
+ break;
+ case Deactivating:
+ setDuration(ScrollBarFadeOutDelay + ScrollBarFadeOutDuration);
+ setDelay(ScrollBarFadeOutDelay);
+ setStartValue(1.0);
+ setEndValue(0.0);
+ break;
+ }
+}
+
+QScrollbarStyleAnimation::Mode QScrollbarStyleAnimation::mode() const
+{
+ return _mode;
+}
+
+bool QScrollbarStyleAnimation::wasActive() const
+{
+ return _active;
+}
+
+void QScrollbarStyleAnimation::setActive(bool active)
+{
+ _active = active;
+}
+
+void QScrollbarStyleAnimation::updateCurrentTime(int time)
+{
+ QNumberStyleAnimation::updateCurrentTime(time);
+ if (_mode == Deactivating && qFuzzyIsNull(currentValue()))
+ target()->setProperty("visible", false);
+}
+
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qstyleanimation_p.h b/src/widgets/styles/qstyleanimation_p.h
index 77962bedac..c344858812 100644
--- a/src/widgets/styles/qstyleanimation_p.h
+++ b/src/widgets/styles/qstyleanimation_p.h
@@ -162,6 +162,28 @@ private:
QImage _current;
};
+class QScrollbarStyleAnimation : public QNumberStyleAnimation
+{
+ Q_OBJECT
+
+public:
+ enum Mode { Activating, Deactivating };
+
+ QScrollbarStyleAnimation(Mode mode, QObject *target);
+
+ Mode mode() const;
+
+ bool wasActive() const;
+ void setActive(bool active);
+
+private slots:
+ void updateCurrentTime(int time);
+
+private:
+ Mode _mode;
+ bool _active;
+};
+
QT_END_NAMESPACE
#endif // QSTYLEANIMATION_P_H
diff --git a/src/widgets/styles/qwindowscestyle.cpp b/src/widgets/styles/qwindowscestyle.cpp
index 564e84b35b..576dd4165e 100644
--- a/src/widgets/styles/qwindowscestyle.cpp
+++ b/src/widgets/styles/qwindowscestyle.cpp
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
static const int windowsItemFrame = 2; // menu item frame width
static const int windowsItemHMargin = 3; // menu item hor text margin
static const int windowsItemVMargin = 2; // menu item ver text margin
-static const int windowsArrowHMargin = 6; // arrow horizontal margin
+static const int windowsArrowHMargin = 6; // arrow horizontal margin
static const int windowsRightBorder = 15; // right border on windows
static const int windowsCheckMarkWidth = 14; // checkmarks width on windows
diff --git a/src/widgets/styles/qwindowsmobilestyle.cpp b/src/widgets/styles/qwindowsmobilestyle.cpp
index 36c5d7e1bb..5e6a53ed78 100644
--- a/src/widgets/styles/qwindowsmobilestyle.cpp
+++ b/src/widgets/styles/qwindowsmobilestyle.cpp
@@ -97,8 +97,8 @@ static const int PE_IndicatorArrowRightBig = 0xf000104;
/* XPM */
static const char *const radiobutton_xpm[] = {
"30 30 2 1",
- " c None",
- ". c #000000",
+ " c None",
+ ". c #000000",
" ........ ",
" .............. ",
" .... .... ",
@@ -133,8 +133,8 @@ static const char *const radiobutton_xpm[] = {
/* XPM */
static const char * const radiobutton_low_xpm[] = {
"15 15 2 1",
- " c None",
- ". c #000000",
+ " c None",
+ ". c #000000",
" ..... ",
" .. .. ",
" . . ",
@@ -216,8 +216,8 @@ static const char *const vertlines_xpm[] = {
/* XPM */
static const char *const radiochecked_xpm[] = {
"18 18 2 1",
- " c None",
- ". c #000000",
+ " c None",
+ ". c #000000",
" ...... ",
" .......... ",
" .............. ",
@@ -240,8 +240,8 @@ static const char *const radiochecked_xpm[] = {
/* XPM */
static const char * const radiochecked_low_xpm[] = {
"9 9 2 1",
- " c None",
- ". c #000000",
+ " c None",
+ ". c #000000",
" ... ",
" ....... ",
" ....... ",
@@ -254,8 +254,8 @@ static const char * const radiochecked_low_xpm[] = {
static const char *const arrowdown_xpm[] = {
"15 8 2 1",
- " c None",
- ". c #000000",
+ " c None",
+ ". c #000000",
"...............",
" ............. ",
" ........... ",
@@ -268,8 +268,8 @@ static const char *const arrowdown_xpm[] = {
static const char *const arrowdown_big_xpm[] = {
"17 9 2 1",
- " c None",
- ". c #000000",
+ " c None",
+ ". c #000000",
".................",
" ............... ",
" ............. ",
@@ -284,8 +284,8 @@ static const char *const arrowdown_big_xpm[] = {
/* XPM */
static const char *const checkedlight_xpm[] = {
"24 24 2 1",
- " c None",
- ". c #000000",
+ " c None",
+ ". c #000000",
" ",
" ",
" ",
@@ -315,8 +315,8 @@ static const char *const checkedlight_xpm[] = {
/* XPM */
static const char *const checkedbold_xpm[] = {
"26 26 2 1",
- " c None",
- ". c #000000",
+ " c None",
+ ". c #000000",
" ",
" ",
" ",
@@ -347,8 +347,8 @@ static const char *const checkedbold_xpm[] = {
/* XPM */
static const char * const checkedbold_low_xpm[] = {
"9 8 2 1",
- " c None",
- ". c #000000",
+ " c None",
+ ". c #000000",
" .",
" ..",
". ...",
@@ -361,8 +361,8 @@ static const char * const checkedbold_low_xpm[] = {
/* XPM */
static const char * const checkedlight_low_xpm[] = {
"8 8 2 1",
- " c None",
- ". c #000000",
+ " c None",
+ ". c #000000",
" .",
" ..",
" ...",
@@ -375,9 +375,9 @@ static const char * const checkedlight_low_xpm[] = {
/* XPM */
static const char * const highlightedradiobutton_xpm[] = {
"30 30 3 1",
- " c None",
- ". c #000000",
- "+ c #0078CC",
+ " c None",
+ ". c #000000",
+ "+ c #0078CC",
" ........ ",
" .............. ",
" ....++++++++.... ",
@@ -412,9 +412,9 @@ static const char * const highlightedradiobutton_xpm[] = {
/* XPM */
static const char * const highlightedradiobutton_low_xpm[] = {
"15 15 3 1",
- " c None",
- ". c #000000",
- "+ c #3192D6",
+ " c None",
+ ". c #000000",
+ "+ c #3192D6",
" ..... ",
" ..+++++.. ",
" .++ ++. ",
@@ -434,10 +434,10 @@ static const char * const highlightedradiobutton_low_xpm[] = {
/* XPM */
static const char * const cross_big_xpm[] = {
"28 28 4 1",
-" c #09454A",
-". c #218C98",
-"+ c #47D8E5",
-"@ c #FDFFFC",
+" c #09454A",
+". c #218C98",
+"+ c #47D8E5",
+"@ c #FDFFFC",
" ",
" ",
" ++++++++++++++++++++++++ ",
@@ -470,10 +470,10 @@ static const char * const cross_big_xpm[] = {
/* XPM */
static const char * const cross_small_xpm[] = {
"14 14 4 1",
-" c #09454A",
-". c #218C98",
-"+ c #47D8E5",
-"@ c #FCFFFC",
+" c #09454A",
+". c #218C98",
+"+ c #47D8E5",
+"@ c #FCFFFC",
" ",
" ++++++++++++ ",
" +..........+ ",
@@ -492,10 +492,10 @@ static const char * const cross_small_xpm[] = {
/* XPM */
static const char * const max_big_xpm[] = {
"28 28 4 1",
-" c #09454A",
-". c #218C98",
-"+ c #47D8E5",
-"@ c #FDFFFC",
+" c #09454A",
+". c #218C98",
+"+ c #47D8E5",
+"@ c #FDFFFC",
" ",
" ",
" ++++++++++++++++++++++++ ",
@@ -528,10 +528,10 @@ static const char * const max_big_xpm[] = {
/* XPM */
static const char * const max_small_xpm[] = {
"14 14 4 1",
-" c #09454A",
-". c #218C98",
-"+ c #47D8E5",
-"@ c #FCFFFC",
+" c #09454A",
+". c #218C98",
+"+ c #47D8E5",
+"@ c #FCFFFC",
" ",
" ++++++++++++ ",
" +..........+ ",
@@ -550,10 +550,10 @@ static const char * const max_small_xpm[] = {
/* XPM */
static const char * const normal_big_xpm[] = {
"28 28 4 1",
-" c #09454A",
-". c #218C98",
-"+ c #47D8E5",
-"@ c #FDFFFC",
+" c #09454A",
+". c #218C98",
+"+ c #47D8E5",
+"@ c #FDFFFC",
" ",
" ",
" ++++++++++++++++++++++++ ",
@@ -586,10 +586,10 @@ static const char * const normal_big_xpm[] = {
/* XPM */
static const char * const normal_small_xpm[] = {
"14 14 4 1",
-" c #09454A",
-". c #218C98",
-"+ c #47D8E5",
-"@ c #FCFFFC",
+" c #09454A",
+". c #218C98",
+"+ c #47D8E5",
+"@ c #FCFFFC",
" ",
" ++++++++++++ ",
" +..........+ ",
@@ -609,10 +609,10 @@ static const char * const normal_small_xpm[] = {
/* XPM */
static const char * const min_big_xpm[] = {
"28 28 4 1",
-" c #09454A",
-". c #218C98",
-"+ c #47D8E5",
-"@ c #FDFFFC",
+" c #09454A",
+". c #218C98",
+"+ c #47D8E5",
+"@ c #FDFFFC",
" ",
" ",
" ++++++++++++++++++++++++ ",
@@ -645,10 +645,10 @@ static const char * const min_big_xpm[] = {
/* XPM */
static const char * const min_small_xpm[] = {
"14 14 4 1",
-" c #09454A",
-". c #218C98",
-"+ c #47D8E5",
-"@ c #FCFFFC",
+" c #09454A",
+". c #218C98",
+"+ c #47D8E5",
+"@ c #FCFFFC",
" ",
" ++++++++++++ ",
" +..........+ ",
@@ -668,51 +668,51 @@ static const char * const min_small_xpm[] = {
static char * sbhandleup_xpm[] = {
"26 41 45 1",
-" c None",
-". c #000000",
-"+ c #E7E7E7",
-"@ c #D6D7D6",
-"# c #949294",
-"$ c #737573",
-"% c #636563",
-"& c #636163",
-"* c #5A5D5A",
-"= c #5A595A",
-"- c #525552",
-"; c #525152",
-"> c #4A4D4A",
-", c #7B797B",
-"' c #CECFCE",
-") c #CED3CE",
-"! c #6B6D6B",
-"~ c #6B696B",
-"{ c #737173",
-"] c #7B7D7B",
-"^ c #848684",
-"/ c #848284",
-"( c #8C8A8C",
-"_ c #8C8E8C",
-": c #B5B2B5",
-"< c #FFFFFF",
-"[ c #949694",
-"} c #B5B6B5",
-"| c #9C9A9C",
-"1 c #ADAEAD",
-"2 c #9C9E9C",
-"3 c #BDBABD",
-"4 c #BDBEBD",
-"5 c #F7F3F7",
-"6 c #C6C3C6",
-"7 c #C6C7C6",
-"8 c #A5A2A5",
-"9 c #CECBCE",
-"0 c #FFFBFF",
-"a c #ADAAAD",
-"b c #A5A6A5",
-"c c #D6D3D6",
-"d c #B5BAB5",
-"e c #DEDFDE",
-"f c #DEDBDE",
+" c None",
+". c #000000",
+"+ c #E7E7E7",
+"@ c #D6D7D6",
+"# c #949294",
+"$ c #737573",
+"% c #636563",
+"& c #636163",
+"* c #5A5D5A",
+"= c #5A595A",
+"- c #525552",
+"; c #525152",
+"> c #4A4D4A",
+", c #7B797B",
+"' c #CECFCE",
+") c #CED3CE",
+"! c #6B6D6B",
+"~ c #6B696B",
+"{ c #737173",
+"] c #7B7D7B",
+"^ c #848684",
+"/ c #848284",
+"( c #8C8A8C",
+"_ c #8C8E8C",
+": c #B5B2B5",
+"< c #FFFFFF",
+"[ c #949694",
+"} c #B5B6B5",
+"| c #9C9A9C",
+"1 c #ADAEAD",
+"2 c #9C9E9C",
+"3 c #BDBABD",
+"4 c #BDBEBD",
+"5 c #F7F3F7",
+"6 c #C6C3C6",
+"7 c #C6C7C6",
+"8 c #A5A2A5",
+"9 c #CECBCE",
+"0 c #FFFBFF",
+"a c #ADAAAD",
+"b c #A5A6A5",
+"c c #D6D3D6",
+"d c #B5BAB5",
+"e c #DEDFDE",
+"f c #DEDBDE",
"..........................",
"+@#$%%&&&**===---;;;;>=,'+",
"+@#$%%&&&**===---;;;;>=$'+",
@@ -757,52 +757,52 @@ static char * sbhandleup_xpm[] = {
static char * sbhandledown_xpm[] = {
"26 40 46 1",
-" c None",
-". c #E7E7E7",
-"+ c #DEDFDE",
-"@ c #BDBEBD",
-"# c #B5B2B5",
-"$ c #ADAAAD",
-"% c #A5A6A5",
-"& c #A5A2A5",
-"* c #9C9E9C",
-"= c #9C9A9C",
-"- c #949694",
-"; c #949294",
-"> c #D6D7D6",
-", c #DEDBDE",
-"' c #D6DBD6",
-") c #ADAEAD",
-"! c #8C8E8C",
-"~ c #8C8A8C",
-"{ c #BDBABD",
-"] c #848684",
-"^ c #B5BAB5",
-"/ c #848284",
-"( c #848A84",
-"_ c #7B7D7B",
-": c #7B797B",
-"< c #C6C3C6",
-"[ c #D6D3D6",
-"} c #FFFBFF",
-"| c #CECFCE",
-"1 c #FFFFFF",
-"2 c #737573",
-"3 c #F7F3F7",
-"4 c #CECBCE",
-"5 c #737173",
-"6 c #C6C7C6",
-"7 c #6B6D6B",
-"8 c #B5B6B5",
-"9 c #6B696B",
-"0 c #636563",
-"a c #636163",
-"b c #5A5D5A",
-"c c #5A595A",
-"d c #525552",
-"e c #525152",
-"f c #4A4D4A",
-"g c #C6CBC6",
+" c None",
+". c #E7E7E7",
+"+ c #DEDFDE",
+"@ c #BDBEBD",
+"# c #B5B2B5",
+"$ c #ADAAAD",
+"% c #A5A6A5",
+"& c #A5A2A5",
+"* c #9C9E9C",
+"= c #9C9A9C",
+"- c #949694",
+"; c #949294",
+"> c #D6D7D6",
+", c #DEDBDE",
+"' c #D6DBD6",
+") c #ADAEAD",
+"! c #8C8E8C",
+"~ c #8C8A8C",
+"{ c #BDBABD",
+"] c #848684",
+"^ c #B5BAB5",
+"/ c #848284",
+"( c #848A84",
+"_ c #7B7D7B",
+": c #7B797B",
+"< c #C6C3C6",
+"[ c #D6D3D6",
+"} c #FFFBFF",
+"| c #CECFCE",
+"1 c #FFFFFF",
+"2 c #737573",
+"3 c #F7F3F7",
+"4 c #CECBCE",
+"5 c #737173",
+"6 c #C6C7C6",
+"7 c #6B6D6B",
+"8 c #B5B6B5",
+"9 c #6B696B",
+"0 c #636563",
+"a c #636163",
+"b c #5A5D5A",
+"c c #5A595A",
+"d c #525552",
+"e c #525152",
+"f c #4A4D4A",
+"g c #C6CBC6",
".+@#$$$%%%%&&&**==---;-%>.",
".+@#$$$%%%%&&&**==---;-%,.",
"')$$$%%%%&&&&**==--;;!!~~>",
@@ -846,45 +846,45 @@ static char * sbhandledown_xpm[] = {
static char * sbgripdown_xpm[] = {
"26 34 39 1",
-" c None",
-". c #949294",
-"+ c #9C9E9C",
-"@ c #9C9A9C",
-"# c #949694",
-"$ c #8C8E8C",
-"% c #8C8A8C",
-"& c #848684",
-"* c #848284",
-"= c #7B7D7B",
-"- c #7B797B",
-"; c #6B696B",
-"> c #636563",
-", c #737573",
-"' c #636163",
-") c #737173",
-"! c #5A5D5A",
-"~ c #6B6D6B",
-"{ c #5A595A",
-"] c #B5B6B5",
-"^ c #BDBEBD",
-"/ c #ADAEAD",
-"( c #BDBABD",
-"_ c #525552",
-": c #313031",
-"< c #525152",
-"[ c #ADAAAD",
-"} c #BDBAB5",
-"| c #4A4D4A",
-"1 c #4A494A",
-"2 c #C6C3C6",
-"3 c #C6CBC6",
-"4 c #E7E7E7",
-"5 c #DEDFDE",
-"6 c #E7E3E7",
-"7 c #DEE3DE",
-"8 c #CECBCE",
-"9 c #8C928C",
-"0 c #CECFCE",
+" c None",
+". c #949294",
+"+ c #9C9E9C",
+"@ c #9C9A9C",
+"# c #949694",
+"$ c #8C8E8C",
+"% c #8C8A8C",
+"& c #848684",
+"* c #848284",
+"= c #7B7D7B",
+"- c #7B797B",
+"; c #6B696B",
+"> c #636563",
+", c #737573",
+"' c #636163",
+") c #737173",
+"! c #5A5D5A",
+"~ c #6B6D6B",
+"{ c #5A595A",
+"] c #B5B6B5",
+"^ c #BDBEBD",
+"/ c #ADAEAD",
+"( c #BDBABD",
+"_ c #525552",
+": c #313031",
+"< c #525152",
+"[ c #ADAAAD",
+"} c #BDBAB5",
+"| c #4A4D4A",
+"1 c #4A494A",
+"2 c #C6C3C6",
+"3 c #C6CBC6",
+"4 c #E7E7E7",
+"5 c #DEDFDE",
+"6 c #E7E3E7",
+"7 c #DEE3DE",
+"8 c #CECBCE",
+"9 c #8C928C",
+"0 c #CECFCE",
"..+++@@@###...$$%&&**==-;>",
"$.++@@@@##...$$%%&**==-->>",
"$$+@@@@###..$$%%&&*==--,>>",
@@ -922,44 +922,44 @@ static char * sbgripdown_xpm[] = {
static char * sbgripup_xpm[] = {
"26 34 38 1",
-" c None",
-". c #E7E7E7",
-"+ c #D6DBD6",
-"@ c #C6C7C6",
-"# c #B5B6B5",
-"$ c #ADAEAD",
-"% c #ADAAAD",
-"& c #A5A6A5",
-"* c #A5A2A5",
-"= c #BDBEBD",
-"- c #DEDFDE",
-"; c #C6CBC6",
-"> c #9C9E9C",
-", c #E7E3E7",
-"' c #BDBABD",
-") c #B5B2B5",
-"! c #9C9A9C",
-"~ c #DEE3DE",
-"{ c #949694",
-"] c #D6D7D6",
-"^ c #949294",
-"/ c #DEDBDE",
-"( c #8C8E8C",
-"_ c #8C8A8C",
-": c #848684",
-"< c #D6D3CE",
-"[ c #CECBCE",
-"} c #D6D3D6",
-"| c #848284",
-"1 c #313031",
-"2 c #7B7D7B",
-"3 c #CECFCE",
-"4 c #CECBC6",
-"5 c #7B797B",
-"6 c #737573",
-"7 c #737173",
-"8 c #6B6D6B",
-"9 c #6B696B",
+" c None",
+". c #E7E7E7",
+"+ c #D6DBD6",
+"@ c #C6C7C6",
+"# c #B5B6B5",
+"$ c #ADAEAD",
+"% c #ADAAAD",
+"& c #A5A6A5",
+"* c #A5A2A5",
+"= c #BDBEBD",
+"- c #DEDFDE",
+"; c #C6CBC6",
+"> c #9C9E9C",
+", c #E7E3E7",
+"' c #BDBABD",
+") c #B5B2B5",
+"! c #9C9A9C",
+"~ c #DEE3DE",
+"{ c #949694",
+"] c #D6D7D6",
+"^ c #949294",
+"/ c #DEDBDE",
+"( c #8C8E8C",
+"_ c #8C8A8C",
+": c #848684",
+"< c #D6D3CE",
+"[ c #CECBCE",
+"} c #D6D3D6",
+"| c #848284",
+"1 c #313031",
+"2 c #7B7D7B",
+"3 c #CECFCE",
+"4 c #CECBC6",
+"5 c #7B797B",
+"6 c #737573",
+"7 c #737173",
+"8 c #6B6D6B",
+"9 c #6B696B",
"....+@#$$%%%%&&&***$=-....",
"...;$$$$$%%%&&&&**>>>>@...",
".,'$$)#'#####)))$$$%*!!$~.",
@@ -997,221 +997,221 @@ static char * sbgripup_xpm[] = {
static char * sbgripmiddle_xpm[] = {
"26 2 12 1",
-" c None",
-". c #949294",
-"+ c #A5A2A5",
-"@ c #9C9E9C",
-"# c #9C9A9C",
-"$ c #949694",
-"% c #8C8E8C",
-"& c #8C8A8C",
-"* c #848684",
-"= c #848284",
-"- c #7B7D7B",
-"; c #6B696B",
+" c None",
+". c #949294",
+"+ c #A5A2A5",
+"@ c #9C9E9C",
+"# c #9C9A9C",
+"$ c #949694",
+"% c #8C8E8C",
+"& c #8C8A8C",
+"* c #848684",
+"= c #848284",
+"- c #7B7D7B",
+"; c #6B696B",
"..++@@@###$$$..%%&&*==--;;",
"..++@@@###$$$..%%&&*==--;;"};
static char * listviewhighmiddle_xpm[] = {
"8 46 197 2",
-" c None",
-". c #66759E",
-"+ c #6C789D",
-"@ c #6A789E",
-"# c #6B789E",
-"$ c #6A779D",
-"% c #6C789C",
-"& c #6F7D9B",
-"* c #6F7D9A",
-"= c #9DB6EE",
-"- c #9DB6ED",
-"; c #9CB6ED",
-"> c #A1B6EF",
-", c #A2B6F0",
-"' c #93AAE9",
-") c #95ABEA",
-"! c #94ABEA",
-"~ c #94A9E8",
-"{ c #8BA8EA",
-"] c #8BA7EA",
-"^ c #8AA7EA",
-"/ c #8EAAE8",
-"( c #8FAAE8",
-"_ c #88A2E7",
-": c #8CA3E8",
-"< c #8BA3E7",
-"[ c #8BA3E8",
-"} c #8BA2E7",
-"| c #8CA2E7",
-"1 c #8DA2E7",
-"2 c #87A1E8",
-"3 c #87A1E9",
-"4 c #86A0E8",
-"5 c #86A1E7",
-"6 c #87A2E7",
-"7 c #859EE9",
-"8 c #849DE9",
-"9 c #869EE9",
-"0 c #869FE9",
-"a c #7C9BEA",
-"b c #7C9CEA",
-"c c #7B9CEA",
-"d c #7C9BE9",
-"e c #7E9CE9",
-"f c #7B9AEA",
-"g c #7C99E9",
-"h c #7C9AEA",
-"i c #7B9AE8",
-"j c #7A9AEA",
-"k c #7996E1",
-"l c #7C96E4",
-"m c #7B96E3",
-"n c #7B95E3",
-"o c #7E95E5",
-"p c #7E95E6",
-"q c #7292E1",
-"r c #7490DF",
-"s c #7591E0",
-"t c #7590DF",
-"u c #7392E1",
-"v c #6D8CDE",
-"w c #6F8EDD",
-"x c #6E8DDD",
-"y c #6E8DDE",
-"z c #6F8EDE",
-"A c #6E8EDE",
-"B c #718EDD",
-"C c #728EDD",
-"D c #6B89E0",
-"E c #6C89DF",
-"F c #6D89E0",
-"G c #6D89DF",
-"H c #6C88DF",
-"I c #6D88DF",
-"J c #6D86DD",
-"K c #6086E0",
-"L c #6686E0",
-"M c #6586E0",
-"N c #6486E0",
-"O c #6485E0",
-"P c #6786DF",
-"Q c #5F85E0",
-"R c #6583DE",
-"S c #6683DE",
-"T c #6682DD",
-"U c #6086DF",
-"V c #5F86E0",
-"W c #567ED7",
-"X c #567ED8",
-"Y c #557DD7",
-"Z c #5A7FD8",
-"` c #6281DA",
-" . c #5379D9",
-".. c #5278D9",
-"+. c #547BD8",
-"@. c #4C73D7",
-"#. c #4B72D2",
-"$. c #4C73D4",
-"%. c #4C73D3",
-"&. c #4B72D4",
-"*. c #4F75D3",
-"=. c #5074D2",
-"-. c #4971D0",
-";. c #4871D0",
-">. c #335ECF",
-",. c #325ECB",
-"'. c #335ECD",
-"). c #335ECE",
-"!. c #325DCD",
-"~. c #2E59C9",
-"{. c #3059C9",
-"]. c #2F59C9",
-"^. c #2F59C8",
-"/. c #2B59CA",
-"(. c #3355C6",
-"_. c #3354C5",
-":. c #3156C7",
-"<. c #3056C7",
-"[. c #3355C7",
-"}. c #3355C5",
-"|. c #254EBF",
-"1. c #1F51C1",
-"2. c #234FC0",
-"3. c #234FBF",
-"4. c #2350C0",
-"5. c #1E50BE",
-"6. c #1D50C0",
-"7. c #264DBE",
-"8. c #264CBD",
-"9. c #254DBE",
-"0. c #244EBF",
-"a. c #254DBF",
-"b. c #234CBF",
-"c. c #244CC0",
-"d. c #244BC0",
-"e. c #234BC0",
-"f. c #234BBF",
-"g. c #234CBE",
-"h. c #2049B7",
-"i. c #2A49B5",
-"j. c #2749B5",
-"k. c #2749B6",
-"l. c #2D49B4",
-"m. c #2649B6",
-"n. c #2946B5",
-"o. c #2A48B6",
-"p. c #2947B5",
-"q. c #2946B6",
-"r. c #2848B6",
-"s. c #2549B5",
-"t. c #2648B6",
-"u. c #2744B5",
-"v. c #2744B4",
-"w. c #2744AF",
-"x. c #2543B4",
-"y. c #2543B2",
-"z. c #2442B2",
-"A. c #2442B3",
-"B. c #2442B5",
-"C. c #2543B3",
-"D. c #1F40B1",
-"E. c #1E40B1",
-"F. c #243EAE",
-"G. c #273BAC",
-"H. c #263DAC",
-"I. c #253CAB",
-"J. c #273CAB",
-"K. c #273CAC",
-"L. c #263BAA",
-"M. c #253CAE",
-"N. c #263BA6",
-"O. c #253BA5",
-"P. c #253AA5",
-"Q. c #253BA6",
-"R. c #253CA7",
-"S. c #263AA6",
-"T. c #243CA6",
-"U. c #253CA5",
-"V. c #273BA8",
-"W. c #2F4DA4",
-"X. c #2F4DA3",
-"Y. c #1B2F85",
-"Z. c #B5B5B6",
-"`. c #B5B5B5",
-" + c #B5B6B6",
-".+ c #B5B4B6",
-"++ c #C2C3C5",
-"@+ c #C0C3C3",
-"#+ c #C1C3C4",
-"$+ c #E3E3E3",
-"%+ c #E3E3E4",
-"&+ c #E4E3E4",
-"*+ c #E2E3E4",
-"=+ c #ECEEEB",
-"-+ c #EBEDEA",
-";+ c #EEF0ED",
-">+ c #EFF0EE",
+" c None",
+". c #66759E",
+"+ c #6C789D",
+"@ c #6A789E",
+"# c #6B789E",
+"$ c #6A779D",
+"% c #6C789C",
+"& c #6F7D9B",
+"* c #6F7D9A",
+"= c #9DB6EE",
+"- c #9DB6ED",
+"; c #9CB6ED",
+"> c #A1B6EF",
+", c #A2B6F0",
+"' c #93AAE9",
+") c #95ABEA",
+"! c #94ABEA",
+"~ c #94A9E8",
+"{ c #8BA8EA",
+"] c #8BA7EA",
+"^ c #8AA7EA",
+"/ c #8EAAE8",
+"( c #8FAAE8",
+"_ c #88A2E7",
+": c #8CA3E8",
+"< c #8BA3E7",
+"[ c #8BA3E8",
+"} c #8BA2E7",
+"| c #8CA2E7",
+"1 c #8DA2E7",
+"2 c #87A1E8",
+"3 c #87A1E9",
+"4 c #86A0E8",
+"5 c #86A1E7",
+"6 c #87A2E7",
+"7 c #859EE9",
+"8 c #849DE9",
+"9 c #869EE9",
+"0 c #869FE9",
+"a c #7C9BEA",
+"b c #7C9CEA",
+"c c #7B9CEA",
+"d c #7C9BE9",
+"e c #7E9CE9",
+"f c #7B9AEA",
+"g c #7C99E9",
+"h c #7C9AEA",
+"i c #7B9AE8",
+"j c #7A9AEA",
+"k c #7996E1",
+"l c #7C96E4",
+"m c #7B96E3",
+"n c #7B95E3",
+"o c #7E95E5",
+"p c #7E95E6",
+"q c #7292E1",
+"r c #7490DF",
+"s c #7591E0",
+"t c #7590DF",
+"u c #7392E1",
+"v c #6D8CDE",
+"w c #6F8EDD",
+"x c #6E8DDD",
+"y c #6E8DDE",
+"z c #6F8EDE",
+"A c #6E8EDE",
+"B c #718EDD",
+"C c #728EDD",
+"D c #6B89E0",
+"E c #6C89DF",
+"F c #6D89E0",
+"G c #6D89DF",
+"H c #6C88DF",
+"I c #6D88DF",
+"J c #6D86DD",
+"K c #6086E0",
+"L c #6686E0",
+"M c #6586E0",
+"N c #6486E0",
+"O c #6485E0",
+"P c #6786DF",
+"Q c #5F85E0",
+"R c #6583DE",
+"S c #6683DE",
+"T c #6682DD",
+"U c #6086DF",
+"V c #5F86E0",
+"W c #567ED7",
+"X c #567ED8",
+"Y c #557DD7",
+"Z c #5A7FD8",
+"` c #6281DA",
+" . c #5379D9",
+".. c #5278D9",
+"+. c #547BD8",
+"@. c #4C73D7",
+"#. c #4B72D2",
+"$. c #4C73D4",
+"%. c #4C73D3",
+"&. c #4B72D4",
+"*. c #4F75D3",
+"=. c #5074D2",
+"-. c #4971D0",
+";. c #4871D0",
+">. c #335ECF",
+",. c #325ECB",
+"'. c #335ECD",
+"). c #335ECE",
+"!. c #325DCD",
+"~. c #2E59C9",
+"{. c #3059C9",
+"]. c #2F59C9",
+"^. c #2F59C8",
+"/. c #2B59CA",
+"(. c #3355C6",
+"_. c #3354C5",
+":. c #3156C7",
+"<. c #3056C7",
+"[. c #3355C7",
+"}. c #3355C5",
+"|. c #254EBF",
+"1. c #1F51C1",
+"2. c #234FC0",
+"3. c #234FBF",
+"4. c #2350C0",
+"5. c #1E50BE",
+"6. c #1D50C0",
+"7. c #264DBE",
+"8. c #264CBD",
+"9. c #254DBE",
+"0. c #244EBF",
+"a. c #254DBF",
+"b. c #234CBF",
+"c. c #244CC0",
+"d. c #244BC0",
+"e. c #234BC0",
+"f. c #234BBF",
+"g. c #234CBE",
+"h. c #2049B7",
+"i. c #2A49B5",
+"j. c #2749B5",
+"k. c #2749B6",
+"l. c #2D49B4",
+"m. c #2649B6",
+"n. c #2946B5",
+"o. c #2A48B6",
+"p. c #2947B5",
+"q. c #2946B6",
+"r. c #2848B6",
+"s. c #2549B5",
+"t. c #2648B6",
+"u. c #2744B5",
+"v. c #2744B4",
+"w. c #2744AF",
+"x. c #2543B4",
+"y. c #2543B2",
+"z. c #2442B2",
+"A. c #2442B3",
+"B. c #2442B5",
+"C. c #2543B3",
+"D. c #1F40B1",
+"E. c #1E40B1",
+"F. c #243EAE",
+"G. c #273BAC",
+"H. c #263DAC",
+"I. c #253CAB",
+"J. c #273CAB",
+"K. c #273CAC",
+"L. c #263BAA",
+"M. c #253CAE",
+"N. c #263BA6",
+"O. c #253BA5",
+"P. c #253AA5",
+"Q. c #253BA6",
+"R. c #253CA7",
+"S. c #263AA6",
+"T. c #243CA6",
+"U. c #253CA5",
+"V. c #273BA8",
+"W. c #2F4DA4",
+"X. c #2F4DA3",
+"Y. c #1B2F85",
+"Z. c #B5B5B6",
+"`. c #B5B5B5",
+" + c #B5B6B6",
+".+ c #B5B4B6",
+"++ c #C2C3C5",
+"@+ c #C0C3C3",
+"#+ c #C1C3C4",
+"$+ c #E3E3E3",
+"%+ c #E3E3E4",
+"&+ c #E4E3E4",
+"*+ c #E2E3E4",
+"=+ c #ECEEEB",
+"-+ c #EBEDEA",
+";+ c #EEF0ED",
+">+ c #EFF0EE",
". + @ @ # # $ % ",
"& & * & & & & & ",
"= = - = = ; > , ",
@@ -1263,1481 +1263,1481 @@ static char * listviewhighmiddle_xpm[] = {
static char * listviewhighcornerleft_xpm[] = {
"100 46 1475 2",
-" c None",
-". c #FBFBFC",
-"+ c #E8EAE7",
-"@ c #758DC3",
-"# c #42599E",
-"$ c #28418A",
-"% c #19418F",
-"& c #3F5695",
-"* c #415896",
-"= c #435A98",
-"- c #445C99",
-"; c #465E9B",
-"> c #48609B",
-", c #49629C",
-"' c #4A639D",
-") c #49639D",
-"! c #4A629D",
-"~ c #4B639D",
-"{ c #4B649D",
-"] c #4C659D",
-"^ c #4D669D",
-"/ c #4E689D",
-"( c #506A9D",
-"_ c #516A9D",
-": c #536B9C",
-"< c #546C9C",
-"[ c #566D9B",
-"} c #576D9B",
-"| c #586E9C",
-"1 c #5B6F9D",
-"2 c #61739D",
-"3 c #63749E",
-"4 c #64749E",
-"5 c #68769E",
-"6 c #6A779E",
-"7 c #6B789E",
-"8 c #66759E",
-"9 c #6C789D",
-"0 c #EEF0ED",
-"a c #D0D3DC",
-"b c #3E51A3",
-"c c #28428B",
-"d c #29428C",
-"e c #425996",
-"f c #455C99",
-"g c #485F9C",
-"h c #49619E",
-"i c #4A63A0",
-"j c #4B64A1",
-"k c #4B65A1",
-"l c #4C66A2",
-"m c #4D67A2",
-"n c #4F69A1",
-"o c #516AA1",
-"p c #536CA0",
-"q c #556DA1",
-"r c #576EA0",
-"s c #586F9F",
-"t c #586E9F",
-"u c #596F9E",
-"v c #5A6F9E",
-"w c #5C709E",
-"x c #5E719E",
-"y c #5F729F",
-"z c #62739F",
-"A c #63739E",
-"B c #64749D",
-"C c #65749E",
-"D c #69769D",
-"E c #6C799E",
-"F c #6D799F",
-"G c #707D9F",
-"H c #717F9E",
-"I c #6E7AA1",
-"J c #6C789E",
-"K c #6F7C9C",
-"L c #6F7D9B",
-"M c #2A4AA0",
-"N c #4971D0",
-"O c #4C72D8",
-"P c #5472C0",
-"Q c #5573BF",
-"R c #5774BF",
-"S c #5875BF",
-"T c #5976C1",
-"U c #5A76C1",
-"V c #5C78C2",
-"W c #5E7AC2",
-"X c #607CC3",
-"Y c #627EC3",
-"Z c #637FC4",
-"` c #6581C5",
-" . c #6682C6",
-".. c #6783C7",
-"+. c #6984C8",
-"@. c #6B85C9",
-"#. c #6D87CA",
-"$. c #6F89CB",
-"%. c #718CCD",
-"&. c #748ECF",
-"*. c #7690D0",
-"=. c #7992D2",
-"-. c #7A93D3",
-";. c #7C95D5",
-">. c #7F98D7",
-",. c #8099D8",
-"'. c #859CDB",
-"). c #8AA0DD",
-"!. c #8DA3DF",
-"~. c #8FA5E0",
-"{. c #90A5E0",
-"]. c #91A6E1",
-"^. c #91A5E1",
-"/. c #90A4E0",
-"(. c #8EA3DE",
-"_. c #92A6E2",
-":. c #8FA4DF",
-"<. c #90A5DE",
-"[. c #90A5DC",
-"}. c #90A6DB",
-"|. c #91A6E0",
-"1. c #93A7E2",
-"2. c #95AAE6",
-"3. c #99AEEA",
-"4. c #9AB2EA",
-"5. c #99B1E9",
-"6. c #99B1E7",
-"7. c #98AFE6",
-"8. c #93A8E2",
-"9. c #97ACE7",
-"0. c #9AB3EB",
-"a. c #9DB5ED",
-"b. c #9DB6EE",
-"c. c #375095",
-"d. c #4056AD",
-"e. c #506DCD",
-"f. c #4360CC",
-"g. c #345ED6",
-"h. c #335ECF",
-"i. c #355ED6",
-"j. c #355FD6",
-"k. c #365FD6",
-"l. c #355FD0",
-"m. c #3760D5",
-"n. c #3A63D4",
-"o. c #3C63D1",
-"p. c #3B63CD",
-"q. c #3B63C9",
-"r. c #3B62C9",
-"s. c #3D63C8",
-"t. c #4065C5",
-"u. c #4567C5",
-"v. c #496BC5",
-"w. c #4F70C7",
-"x. c #5273C8",
-"y. c #5475CA",
-"z. c #5777CB",
-"A. c #5879CD",
-"B. c #5A7BCE",
-"C. c #5D7DCF",
-"D. c #5F7ECF",
-"E. c #617FD0",
-"F. c #6381D1",
-"G. c #6583D2",
-"H. c #6785D2",
-"I. c #6886D3",
-"J. c #6A88D4",
-"K. c #6C89D5",
-"L. c #6E8BD6",
-"M. c #708CD7",
-"N. c #718DD8",
-"O. c #738EDA",
-"P. c #748FDB",
-"Q. c #7691DC",
-"R. c #7893DD",
-"S. c #7994DD",
-"T. c #7A96DE",
-"U. c #7B97DF",
-"V. c #7C98E0",
-"W. c #7E9AE2",
-"X. c #7F9BE3",
-"Y. c #829DE4",
-"Z. c #849FE5",
-"`. c #87A0E6",
-" + c #88A1E7",
-".+ c #89A2E6",
-"++ c #8CA3E7",
-"@+ c #8EA5E9",
-"#+ c #8EA6E9",
-"$+ c #8FA7E9",
-"%+ c #8FA8E8",
-"&+ c #8FA9E8",
-"*+ c #91A9E8",
-"=+ c #90A7E8",
-"-+ c #8FA8EA",
-";+ c #90AAEA",
-">+ c #93ABEA",
-",+ c #95ABEA",
-"'+ c #93ABE9",
-")+ c #94ABEA",
-"!+ c #90A9EA",
-"~+ c #93AAE9",
-"{+ c #273E7E",
-"]+ c #345ED5",
-"^+ c #3D60CE",
-"/+ c #3D60CF",
-"(+ c #345ECF",
-"_+ c #335ED0",
-":+ c #355FD3",
-"<+ c #3A60CE",
-"[+ c #3A5FCB",
-"}+ c #385FC9",
-"|+ c #3B60C8",
-"1+ c #3C63CB",
-"2+ c #3E64CB",
-"3+ c #4166CA",
-"4+ c #4568C9",
-"5+ c #4A6CC7",
-"6+ c #4F71C8",
-"7+ c #5172CA",
-"8+ c #5475CE",
-"9+ c #5678D3",
-"0+ c #597CD6",
-"a+ c #5C7ED7",
-"b+ c #5E7FD8",
-"c+ c #6181D9",
-"d+ c #6383DA",
-"e+ c #6585DA",
-"f+ c #6786DB",
-"g+ c #6988DC",
-"h+ c #6B8ADD",
-"i+ c #6D8BDE",
-"j+ c #6F8DDE",
-"k+ c #718EDF",
-"l+ c #728FE0",
-"m+ c #7390E1",
-"n+ c #7390E2",
-"o+ c #7491E3",
-"p+ c #7592E4",
-"q+ c #7693E4",
-"r+ c #7794E5",
-"s+ c #7894E5",
-"t+ c #7995E6",
-"u+ c #7B96E6",
-"v+ c #7C97E7",
-"w+ c #7D9AE8",
-"x+ c #7F9CE9",
-"y+ c #829DE9",
-"z+ c #849EE9",
-"A+ c #859EE9",
-"B+ c #87A0E7",
-"C+ c #8AA2E7",
-"D+ c #8BA3E8",
-"E+ c #89A2E7",
-"F+ c #8CA6EA",
-"G+ c #8BA6EA",
-"H+ c #8BA7EA",
-"I+ c #8CA3E8",
-"J+ c #8BA8EA",
-"K+ c #8CA7EA",
-"L+ c #8CA8EA",
-"M+ c #4659C7",
-"N+ c #355ECF",
-"O+ c #3660CF",
-"P+ c #3860CE",
-"Q+ c #3961CD",
-"R+ c #3B61CB",
-"S+ c #3B61CA",
-"T+ c #3D62CA",
-"U+ c #3D63CA",
-"V+ c #4165CB",
-"W+ c #456ACB",
-"X+ c #4B6FCD",
-"Y+ c #5174CE",
-"Z+ c #5275D1",
-"`+ c #5477D4",
-" @ c #5678D9",
-".@ c #587ADB",
-"+@ c #597BDB",
-"@@ c #5B7DDC",
-"#@ c #5E7FDC",
-"$@ c #6081DD",
-"%@ c #6283DE",
-"&@ c #6484DF",
-"*@ c #6787E0",
-"=@ c #6989E1",
-"-@ c #6B8BE1",
-";@ c #6D8DE2",
-">@ c #6F8EE3",
-",@ c #718FE4",
-"'@ c #7290E4",
-")@ c #7491E5",
-"!@ c #7692E6",
-"~@ c #7793E5",
-"{@ c #7894E6",
-"]@ c #7895E7",
-"^@ c #7996E8",
-"/@ c #7A97E8",
-"(@ c #7B98E9",
-"_@ c #7D99E8",
-":@ c #7F9AE8",
-"<@ c #7F9BE9",
-"[@ c #7F9CEA",
-"}@ c #859EE8",
-"|@ c #859FE8",
-"1@ c #85A0E9",
-"2@ c #869FE9",
-"3@ c #86A1E7",
-"4@ c #86A0E9",
-"5@ c #87A1E7",
-"6@ c #88A2E7",
-"7@ c #87A1E9",
-"8@ c #5A6FCA",
-"9@ c #365FCF",
-"0@ c #345ED0",
-"a@ c #385FCC",
-"b@ c #385FCE",
-"c@ c #3A61CC",
-"d@ c #3B62CD",
-"e@ c #3E64CD",
-"f@ c #4167CF",
-"g@ c #4469CF",
-"h@ c #486CD1",
-"i@ c #4D71D2",
-"j@ c #5175D4",
-"k@ c #5376D6",
-"l@ c #5578DA",
-"m@ c #5679DC",
-"n@ c #587BDD",
-"o@ c #5A7DDE",
-"p@ c #5D80DE",
-"q@ c #5F82DF",
-"r@ c #6284DF",
-"s@ c #6585E0",
-"t@ c #6787E1",
-"u@ c #6988E2",
-"v@ c #6B8AE2",
-"w@ c #6D8CE3",
-"x@ c #6E8DE3",
-"y@ c #708EE4",
-"z@ c #718FE3",
-"A@ c #7391E4",
-"B@ c #7592E5",
-"C@ c #7895E5",
-"D@ c #7996E6",
-"E@ c #7A97E6",
-"F@ c #7B98E7",
-"G@ c #7A98E8",
-"H@ c #7B99E9",
-"I@ c #7E9AE9",
-"J@ c #7D9AE9",
-"K@ c #7E9AEA",
-"L@ c #809CE9",
-"M@ c #819DE8",
-"N@ c #7F9BEA",
-"O@ c #819DE9",
-"P@ c #819CE9",
-"Q@ c #839EE9",
-"R@ c #839EE8",
-"S@ c #839DEA",
-"T@ c #859FE9",
-"U@ c #87A0E8",
-"V@ c #86A0E8",
-"W@ c #87A1E8",
-"X@ c #3760CF",
-"Y@ c #3A61CE",
-"Z@ c #3A62CD",
-"`@ c #3F66CE",
-" # c #4368D0",
-".# c #466CD2",
-"+# c #496DD5",
-"@# c #4E72D6",
-"## c #5175D8",
-"$# c #5276DA",
-"%# c #5578DC",
-"&# c #577ADC",
-"*# c #597CDD",
-"=# c #5B7DDD",
-"-# c #5D7FDE",
-";# c #5E81DE",
-"># c #6183DF",
-",# c #6386DF",
-"'# c #6687E0",
-")# c #6888E0",
-"!# c #6A89E1",
-"~# c #6C8AE1",
-"{# c #6E8CE2",
-"]# c #6F8DE2",
-"^# c #7390E4",
-"/# c #7390E3",
-"(# c #7491E4",
-"_# c #7693E5",
-":# c #7895E6",
-"<# c #7896E6",
-"[# c #7997E7",
-"}# c #7B97E7",
-"|# c #7B98E8",
-"1# c #7C98E8",
-"2# c #7E9BE9",
-"3# c #809CEA",
-"4# c #819CEA",
-"5# c #839DE9",
-"6# c #365FD0",
-"7# c #3660D0",
-"8# c #3961CF",
-"9# c #3B63CF",
-"0# c #3D64D0",
-"a# c #4067D0",
-"b# c #4469D2",
-"c# c #466BD3",
-"d# c #496ED5",
-"e# c #4C71D6",
-"f# c #4E72D8",
-"g# c #5074D9",
-"h# c #5376DB",
-"i# c #5578DB",
-"j# c #587ADC",
-"k# c #5B7CDC",
-"l# c #5D7EDD",
-"m# c #5F80DD",
-"n# c #6081DE",
-"o# c #6383DE",
-"p# c #6686DF",
-"q# c #6887E0",
-"r# c #6988E0",
-"s# c #6B89E1",
-"t# c #6C8AE0",
-"u# c #6E8CE1",
-"v# c #708EE2",
-"w# c #718FE2",
-"x# c #7290E3",
-"y# c #7391E2",
-"z# c #7492E1",
-"A# c #7592E2",
-"B# c #7691E3",
-"C# c #7591E3",
-"D# c #7692E3",
-"E# c #7693E3",
-"F# c #7793E4",
-"G# c #7893E4",
-"H# c #7994E5",
-"I# c #7D97E8",
-"J# c #7E98E8",
-"K# c #7D98E8",
-"L# c #7D99E9",
-"M# c #7D9BEA",
-"N# c #7D9CEA",
-"O# c #7E99E8",
-"P# c #7D9AEA",
-"Q# c #7C9BEA",
-"R# c #7C9CEA",
-"S# c #355FCF",
-"T# c #3860D0",
-"U# c #3A62D0",
-"V# c #3C64D1",
-"W# c #4167D1",
-"X# c #4369D3",
-"Y# c #466BD4",
-"Z# c #486DD5",
-"`# c #4A6ED7",
-" $ c #4C70D8",
-".$ c #5478D9",
-"+$ c #577BDA",
-"@$ c #597DDB",
-"#$ c #5B7EDB",
-"$$ c #5D7FDC",
-"%$ c #6182DE",
-"&$ c #6284DE",
-"*$ c #6485DF",
-"=$ c #6586DF",
-"-$ c #6787DF",
-";$ c #6888DF",
-">$ c #6A8ADF",
-",$ c #6C8BE0",
-"'$ c #6D8CE0",
-")$ c #6E8DE1",
-"!$ c #6F8DE1",
-"~$ c #708EE1",
-"{$ c #718FE0",
-"]$ c #728FE1",
-"^$ c #7390E0",
-"/$ c #738FE0",
-"($ c #7490E1",
-"_$ c #7590E1",
-":$ c #7591E1",
-"<$ c #7592E1",
-"[$ c #7692E2",
-"}$ c #7794E2",
-"|$ c #7894E3",
-"1$ c #7996E3",
-"2$ c #7A96E5",
-"3$ c #7B98E6",
-"4$ c #7B9AE8",
-"5$ c #7C99E8",
-"6$ c #7C96E5",
-"7$ c #7D97E7",
-"8$ c #7C99E9",
-"9$ c #7B9AE9",
-"0$ c #7B9AEA",
-"a$ c #5B6DCF",
-"b$ c #305EC8",
-"c$ c #335ECE",
-"d$ c #305ECA",
-"e$ c #345FCF",
-"f$ c #3761D0",
-"g$ c #3A62D1",
-"h$ c #3C64D2",
-"i$ c #4066D3",
-"j$ c #466BD5",
-"k$ c #486ED6",
-"l$ c #4A6ED6",
-"m$ c #4D71D8",
-"n$ c #4F72D9",
-"o$ c #5073D9",
-"p$ c #4F72D8",
-"q$ c #5074D8",
-"r$ c #5276D9",
-"s$ c #587ADA",
-"t$ c #5B7CDB",
-"u$ c #5D7EDC",
-"v$ c #5F7FDD",
-"w$ c #6081DC",
-"x$ c #6182DD",
-"y$ c #6283DD",
-"z$ c #6484DE",
-"A$ c #6585DD",
-"B$ c #6787DE",
-"C$ c #6988DF",
-"D$ c #6A89DE",
-"E$ c #6C8ADF",
-"F$ c #6D8BDF",
-"G$ c #6E8CE0",
-"H$ c #6F8DE0",
-"I$ c #718EE0",
-"J$ c #728FDF",
-"K$ c #728FDE",
-"L$ c #7290E0",
-"M$ c #7190E0",
-"N$ c #7291E0",
-"O$ c #7191E0",
-"P$ c #7392E1",
-"Q$ c #7493E1",
-"R$ c #7594E1",
-"S$ c #7594E2",
-"T$ c #7694E2",
-"U$ c #7695E2",
-"V$ c #7A96E4",
-"W$ c #7895E2",
-"X$ c #7A96E2",
-"Y$ c #7A96E3",
-"Z$ c #7B96E3",
-"`$ c #7996E1",
-" % c #7C96E4",
-".% c #305EC9",
-"+% c #315ECC",
-"@% c #325ECE",
-"#% c #3760D0",
-"$% c #3962D1",
-"%% c #3E66D3",
-"&% c #4268D4",
-"*% c #446BD5",
-"=% c #476CD6",
-"-% c #496ED7",
-";% c #4B6FD7",
-">% c #4C70D7",
-",% c #4E71D7",
-"'% c #5074D7",
-")% c #5276D8",
-"!% c #5376D8",
-"~% c #5779DA",
-"{% c #597ADA",
-"]% c #5A7BDB",
-"^% c #5B7CDA",
-"/% c #5D7EDB",
-"(% c #5E7FDB",
-"_% c #6182DB",
-":% c #6384DC",
-"<% c #6586DD",
-"[% c #6686DC",
-"}% c #6887DD",
-"|% c #6988DD",
-"1% c #6A8ADE",
-"2% c #6B8BDE",
-"3% c #6C8CDE",
-"4% c #6E8DDF",
-"5% c #6E8CDF",
-"6% c #6D8DDF",
-"7% c #6C8BDF",
-"8% c #6F8DDF",
-"9% c #718FDF",
-"0% c #7290DF",
-"a% c #7391E0",
-"b% c #7491E0",
-"c% c #7292E1",
-"d% c #3959C5",
-"e% c #345BC5",
-"f% c #315EC8",
-"g% c #355BC5",
-"h% c #325EC8",
-"i% c #315ECB",
-"j% c #345DCC",
-"k% c #335ECD",
-"l% c #345ECD",
-"m% c #355FCE",
-"n% c #3862D0",
-"o% c #3E66D2",
-"p% c #456BD5",
-"q% c #476CD5",
-"r% c #4B6ED7",
-"s% c #4B6FD6",
-"t% c #4B6FD5",
-"u% c #4D71D6",
-"v% c #5073D7",
-"w% c #5174D7",
-"x% c #5275D8",
-"y% c #5577D8",
-"z% c #5678D8",
-"A% c #5779D9",
-"B% c #587AD8",
-"C% c #597CD9",
-"D% c #5B7DD9",
-"E% c #5D7FDA",
-"F% c #5F80DB",
-"G% c #6182DC",
-"H% c #6484DC",
-"I% c #6585DC",
-"J% c #6787DD",
-"K% c #6988DE",
-"L% c #6B8ADE",
-"M% c #6B8ADF",
-"N% c #6989DE",
-"O% c #6B89DE",
-"P% c #6E8BDF",
-"Q% c #708CDE",
-"R% c #708DDF",
-"S% c #708FDF",
-"T% c #728EDF",
-"U% c #6F8EDD",
-"V% c #728EDD",
-"W% c #7390DF",
-"X% c #7490DF",
-"Y% c #335DC8",
-"Z% c #3759C5",
-"`% c #3859C5",
-" & c #335EC8",
-".& c #325DCA",
-"+& c #345CCB",
-"@& c #335DCC",
-"#& c #345DCD",
-"$& c #355FCD",
-"%& c #3861D0",
-"&& c #3B64D1",
-"*& c #3E65D2",
-"=& c #4168D3",
-"-& c #456AD5",
-";& c #4B6ED5",
-">& c #4C6FD4",
-",& c #4D70D5",
-"'& c #4F72D6",
-")& c #5173D6",
-"!& c #5375D7",
-"~& c #5476D8",
-"{& c #5577D7",
-"]& c #5477D8",
-"^& c #5677D8",
-"/& c #5879D9",
-"(& c #597AD9",
-"_& c #5C7DDA",
-":& c #6080DC",
-"<& c #6080DB",
-"[& c #6181DC",
-"}& c #6282DC",
-"|& c #6383DD",
-"1& c #6484DD",
-"2& c #6686DE",
-"3& c #6685DE",
-"4& c #6786DE",
-"5& c #6687DE",
-"6& c #6887DE",
-"7& c #6987DE",
-"8& c #6788DF",
-"9& c #6785DF",
-"0& c #6B89DF",
-"a& c #6C89DF",
-"b& c #6F8DDD",
-"c& c #6D8CDE",
-"d& c #445BBB",
-"e& c #3759BE",
-"f& c #375AC6",
-"g& c #355CC8",
-"h& c #345CCA",
-"i& c #355ECC",
-"j& c #365FCD",
-"k& c #3761CE",
-"l& c #3A63D0",
-"m& c #3D65D1",
-"n& c #466AD4",
-"o& c #476BD4",
-"p& c #486CD3",
-"q& c #4A6ED4",
-"r& c #4B6ED4",
-"s& c #4E71D6",
-"t& c #4F71D5",
-"u& c #5072D6",
-"v& c #5274D7",
-"w& c #5273D7",
-"x& c #5274D6",
-"y& c #5476D7",
-"z& c #5779D8",
-"A& c #587AD9",
-"B& c #5A7CDA",
-"C& c #5C7DDB",
-"D& c #5D7EDA",
-"E& c #6081DA",
-"F& c #6181DB",
-"G& c #6283DC",
-"H& c #6483DD",
-"I& c #6483DE",
-"J& c #6585DE",
-"K& c #6786DF",
-"L& c #6886DE",
-"M& c #6887DF",
-"N& c #6987DF",
-"O& c #6A88DF",
-"P& c #6786E0",
-"Q& c #6A86DE",
-"R& c #6B89E0",
-"S& c #365BC8",
-"T& c #365CC8",
-"U& c #375DCA",
-"V& c #375FCB",
-"W& c #3860CD",
-"X& c #3C63D0",
-"Y& c #4167D2",
-"Z& c #4268D2",
-"`& c #4368D2",
-" * c #4367D2",
-".* c #4568D2",
-"+* c #466AD2",
-"@* c #496CD3",
-"#* c #4A6DD3",
-"$* c #4A6DD4",
-"%* c #4D70D4",
-"&* c #4F72D5",
-"** c #4C70D4",
-"=* c #4E72D5",
-"-* c #5173D5",
-";* c #5375D6",
-">* c #597BDA",
-",* c #5B7DDA",
-"'* c #5C7EDB",
-")* c #5D7FDB",
-"!* c #5E80DB",
-"~* c #5E81DA",
-"{* c #5F81DB",
-"]* c #5F82DB",
-"^* c #6384DD",
-"/* c #6384DE",
-"(* c #6585DF",
-"_* c #6486E0",
-":* c #6583DD",
-"<* c #6386E0",
-"[* c #6686E0",
-"}* c #6B86DD",
-"|* c #6D86DD",
-"1* c #6086E0",
-"2* c #5573CD",
-"3* c #3959C3",
-"4* c #3959C4",
-"5* c #3759C0",
-"6* c #375BC7",
-"7* c #365CC7",
-"8* c #395FCC",
-"9* c #3B62CE",
-"0* c #3E64D0",
-"a* c #4066D1",
-"b* c #4166D1",
-"c* c #4064CF",
-"d* c #4065CF",
-"e* c #4266D0",
-"f* c #4468D1",
-"g* c #4569D1",
-"h* c #476BD2",
-"i* c #466AD1",
-"j* c #476AD2",
-"k* c #456AD1",
-"l* c #496DD2",
-"m* c #4A6FD3",
-"n* c #496ED2",
-"o* c #4B70D4",
-"p* c #4D71D4",
-"q* c #4E72D4",
-"r* c #5073D4",
-"s* c #5174D5",
-"t* c #5175D5",
-"u* c #5276D6",
-"v* c #5377D6",
-"w* c #5478D7",
-"x* c #5579D7",
-"y* c #567AD8",
-"z* c #577BD9",
-"A* c #597CD8",
-"B* c #5A7DD9",
-"C* c #5A7ED9",
-"D* c #5B7FDA",
-"E* c #5C80DA",
-"F* c #5D80DA",
-"G* c #5E81DB",
-"H* c #5D80DB",
-"I* c #6082DC",
-"J* c #6183DD",
-"K* c #6183DE",
-"L* c #6082DB",
-"M* c #6282DE",
-"N* c #6682DE",
-"O* c #6583DE",
-"P* c #3759BF",
-"Q* c #375AC2",
-"R* c #375AC1",
-"S* c #375AC4",
-"T* c #395DCA",
-"U* c #3A5ECA",
-"V* c #3C60CC",
-"W* c #3D61CD",
-"X* c #3D61CC",
-"Y* c #3C61CD",
-"Z* c #3E62CD",
-"`* c #3F64CE",
-" = c #4266CF",
-".= c #4468D0",
-"+= c #4267CF",
-"@= c #4166CE",
-"#= c #4065CE",
-"$= c #4166CD",
-"%= c #4267CE",
-"&= c #456AD0",
-"*= c #4368CE",
-"== c #4468CF",
-"-= c #4569D0",
-";= c #486BD1",
-">= c #4B6FD3",
-",= c #4C70D3",
-"'= c #4F73D4",
-")= c #5275D5",
-"!= c #5477D6",
-"~= c #577BD7",
-"{= c #587CD8",
-"]= c #577CD8",
-"^= c #597DD9",
-"/= c #5A7DDA",
-"(= c #597DDA",
-"_= c #587CDA",
-":= c #5A7EDA",
-"<= c #567BD8",
-"[= c #557AD9",
-"}= c #567BD9",
-"|= c #577CD9",
-"1= c #587DD9",
-"2= c #587ED9",
-"3= c #577ED8",
-"4= c #587DD8",
-"5= c #587ED8",
-"6= c #567ED7",
-"7= c #526ABD",
-"8= c #3759C1",
-"9= c #385BC7",
-"0= c #395CC8",
-"a= c #3B5DC9",
-"b= c #3B5ECA",
-"c= c #3A5FCA",
-"d= c #3B60CC",
-"e= c #3C61CC",
-"f= c #3D62CD",
-"g= c #3E63CD",
-"h= c #3C61CB",
-"i= c #3C61CA",
-"j= c #3D62CB",
-"k= c #3F64CC",
-"l= c #4065CD",
-"m= c #4669D0",
-"n= c #476AD0",
-"o= c #496BD1",
-"p= c #4A6DD2",
-"q= c #4B6ED2",
-"r= c #4D71D3",
-"s= c #4E73D4",
-"t= c #4F74D4",
-"u= c #5075D5",
-"v= c #5276D5",
-"w= c #5377D7",
-"x= c #5278D7",
-"y= c #5277D6",
-"z= c #5378D7",
-"A= c #5379D8",
-"B= c #5379D9",
-"C= c #5278D8",
-"D= c #5178D7",
-"E= c #3355C0",
-"F= c #3556C1",
-"G= c #395AC6",
-"H= c #385AC7",
-"I= c #395BC7",
-"J= c #395EC9",
-"K= c #395FCA",
-"L= c #3B60CA",
-"M= c #3B60CB",
-"N= c #375DC7",
-"O= c #385EC8",
-"P= c #395FC9",
-"Q= c #3A60CA",
-"R= c #3D63CC",
-"S= c #4367CF",
-"T= c #476BD1",
-"U= c #4A6ED2",
-"V= c #4B6FD2",
-"W= c #4C6FD2",
-"X= c #4D70D1",
-"Y= c #4E71D2",
-"Z= c #4E72D2",
-"`= c #4E74D4",
-" - c #4E75D5",
-".- c #4E75D4",
-"+- c #4F75D3",
-"@- c #5075D2",
-"#- c #5075D3",
-"$- c #5177D7",
-"%- c #5178D8",
-"&- c #4F75D5",
-"*- c #5076D5",
-"=- c #4F76D6",
-"-- c #5279D9",
-";- c #3C52B1",
-">- c #3656C3",
-",- c #3757C5",
-"'- c #3758C6",
-")- c #3759C6",
-"!- c #375BC6",
-"~- c #385CC7",
-"{- c #385DC8",
-"]- c #365CC6",
-"^- c #355BC6",
-"/- c #355CC6",
-"(- c #365DC7",
-"_- c #375EC8",
-":- c #375CC6",
-"<- c #385EC6",
-"[- c #3A5FC7",
-"}- c #3C60C8",
-"|- c #3D61C9",
-"1- c #3E62CA",
-"2- c #4063CC",
-"3- c #4165CE",
-"4- c #4268D0",
-"5- c #4269D1",
-"6- c #436AD2",
-"7- c #446AD2",
-"8- c #456BD2",
-"9- c #496CD1",
-"0- c #4C6CD0",
-"a- c #4D6CCF",
-"b- c #4E6DD0",
-"c- c #4F6ECF",
-"d- c #4E6FCF",
-"e- c #4C70CF",
-"f- c #4A71D0",
-"g- c #4F6FCF",
-"h- c #4B71D0",
-"i- c #4A72D1",
-"j- c #4B73D4",
-"k- c #4F70D0",
-"l- c #4C73D3",
-"m- c #4C73D6",
-"n- c #4B72D2",
-"o- c #4B71D1",
-"p- c #4C73D7",
-"q- c #3354C0",
-"r- c #3152BE",
-"s- c #3052BE",
-"t- c #3051BF",
-"u- c #2E4FBF",
-"v- c #2E4FBE",
-"w- c #2E50BF",
-"x- c #2F50BF",
-"y- c #3156C4",
-"z- c #2F56C5",
-"A- c #2E57C5",
-"B- c #2F57C5",
-"C- c #3057C6",
-"D- c #3258C6",
-"E- c #3459C7",
-"F- c #365AC7",
-"G- c #385BC8",
-"H- c #3B5DCA",
-"I- c #3B5DCB",
-"J- c #3C5ECC",
-"K- c #3C60CD",
-"L- c #3C62CE",
-"M- c #3D65D0",
-"N- c #3D66D1",
-"O- c #4166D2",
-"P- c #4667D2",
-"Q- c #4A67D1",
-"R- c #4C68D0",
-"S- c #4C69CF",
-"T- c #4D6BCE",
-"U- c #4E6DCD",
-"V- c #4E6ECE",
-"W- c #4E6DCE",
-"X- c #4970D0",
-"Y- c #4770D0",
-"Z- c #4B6BCE",
-"`- c #4A6CCE",
-" ; c #496DCF",
-".; c #476FD0",
-"+; c #4870D0",
-"@; c #486DCF",
-"#; c #242F79",
-"$; c #2F41AC",
-"%; c #2040B8",
-"&; c #2041B8",
-"*; c #2243B3",
-"=; c #2243B8",
-"-; c #2343B8",
-";; c #2444B8",
-">; c #2445B8",
-",; c #2445B6",
-"'; c #2445B7",
-"); c #2444B9",
-"!; c #2949BE",
-"~; c #2649BF",
-"{; c #234BBF",
-"]; c #224CBF",
-"^; c #224AC0",
-"/; c #244CC0",
-"(; c #254DC0",
-"_; c #254DC1",
-":; c #264DC2",
-"<; c #274EC3",
-"[; c #274CC3",
-"}; c #274DC4",
-"|; c #254DC5",
-"1; c #214EC5",
-"2; c #204FC6",
-"3; c #1F50C8",
-"4; c #2151C9",
-"5; c #2B53C8",
-"6; c #3154C7",
-"7; c #3255C6",
-"8; c #2F57C7",
-"9; c #2C58C9",
-"0; c #2D59CA",
-"a; c #2D58C9",
-"b; c #2E5BCC",
-"c; c #325ECC",
-"d; c #325ECB",
-"e; c #1F40B1",
-"f; c #1F40B2",
-"g; c #1F40B3",
-"h; c #2A44BD",
-"i; c #2845BE",
-"j; c #2745BE",
-"k; c #2646BF",
-"l; c #2546BE",
-"m; c #2347BF",
-"n; c #2147BF",
-"o; c #2048C0",
-"p; c #1D48C0",
-"q; c #1C48C0",
-"r; c #1B47C0",
-"s; c #1C48BF",
-"t; c #1E49BE",
-"u; c #214ABD",
-"v; c #244CBD",
-"w; c #264DBE",
-"x; c #254EC0",
-"y; c #214FC2",
-"z; c #1B51C5",
-"A; c #1C51C7",
-"B; c #2250C8",
-"C; c #2A52C8",
-"D; c #3254C6",
-"E; c #3355C5",
-"F; c #3154C8",
-"G; c #3355C6",
-"H; c #2F57C8",
-"I; c #2E58C9",
-"J; c #2E59C9",
-"K; c #3059C9",
-"L; c #2040B6",
-"M; c #2743BB",
-"N; c #2844BC",
-"O; c #2743BD",
-"P; c #2844BE",
-"Q; c #2844BD",
-"R; c #2346BE",
-"S; c #2047BF",
-"T; c #1E48C0",
-"U; c #1D47C0",
-"V; c #1D49BF",
-"W; c #1F49BF",
-"X; c #204ABE",
-"Y; c #254DBF",
-"Z; c #234EC0",
-"`; c #2050C1",
-" > c #1C51C3",
-".> c #1F51C6",
-"+> c #2651C8",
-"@> c #2D53C7",
-"#> c #3155C6",
-"$> c #3155C7",
-"%> c #3355C7",
-"&> c #3254C7",
-"*> c #1E40B1",
-"=> c #2141B8",
-"-> c #2442B9",
-";> c #2744BB",
-">> c #2945BB",
-",> c #2A45BB",
-"'> c #2944BA",
-")> c #2745BB",
-"!> c #2545BC",
-"~> c #2246BD",
-"{> c #2047BE",
-"]> c #1F47BD",
-"^> c #1D48BE",
-"/> c #1E49C0",
-"(> c #1F4AC0",
-"_> c #214BBF",
-":> c #244CBE",
-"<> c #254DBE",
-"[> c #244DBE",
-"}> c #224FBF",
-"|> c #2051C1",
-"1> c #2151C3",
-"2> c #2252C5",
-"3> c #2151C1",
-"4> c #2851C6",
-"5> c #2A50C6",
-"6> c #2E54C6",
-"7> c #1F51C2",
-"8> c #1D52C5",
-"9> c #2651C9",
-"0> c #2950C7",
-"a> c #2D40A5",
-"b> c #2040B0",
-"c> c #1F40B0",
-"d> c #223CAE",
-"e> c #233CAE",
-"f> c #253BAC",
-"g> c #253BAD",
-"h> c #233CB0",
-"i> c #213EB2",
-"j> c #1F3FB4",
-"k> c #1E40B6",
-"l> c #1F3FB7",
-"m> c #1E3EB8",
-"n> c #1F3FB8",
-"o> c #2040B7",
-"p> c #2141B6",
-"q> c #2140B7",
-"r> c #2241B6",
-"s> c #2342B5",
-"t> c #2442B6",
-"u> c #2543B5",
-"v> c #2643B4",
-"w> c #2544B6",
-"x> c #2346B8",
-"y> c #2247B9",
-"z> c #2048BC",
-"A> c #1F48BF",
-"B> c #2049C0",
-"C> c #214AC0",
-"D> c #224BBF",
-"E> c #234CBE",
-"F> c #244DBF",
-"G> c #234CBF",
-"H> c #264DC0",
-"I> c #274EBF",
-"J> c #264DBF",
-"K> c #254EBF",
-"L> c #2050C0",
-"M> c #1F51C1",
-"N> c #1E42A4",
-"O> c #263BA6",
-"P> c #253BA7",
-"Q> c #253CA7",
-"R> c #1E41A5",
-"S> c #1F40AF",
-"T> c #273AAC",
-"U> c #1E40B0",
-"V> c #1F40B5",
-"W> c #1F40B6",
-"X> c #1F40B8",
-"Y> c #1E40B8",
-"Z> c #1F3EB8",
-"`> c #203FB7",
-" , c #2240B6",
-"., c #2341B7",
-"+, c #2345B9",
-"@, c #2147BB",
-"#, c #2148BA",
-"$, c #2049BB",
-"%, c #2049BD",
-"&, c #2049BF",
-"*, c #224BBE",
-"=, c #244DBD",
-"-, c #244CBF",
-";, c #182969",
-">, c #273BAD",
-",, c #2739AB",
-"', c #263AAC",
-"), c #243CAE",
-"!, c #233DAE",
-"~, c #213EAF",
-"{, c #1F3FB0",
-"], c #2040B4",
-"^, c #1F3FB6",
-"/, c #1E3EB7",
-"(, c #2240B7",
-"_, c #2341B6",
-":, c #2543B4",
-"<, c #2644B3",
-"[, c #2544B5",
-"}, c #2545B5",
-"|, c #2547B6",
-"1, c #2548B7",
-"2, c #2349BA",
-"3, c #1F49BE",
-"4, c #2149BD",
-"5, c #2049BE",
-"6, c #214BBE",
-"7, c #2249BE",
-"8, c #234CBD",
-"9, c #2149BE",
-"0, c #1E49BF",
-"a, c #253BA9",
-"b, c #253BAB",
-"c, c #263AAB",
-"d, c #213DAF",
-"e, c #203EAF",
-"f, c #1D40AF",
-"g, c #1D40B0",
-"h, c #1E40B4",
-"i, c #2241B7",
-"j, c #2643B6",
-"k, c #2744B5",
-"l, c #2643B5",
-"m, c #2346B6",
-"n, c #2147B7",
-"o, c #2644B6",
-"p, c #2247B7",
-"q, c #2248B8",
-"r, c #2647B7",
-"s, c #2549B7",
-"t, c #2645B7",
-"u, c #2148B8",
-"v, c #2847B6",
-"w, c #2549B6",
-"x, c #2849B6",
-"y, c #2049B7",
-"z, c #2A49B5",
-"A, c #243BA4",
-"B, c #253BA5",
-"C, c #253BA6",
-"D, c #263AA7",
-"E, c #263AA8",
-"F, c #2739AA",
-"G, c #243CAD",
-"H, c #223DAE",
-"I, c #1F3EAF",
-"J, c #1E3FB0",
-"K, c #1D40B1",
-"L, c #1E3FB1",
-"M, c #1F3FB3",
-"N, c #1F3FB5",
-"O, c #2140B6",
-"P, c #2140B8",
-"Q, c #2744B4",
-"R, c #2746B6",
-"S, c #2947B6",
-"T, c #2946B5",
-"U, c #2A48B6",
-"V, c #3551A8",
-"W, c #1F399C",
-"X, c #143D9F",
-"Y, c #263BA5",
-"Z, c #273BA8",
-"`, c #273BAA",
-" ' c #263AAD",
-".' c #233CAD",
-"+' c #213DAE",
-"@' c #203FB2",
-"#' c #2342B6",
-"$' c #2443B6",
-"%' c #2543B6",
-"&' c #2644B5",
-"*' c #133D9E",
-"=' c #263BA7",
-"-' c #263BA9",
-";' c #273BA9",
-">' c #263AAA",
-",' c #2539AB",
-"'' c #2639AB",
-")' c #253AAC",
-"!' c #243BAD",
-"~' c #223DAF",
-"{' c #203FB0",
-"]' c #2040B1",
-"^' c #2140B3",
-"/' c #2543B1",
-"(' c #2744AF",
-"_' c #1A3CA0",
-":' c #1D3BA2",
-"<' c #233BA4",
-"[' c #263AA5",
-"}' c #253AA5",
-"|' c #263AA6",
-"1' c #263BA4",
-"2' c #243BA5",
-"3' c #263BA8",
-"4' c #223EAF",
-"5' c #3B4CA5",
-"6' c #1D379A",
-"7' c #1E389C",
-"8' c #1E399F",
-"9' c #1F3BA2",
-"0' c #1F3BA3",
-"a' c #213BA4",
-"b' c #233AA3",
-"c' c #243AA3",
-"d' c #2539A4",
-"e' c #253AA6",
-"f' c #243BA7",
-"g' c #253CAA",
-"h' c #253CAC",
-"i' c #253CAD",
-"j' c #253CAE",
-"k' c #243DAE",
-"l' c #213FAF",
-"m' c #223FAF",
-"n' c #2040AF",
-"o' c #253D93",
-"p' c #1D3894",
-"q' c #1F379A",
-"r' c #1E389B",
-"s' c #1D399C",
-"t' c #1C3A9D",
-"u' c #1B3A9D",
-"v' c #183B9E",
-"w' c #163C9E",
-"x' c #153C9E",
-"y' c #163B9D",
-"z' c #173B9D",
-"A' c #193A9D",
-"B' c #1C3A9E",
-"C' c #1F3AA1",
-"D' c #223AA4",
-"E' c #253BA8",
-"F' c #273BA7",
-"G' c #263CAB",
-"H' c #263CAC",
-"I' c #243EAE",
-"J' c #273BAC",
-"K' c #2A3795",
-"L' c #1F389B",
-"M' c #1D389B",
-"N' c #1C399C",
-"O' c #1B399C",
-"P' c #1A3A9D",
-"Q' c #1D399B",
-"R' c #1B399B",
-"S' c #1A3A9C",
-"T' c #1B3A9F",
-"U' c #1D3AA0",
-"V' c #203BA2",
-"W' c #203BA3",
-"X' c #2639A6",
-"Y' c #1B3692",
-"Z' c #1C3794",
-"`' c #1D3796",
-" ) c #1E3898",
-".) c #1E389A",
-"+) c #1F399B",
-"@) c #1A399C",
-"#) c #193A9E",
-"$) c #1A3BA0",
-"%) c #1C3BA2",
-"&) c #1D3CA3",
-"*) c #203CA4",
-"=) c #223BA5",
-"-) c #3C4699",
-";) c #2B4595",
-">) c #1C3793",
-",) c #1D3895",
-"') c #1E3897",
-")) c #1F3998",
-"!) c #1F3999",
-"~) c #1F399A",
-"{) c #1E399C",
-"]) c #1C3B9E",
-"^) c #1D3BA0",
-"/) c #1E3CA2",
-"() c #223CA5",
-"_) c #243CA6",
-":) c #596FA9",
-"<) c #3B4894",
-"[) c #314993",
-"}) c #29499F",
-"|) c #28489E",
-"1) c #2B4BA1",
-"2) c #2C4BA1",
-"3) c #2D4CA2",
-"4) c #2E4CA3",
-"5) c #2F4CA4",
-"6) c #2E4CA4",
-"7) c #2F4DA3",
-"8) c #2F4DA4",
-"9) c #D3D5D2",
-"0) c #3B4794",
-"a) c #314791",
-"b) c #304892",
-"c) c #304893",
-"d) c #2F4995",
-"e) c #2F4997",
-"f) c #2D4A9A",
-"g) c #2A4A9D",
-"h) c #294A9F",
-"i) c #284AA0",
-"j) c #294AA0",
-"k) c #2B4AA1",
-"l) c #2D4CA3",
-"m) c #C9CAC9",
-"n) c #455D9B",
-"o) c #242F78",
-"p) c #1B2F85",
-"q) c #C6C3C8",
-"r) c #B5B2B6",
-"s) c #B5B7B4",
-"t) c #B5B7B3",
-"u) c #B5B2B5",
-"v) c #B5B3B4",
-"w) c #B5B5B4",
-"x) c #B5B6B3",
-"y) c #B5B4B4",
-"z) c #B5B3B5",
-"A) c #B5B4B5",
-"B) c #B5B5B5",
-"C) c #B5B5B3",
-"D) c #B5B5B6",
-"E) c #BAC3BE",
-"F) c #B9C3BD",
-"G) c #C1C3C4",
-"H) c #BFC3C2",
-"I) c #B9C3BE",
-"J) c #BBC3BF",
-"K) c #BDC3C1",
-"L) c #C0C3C3",
-"M) c #BEC3C1",
-"N) c #C2C3C5",
-"O) c #E6E3E8",
-"P) c #E0E2DF",
-"Q) c #E1E1E1",
-"R) c #E2E1E3",
-"S) c #E4E1E6",
-"T) c #E4E2E7",
-"U) c #E4E2E6",
-"V) c #E3E3E4",
-"W) c #E2E3E3",
-"X) c #E1E3E2",
-"Y) c #E3E3E3",
-"Z) c #E3E3E2",
-"`) c #EBEDEA",
-" ! c #EAECE9",
-".! c #E9EBE8",
-"+! c #ECEEEB",
+" c None",
+". c #FBFBFC",
+"+ c #E8EAE7",
+"@ c #758DC3",
+"# c #42599E",
+"$ c #28418A",
+"% c #19418F",
+"& c #3F5695",
+"* c #415896",
+"= c #435A98",
+"- c #445C99",
+"; c #465E9B",
+"> c #48609B",
+", c #49629C",
+"' c #4A639D",
+") c #49639D",
+"! c #4A629D",
+"~ c #4B639D",
+"{ c #4B649D",
+"] c #4C659D",
+"^ c #4D669D",
+"/ c #4E689D",
+"( c #506A9D",
+"_ c #516A9D",
+": c #536B9C",
+"< c #546C9C",
+"[ c #566D9B",
+"} c #576D9B",
+"| c #586E9C",
+"1 c #5B6F9D",
+"2 c #61739D",
+"3 c #63749E",
+"4 c #64749E",
+"5 c #68769E",
+"6 c #6A779E",
+"7 c #6B789E",
+"8 c #66759E",
+"9 c #6C789D",
+"0 c #EEF0ED",
+"a c #D0D3DC",
+"b c #3E51A3",
+"c c #28428B",
+"d c #29428C",
+"e c #425996",
+"f c #455C99",
+"g c #485F9C",
+"h c #49619E",
+"i c #4A63A0",
+"j c #4B64A1",
+"k c #4B65A1",
+"l c #4C66A2",
+"m c #4D67A2",
+"n c #4F69A1",
+"o c #516AA1",
+"p c #536CA0",
+"q c #556DA1",
+"r c #576EA0",
+"s c #586F9F",
+"t c #586E9F",
+"u c #596F9E",
+"v c #5A6F9E",
+"w c #5C709E",
+"x c #5E719E",
+"y c #5F729F",
+"z c #62739F",
+"A c #63739E",
+"B c #64749D",
+"C c #65749E",
+"D c #69769D",
+"E c #6C799E",
+"F c #6D799F",
+"G c #707D9F",
+"H c #717F9E",
+"I c #6E7AA1",
+"J c #6C789E",
+"K c #6F7C9C",
+"L c #6F7D9B",
+"M c #2A4AA0",
+"N c #4971D0",
+"O c #4C72D8",
+"P c #5472C0",
+"Q c #5573BF",
+"R c #5774BF",
+"S c #5875BF",
+"T c #5976C1",
+"U c #5A76C1",
+"V c #5C78C2",
+"W c #5E7AC2",
+"X c #607CC3",
+"Y c #627EC3",
+"Z c #637FC4",
+"` c #6581C5",
+" . c #6682C6",
+".. c #6783C7",
+"+. c #6984C8",
+"@. c #6B85C9",
+"#. c #6D87CA",
+"$. c #6F89CB",
+"%. c #718CCD",
+"&. c #748ECF",
+"*. c #7690D0",
+"=. c #7992D2",
+"-. c #7A93D3",
+";. c #7C95D5",
+">. c #7F98D7",
+",. c #8099D8",
+"'. c #859CDB",
+"). c #8AA0DD",
+"!. c #8DA3DF",
+"~. c #8FA5E0",
+"{. c #90A5E0",
+"]. c #91A6E1",
+"^. c #91A5E1",
+"/. c #90A4E0",
+"(. c #8EA3DE",
+"_. c #92A6E2",
+":. c #8FA4DF",
+"<. c #90A5DE",
+"[. c #90A5DC",
+"}. c #90A6DB",
+"|. c #91A6E0",
+"1. c #93A7E2",
+"2. c #95AAE6",
+"3. c #99AEEA",
+"4. c #9AB2EA",
+"5. c #99B1E9",
+"6. c #99B1E7",
+"7. c #98AFE6",
+"8. c #93A8E2",
+"9. c #97ACE7",
+"0. c #9AB3EB",
+"a. c #9DB5ED",
+"b. c #9DB6EE",
+"c. c #375095",
+"d. c #4056AD",
+"e. c #506DCD",
+"f. c #4360CC",
+"g. c #345ED6",
+"h. c #335ECF",
+"i. c #355ED6",
+"j. c #355FD6",
+"k. c #365FD6",
+"l. c #355FD0",
+"m. c #3760D5",
+"n. c #3A63D4",
+"o. c #3C63D1",
+"p. c #3B63CD",
+"q. c #3B63C9",
+"r. c #3B62C9",
+"s. c #3D63C8",
+"t. c #4065C5",
+"u. c #4567C5",
+"v. c #496BC5",
+"w. c #4F70C7",
+"x. c #5273C8",
+"y. c #5475CA",
+"z. c #5777CB",
+"A. c #5879CD",
+"B. c #5A7BCE",
+"C. c #5D7DCF",
+"D. c #5F7ECF",
+"E. c #617FD0",
+"F. c #6381D1",
+"G. c #6583D2",
+"H. c #6785D2",
+"I. c #6886D3",
+"J. c #6A88D4",
+"K. c #6C89D5",
+"L. c #6E8BD6",
+"M. c #708CD7",
+"N. c #718DD8",
+"O. c #738EDA",
+"P. c #748FDB",
+"Q. c #7691DC",
+"R. c #7893DD",
+"S. c #7994DD",
+"T. c #7A96DE",
+"U. c #7B97DF",
+"V. c #7C98E0",
+"W. c #7E9AE2",
+"X. c #7F9BE3",
+"Y. c #829DE4",
+"Z. c #849FE5",
+"`. c #87A0E6",
+" + c #88A1E7",
+".+ c #89A2E6",
+"++ c #8CA3E7",
+"@+ c #8EA5E9",
+"#+ c #8EA6E9",
+"$+ c #8FA7E9",
+"%+ c #8FA8E8",
+"&+ c #8FA9E8",
+"*+ c #91A9E8",
+"=+ c #90A7E8",
+"-+ c #8FA8EA",
+";+ c #90AAEA",
+">+ c #93ABEA",
+",+ c #95ABEA",
+"'+ c #93ABE9",
+")+ c #94ABEA",
+"!+ c #90A9EA",
+"~+ c #93AAE9",
+"{+ c #273E7E",
+"]+ c #345ED5",
+"^+ c #3D60CE",
+"/+ c #3D60CF",
+"(+ c #345ECF",
+"_+ c #335ED0",
+":+ c #355FD3",
+"<+ c #3A60CE",
+"[+ c #3A5FCB",
+"}+ c #385FC9",
+"|+ c #3B60C8",
+"1+ c #3C63CB",
+"2+ c #3E64CB",
+"3+ c #4166CA",
+"4+ c #4568C9",
+"5+ c #4A6CC7",
+"6+ c #4F71C8",
+"7+ c #5172CA",
+"8+ c #5475CE",
+"9+ c #5678D3",
+"0+ c #597CD6",
+"a+ c #5C7ED7",
+"b+ c #5E7FD8",
+"c+ c #6181D9",
+"d+ c #6383DA",
+"e+ c #6585DA",
+"f+ c #6786DB",
+"g+ c #6988DC",
+"h+ c #6B8ADD",
+"i+ c #6D8BDE",
+"j+ c #6F8DDE",
+"k+ c #718EDF",
+"l+ c #728FE0",
+"m+ c #7390E1",
+"n+ c #7390E2",
+"o+ c #7491E3",
+"p+ c #7592E4",
+"q+ c #7693E4",
+"r+ c #7794E5",
+"s+ c #7894E5",
+"t+ c #7995E6",
+"u+ c #7B96E6",
+"v+ c #7C97E7",
+"w+ c #7D9AE8",
+"x+ c #7F9CE9",
+"y+ c #829DE9",
+"z+ c #849EE9",
+"A+ c #859EE9",
+"B+ c #87A0E7",
+"C+ c #8AA2E7",
+"D+ c #8BA3E8",
+"E+ c #89A2E7",
+"F+ c #8CA6EA",
+"G+ c #8BA6EA",
+"H+ c #8BA7EA",
+"I+ c #8CA3E8",
+"J+ c #8BA8EA",
+"K+ c #8CA7EA",
+"L+ c #8CA8EA",
+"M+ c #4659C7",
+"N+ c #355ECF",
+"O+ c #3660CF",
+"P+ c #3860CE",
+"Q+ c #3961CD",
+"R+ c #3B61CB",
+"S+ c #3B61CA",
+"T+ c #3D62CA",
+"U+ c #3D63CA",
+"V+ c #4165CB",
+"W+ c #456ACB",
+"X+ c #4B6FCD",
+"Y+ c #5174CE",
+"Z+ c #5275D1",
+"`+ c #5477D4",
+" @ c #5678D9",
+".@ c #587ADB",
+"+@ c #597BDB",
+"@@ c #5B7DDC",
+"#@ c #5E7FDC",
+"$@ c #6081DD",
+"%@ c #6283DE",
+"&@ c #6484DF",
+"*@ c #6787E0",
+"=@ c #6989E1",
+"-@ c #6B8BE1",
+";@ c #6D8DE2",
+">@ c #6F8EE3",
+",@ c #718FE4",
+"'@ c #7290E4",
+")@ c #7491E5",
+"!@ c #7692E6",
+"~@ c #7793E5",
+"{@ c #7894E6",
+"]@ c #7895E7",
+"^@ c #7996E8",
+"/@ c #7A97E8",
+"(@ c #7B98E9",
+"_@ c #7D99E8",
+":@ c #7F9AE8",
+"<@ c #7F9BE9",
+"[@ c #7F9CEA",
+"}@ c #859EE8",
+"|@ c #859FE8",
+"1@ c #85A0E9",
+"2@ c #869FE9",
+"3@ c #86A1E7",
+"4@ c #86A0E9",
+"5@ c #87A1E7",
+"6@ c #88A2E7",
+"7@ c #87A1E9",
+"8@ c #5A6FCA",
+"9@ c #365FCF",
+"0@ c #345ED0",
+"a@ c #385FCC",
+"b@ c #385FCE",
+"c@ c #3A61CC",
+"d@ c #3B62CD",
+"e@ c #3E64CD",
+"f@ c #4167CF",
+"g@ c #4469CF",
+"h@ c #486CD1",
+"i@ c #4D71D2",
+"j@ c #5175D4",
+"k@ c #5376D6",
+"l@ c #5578DA",
+"m@ c #5679DC",
+"n@ c #587BDD",
+"o@ c #5A7DDE",
+"p@ c #5D80DE",
+"q@ c #5F82DF",
+"r@ c #6284DF",
+"s@ c #6585E0",
+"t@ c #6787E1",
+"u@ c #6988E2",
+"v@ c #6B8AE2",
+"w@ c #6D8CE3",
+"x@ c #6E8DE3",
+"y@ c #708EE4",
+"z@ c #718FE3",
+"A@ c #7391E4",
+"B@ c #7592E5",
+"C@ c #7895E5",
+"D@ c #7996E6",
+"E@ c #7A97E6",
+"F@ c #7B98E7",
+"G@ c #7A98E8",
+"H@ c #7B99E9",
+"I@ c #7E9AE9",
+"J@ c #7D9AE9",
+"K@ c #7E9AEA",
+"L@ c #809CE9",
+"M@ c #819DE8",
+"N@ c #7F9BEA",
+"O@ c #819DE9",
+"P@ c #819CE9",
+"Q@ c #839EE9",
+"R@ c #839EE8",
+"S@ c #839DEA",
+"T@ c #859FE9",
+"U@ c #87A0E8",
+"V@ c #86A0E8",
+"W@ c #87A1E8",
+"X@ c #3760CF",
+"Y@ c #3A61CE",
+"Z@ c #3A62CD",
+"`@ c #3F66CE",
+" # c #4368D0",
+".# c #466CD2",
+"+# c #496DD5",
+"@# c #4E72D6",
+"## c #5175D8",
+"$# c #5276DA",
+"%# c #5578DC",
+"&# c #577ADC",
+"*# c #597CDD",
+"=# c #5B7DDD",
+"-# c #5D7FDE",
+";# c #5E81DE",
+"># c #6183DF",
+",# c #6386DF",
+"'# c #6687E0",
+")# c #6888E0",
+"!# c #6A89E1",
+"~# c #6C8AE1",
+"{# c #6E8CE2",
+"]# c #6F8DE2",
+"^# c #7390E4",
+"/# c #7390E3",
+"(# c #7491E4",
+"_# c #7693E5",
+":# c #7895E6",
+"<# c #7896E6",
+"[# c #7997E7",
+"}# c #7B97E7",
+"|# c #7B98E8",
+"1# c #7C98E8",
+"2# c #7E9BE9",
+"3# c #809CEA",
+"4# c #819CEA",
+"5# c #839DE9",
+"6# c #365FD0",
+"7# c #3660D0",
+"8# c #3961CF",
+"9# c #3B63CF",
+"0# c #3D64D0",
+"a# c #4067D0",
+"b# c #4469D2",
+"c# c #466BD3",
+"d# c #496ED5",
+"e# c #4C71D6",
+"f# c #4E72D8",
+"g# c #5074D9",
+"h# c #5376DB",
+"i# c #5578DB",
+"j# c #587ADC",
+"k# c #5B7CDC",
+"l# c #5D7EDD",
+"m# c #5F80DD",
+"n# c #6081DE",
+"o# c #6383DE",
+"p# c #6686DF",
+"q# c #6887E0",
+"r# c #6988E0",
+"s# c #6B89E1",
+"t# c #6C8AE0",
+"u# c #6E8CE1",
+"v# c #708EE2",
+"w# c #718FE2",
+"x# c #7290E3",
+"y# c #7391E2",
+"z# c #7492E1",
+"A# c #7592E2",
+"B# c #7691E3",
+"C# c #7591E3",
+"D# c #7692E3",
+"E# c #7693E3",
+"F# c #7793E4",
+"G# c #7893E4",
+"H# c #7994E5",
+"I# c #7D97E8",
+"J# c #7E98E8",
+"K# c #7D98E8",
+"L# c #7D99E9",
+"M# c #7D9BEA",
+"N# c #7D9CEA",
+"O# c #7E99E8",
+"P# c #7D9AEA",
+"Q# c #7C9BEA",
+"R# c #7C9CEA",
+"S# c #355FCF",
+"T# c #3860D0",
+"U# c #3A62D0",
+"V# c #3C64D1",
+"W# c #4167D1",
+"X# c #4369D3",
+"Y# c #466BD4",
+"Z# c #486DD5",
+"`# c #4A6ED7",
+" $ c #4C70D8",
+".$ c #5478D9",
+"+$ c #577BDA",
+"@$ c #597DDB",
+"#$ c #5B7EDB",
+"$$ c #5D7FDC",
+"%$ c #6182DE",
+"&$ c #6284DE",
+"*$ c #6485DF",
+"=$ c #6586DF",
+"-$ c #6787DF",
+";$ c #6888DF",
+">$ c #6A8ADF",
+",$ c #6C8BE0",
+"'$ c #6D8CE0",
+")$ c #6E8DE1",
+"!$ c #6F8DE1",
+"~$ c #708EE1",
+"{$ c #718FE0",
+"]$ c #728FE1",
+"^$ c #7390E0",
+"/$ c #738FE0",
+"($ c #7490E1",
+"_$ c #7590E1",
+":$ c #7591E1",
+"<$ c #7592E1",
+"[$ c #7692E2",
+"}$ c #7794E2",
+"|$ c #7894E3",
+"1$ c #7996E3",
+"2$ c #7A96E5",
+"3$ c #7B98E6",
+"4$ c #7B9AE8",
+"5$ c #7C99E8",
+"6$ c #7C96E5",
+"7$ c #7D97E7",
+"8$ c #7C99E9",
+"9$ c #7B9AE9",
+"0$ c #7B9AEA",
+"a$ c #5B6DCF",
+"b$ c #305EC8",
+"c$ c #335ECE",
+"d$ c #305ECA",
+"e$ c #345FCF",
+"f$ c #3761D0",
+"g$ c #3A62D1",
+"h$ c #3C64D2",
+"i$ c #4066D3",
+"j$ c #466BD5",
+"k$ c #486ED6",
+"l$ c #4A6ED6",
+"m$ c #4D71D8",
+"n$ c #4F72D9",
+"o$ c #5073D9",
+"p$ c #4F72D8",
+"q$ c #5074D8",
+"r$ c #5276D9",
+"s$ c #587ADA",
+"t$ c #5B7CDB",
+"u$ c #5D7EDC",
+"v$ c #5F7FDD",
+"w$ c #6081DC",
+"x$ c #6182DD",
+"y$ c #6283DD",
+"z$ c #6484DE",
+"A$ c #6585DD",
+"B$ c #6787DE",
+"C$ c #6988DF",
+"D$ c #6A89DE",
+"E$ c #6C8ADF",
+"F$ c #6D8BDF",
+"G$ c #6E8CE0",
+"H$ c #6F8DE0",
+"I$ c #718EE0",
+"J$ c #728FDF",
+"K$ c #728FDE",
+"L$ c #7290E0",
+"M$ c #7190E0",
+"N$ c #7291E0",
+"O$ c #7191E0",
+"P$ c #7392E1",
+"Q$ c #7493E1",
+"R$ c #7594E1",
+"S$ c #7594E2",
+"T$ c #7694E2",
+"U$ c #7695E2",
+"V$ c #7A96E4",
+"W$ c #7895E2",
+"X$ c #7A96E2",
+"Y$ c #7A96E3",
+"Z$ c #7B96E3",
+"`$ c #7996E1",
+" % c #7C96E4",
+".% c #305EC9",
+"+% c #315ECC",
+"@% c #325ECE",
+"#% c #3760D0",
+"$% c #3962D1",
+"%% c #3E66D3",
+"&% c #4268D4",
+"*% c #446BD5",
+"=% c #476CD6",
+"-% c #496ED7",
+";% c #4B6FD7",
+">% c #4C70D7",
+",% c #4E71D7",
+"'% c #5074D7",
+")% c #5276D8",
+"!% c #5376D8",
+"~% c #5779DA",
+"{% c #597ADA",
+"]% c #5A7BDB",
+"^% c #5B7CDA",
+"/% c #5D7EDB",
+"(% c #5E7FDB",
+"_% c #6182DB",
+":% c #6384DC",
+"<% c #6586DD",
+"[% c #6686DC",
+"}% c #6887DD",
+"|% c #6988DD",
+"1% c #6A8ADE",
+"2% c #6B8BDE",
+"3% c #6C8CDE",
+"4% c #6E8DDF",
+"5% c #6E8CDF",
+"6% c #6D8DDF",
+"7% c #6C8BDF",
+"8% c #6F8DDF",
+"9% c #718FDF",
+"0% c #7290DF",
+"a% c #7391E0",
+"b% c #7491E0",
+"c% c #7292E1",
+"d% c #3959C5",
+"e% c #345BC5",
+"f% c #315EC8",
+"g% c #355BC5",
+"h% c #325EC8",
+"i% c #315ECB",
+"j% c #345DCC",
+"k% c #335ECD",
+"l% c #345ECD",
+"m% c #355FCE",
+"n% c #3862D0",
+"o% c #3E66D2",
+"p% c #456BD5",
+"q% c #476CD5",
+"r% c #4B6ED7",
+"s% c #4B6FD6",
+"t% c #4B6FD5",
+"u% c #4D71D6",
+"v% c #5073D7",
+"w% c #5174D7",
+"x% c #5275D8",
+"y% c #5577D8",
+"z% c #5678D8",
+"A% c #5779D9",
+"B% c #587AD8",
+"C% c #597CD9",
+"D% c #5B7DD9",
+"E% c #5D7FDA",
+"F% c #5F80DB",
+"G% c #6182DC",
+"H% c #6484DC",
+"I% c #6585DC",
+"J% c #6787DD",
+"K% c #6988DE",
+"L% c #6B8ADE",
+"M% c #6B8ADF",
+"N% c #6989DE",
+"O% c #6B89DE",
+"P% c #6E8BDF",
+"Q% c #708CDE",
+"R% c #708DDF",
+"S% c #708FDF",
+"T% c #728EDF",
+"U% c #6F8EDD",
+"V% c #728EDD",
+"W% c #7390DF",
+"X% c #7490DF",
+"Y% c #335DC8",
+"Z% c #3759C5",
+"`% c #3859C5",
+" & c #335EC8",
+".& c #325DCA",
+"+& c #345CCB",
+"@& c #335DCC",
+"#& c #345DCD",
+"$& c #355FCD",
+"%& c #3861D0",
+"&& c #3B64D1",
+"*& c #3E65D2",
+"=& c #4168D3",
+"-& c #456AD5",
+";& c #4B6ED5",
+">& c #4C6FD4",
+",& c #4D70D5",
+"'& c #4F72D6",
+")& c #5173D6",
+"!& c #5375D7",
+"~& c #5476D8",
+"{& c #5577D7",
+"]& c #5477D8",
+"^& c #5677D8",
+"/& c #5879D9",
+"(& c #597AD9",
+"_& c #5C7DDA",
+":& c #6080DC",
+"<& c #6080DB",
+"[& c #6181DC",
+"}& c #6282DC",
+"|& c #6383DD",
+"1& c #6484DD",
+"2& c #6686DE",
+"3& c #6685DE",
+"4& c #6786DE",
+"5& c #6687DE",
+"6& c #6887DE",
+"7& c #6987DE",
+"8& c #6788DF",
+"9& c #6785DF",
+"0& c #6B89DF",
+"a& c #6C89DF",
+"b& c #6F8DDD",
+"c& c #6D8CDE",
+"d& c #445BBB",
+"e& c #3759BE",
+"f& c #375AC6",
+"g& c #355CC8",
+"h& c #345CCA",
+"i& c #355ECC",
+"j& c #365FCD",
+"k& c #3761CE",
+"l& c #3A63D0",
+"m& c #3D65D1",
+"n& c #466AD4",
+"o& c #476BD4",
+"p& c #486CD3",
+"q& c #4A6ED4",
+"r& c #4B6ED4",
+"s& c #4E71D6",
+"t& c #4F71D5",
+"u& c #5072D6",
+"v& c #5274D7",
+"w& c #5273D7",
+"x& c #5274D6",
+"y& c #5476D7",
+"z& c #5779D8",
+"A& c #587AD9",
+"B& c #5A7CDA",
+"C& c #5C7DDB",
+"D& c #5D7EDA",
+"E& c #6081DA",
+"F& c #6181DB",
+"G& c #6283DC",
+"H& c #6483DD",
+"I& c #6483DE",
+"J& c #6585DE",
+"K& c #6786DF",
+"L& c #6886DE",
+"M& c #6887DF",
+"N& c #6987DF",
+"O& c #6A88DF",
+"P& c #6786E0",
+"Q& c #6A86DE",
+"R& c #6B89E0",
+"S& c #365BC8",
+"T& c #365CC8",
+"U& c #375DCA",
+"V& c #375FCB",
+"W& c #3860CD",
+"X& c #3C63D0",
+"Y& c #4167D2",
+"Z& c #4268D2",
+"`& c #4368D2",
+" * c #4367D2",
+".* c #4568D2",
+"+* c #466AD2",
+"@* c #496CD3",
+"#* c #4A6DD3",
+"$* c #4A6DD4",
+"%* c #4D70D4",
+"&* c #4F72D5",
+"** c #4C70D4",
+"=* c #4E72D5",
+"-* c #5173D5",
+";* c #5375D6",
+">* c #597BDA",
+",* c #5B7DDA",
+"'* c #5C7EDB",
+")* c #5D7FDB",
+"!* c #5E80DB",
+"~* c #5E81DA",
+"{* c #5F81DB",
+"]* c #5F82DB",
+"^* c #6384DD",
+"/* c #6384DE",
+"(* c #6585DF",
+"_* c #6486E0",
+":* c #6583DD",
+"<* c #6386E0",
+"[* c #6686E0",
+"}* c #6B86DD",
+"|* c #6D86DD",
+"1* c #6086E0",
+"2* c #5573CD",
+"3* c #3959C3",
+"4* c #3959C4",
+"5* c #3759C0",
+"6* c #375BC7",
+"7* c #365CC7",
+"8* c #395FCC",
+"9* c #3B62CE",
+"0* c #3E64D0",
+"a* c #4066D1",
+"b* c #4166D1",
+"c* c #4064CF",
+"d* c #4065CF",
+"e* c #4266D0",
+"f* c #4468D1",
+"g* c #4569D1",
+"h* c #476BD2",
+"i* c #466AD1",
+"j* c #476AD2",
+"k* c #456AD1",
+"l* c #496DD2",
+"m* c #4A6FD3",
+"n* c #496ED2",
+"o* c #4B70D4",
+"p* c #4D71D4",
+"q* c #4E72D4",
+"r* c #5073D4",
+"s* c #5174D5",
+"t* c #5175D5",
+"u* c #5276D6",
+"v* c #5377D6",
+"w* c #5478D7",
+"x* c #5579D7",
+"y* c #567AD8",
+"z* c #577BD9",
+"A* c #597CD8",
+"B* c #5A7DD9",
+"C* c #5A7ED9",
+"D* c #5B7FDA",
+"E* c #5C80DA",
+"F* c #5D80DA",
+"G* c #5E81DB",
+"H* c #5D80DB",
+"I* c #6082DC",
+"J* c #6183DD",
+"K* c #6183DE",
+"L* c #6082DB",
+"M* c #6282DE",
+"N* c #6682DE",
+"O* c #6583DE",
+"P* c #3759BF",
+"Q* c #375AC2",
+"R* c #375AC1",
+"S* c #375AC4",
+"T* c #395DCA",
+"U* c #3A5ECA",
+"V* c #3C60CC",
+"W* c #3D61CD",
+"X* c #3D61CC",
+"Y* c #3C61CD",
+"Z* c #3E62CD",
+"`* c #3F64CE",
+" = c #4266CF",
+".= c #4468D0",
+"+= c #4267CF",
+"@= c #4166CE",
+"#= c #4065CE",
+"$= c #4166CD",
+"%= c #4267CE",
+"&= c #456AD0",
+"*= c #4368CE",
+"== c #4468CF",
+"-= c #4569D0",
+";= c #486BD1",
+">= c #4B6FD3",
+",= c #4C70D3",
+"'= c #4F73D4",
+")= c #5275D5",
+"!= c #5477D6",
+"~= c #577BD7",
+"{= c #587CD8",
+"]= c #577CD8",
+"^= c #597DD9",
+"/= c #5A7DDA",
+"(= c #597DDA",
+"_= c #587CDA",
+":= c #5A7EDA",
+"<= c #567BD8",
+"[= c #557AD9",
+"}= c #567BD9",
+"|= c #577CD9",
+"1= c #587DD9",
+"2= c #587ED9",
+"3= c #577ED8",
+"4= c #587DD8",
+"5= c #587ED8",
+"6= c #567ED7",
+"7= c #526ABD",
+"8= c #3759C1",
+"9= c #385BC7",
+"0= c #395CC8",
+"a= c #3B5DC9",
+"b= c #3B5ECA",
+"c= c #3A5FCA",
+"d= c #3B60CC",
+"e= c #3C61CC",
+"f= c #3D62CD",
+"g= c #3E63CD",
+"h= c #3C61CB",
+"i= c #3C61CA",
+"j= c #3D62CB",
+"k= c #3F64CC",
+"l= c #4065CD",
+"m= c #4669D0",
+"n= c #476AD0",
+"o= c #496BD1",
+"p= c #4A6DD2",
+"q= c #4B6ED2",
+"r= c #4D71D3",
+"s= c #4E73D4",
+"t= c #4F74D4",
+"u= c #5075D5",
+"v= c #5276D5",
+"w= c #5377D7",
+"x= c #5278D7",
+"y= c #5277D6",
+"z= c #5378D7",
+"A= c #5379D8",
+"B= c #5379D9",
+"C= c #5278D8",
+"D= c #5178D7",
+"E= c #3355C0",
+"F= c #3556C1",
+"G= c #395AC6",
+"H= c #385AC7",
+"I= c #395BC7",
+"J= c #395EC9",
+"K= c #395FCA",
+"L= c #3B60CA",
+"M= c #3B60CB",
+"N= c #375DC7",
+"O= c #385EC8",
+"P= c #395FC9",
+"Q= c #3A60CA",
+"R= c #3D63CC",
+"S= c #4367CF",
+"T= c #476BD1",
+"U= c #4A6ED2",
+"V= c #4B6FD2",
+"W= c #4C6FD2",
+"X= c #4D70D1",
+"Y= c #4E71D2",
+"Z= c #4E72D2",
+"`= c #4E74D4",
+" - c #4E75D5",
+".- c #4E75D4",
+"+- c #4F75D3",
+"@- c #5075D2",
+"#- c #5075D3",
+"$- c #5177D7",
+"%- c #5178D8",
+"&- c #4F75D5",
+"*- c #5076D5",
+"=- c #4F76D6",
+"-- c #5279D9",
+";- c #3C52B1",
+">- c #3656C3",
+",- c #3757C5",
+"'- c #3758C6",
+")- c #3759C6",
+"!- c #375BC6",
+"~- c #385CC7",
+"{- c #385DC8",
+"]- c #365CC6",
+"^- c #355BC6",
+"/- c #355CC6",
+"(- c #365DC7",
+"_- c #375EC8",
+":- c #375CC6",
+"<- c #385EC6",
+"[- c #3A5FC7",
+"}- c #3C60C8",
+"|- c #3D61C9",
+"1- c #3E62CA",
+"2- c #4063CC",
+"3- c #4165CE",
+"4- c #4268D0",
+"5- c #4269D1",
+"6- c #436AD2",
+"7- c #446AD2",
+"8- c #456BD2",
+"9- c #496CD1",
+"0- c #4C6CD0",
+"a- c #4D6CCF",
+"b- c #4E6DD0",
+"c- c #4F6ECF",
+"d- c #4E6FCF",
+"e- c #4C70CF",
+"f- c #4A71D0",
+"g- c #4F6FCF",
+"h- c #4B71D0",
+"i- c #4A72D1",
+"j- c #4B73D4",
+"k- c #4F70D0",
+"l- c #4C73D3",
+"m- c #4C73D6",
+"n- c #4B72D2",
+"o- c #4B71D1",
+"p- c #4C73D7",
+"q- c #3354C0",
+"r- c #3152BE",
+"s- c #3052BE",
+"t- c #3051BF",
+"u- c #2E4FBF",
+"v- c #2E4FBE",
+"w- c #2E50BF",
+"x- c #2F50BF",
+"y- c #3156C4",
+"z- c #2F56C5",
+"A- c #2E57C5",
+"B- c #2F57C5",
+"C- c #3057C6",
+"D- c #3258C6",
+"E- c #3459C7",
+"F- c #365AC7",
+"G- c #385BC8",
+"H- c #3B5DCA",
+"I- c #3B5DCB",
+"J- c #3C5ECC",
+"K- c #3C60CD",
+"L- c #3C62CE",
+"M- c #3D65D0",
+"N- c #3D66D1",
+"O- c #4166D2",
+"P- c #4667D2",
+"Q- c #4A67D1",
+"R- c #4C68D0",
+"S- c #4C69CF",
+"T- c #4D6BCE",
+"U- c #4E6DCD",
+"V- c #4E6ECE",
+"W- c #4E6DCE",
+"X- c #4970D0",
+"Y- c #4770D0",
+"Z- c #4B6BCE",
+"`- c #4A6CCE",
+" ; c #496DCF",
+".; c #476FD0",
+"+; c #4870D0",
+"@; c #486DCF",
+"#; c #242F79",
+"$; c #2F41AC",
+"%; c #2040B8",
+"&; c #2041B8",
+"*; c #2243B3",
+"=; c #2243B8",
+"-; c #2343B8",
+";; c #2444B8",
+">; c #2445B8",
+",; c #2445B6",
+"'; c #2445B7",
+"); c #2444B9",
+"!; c #2949BE",
+"~; c #2649BF",
+"{; c #234BBF",
+"]; c #224CBF",
+"^; c #224AC0",
+"/; c #244CC0",
+"(; c #254DC0",
+"_; c #254DC1",
+":; c #264DC2",
+"<; c #274EC3",
+"[; c #274CC3",
+"}; c #274DC4",
+"|; c #254DC5",
+"1; c #214EC5",
+"2; c #204FC6",
+"3; c #1F50C8",
+"4; c #2151C9",
+"5; c #2B53C8",
+"6; c #3154C7",
+"7; c #3255C6",
+"8; c #2F57C7",
+"9; c #2C58C9",
+"0; c #2D59CA",
+"a; c #2D58C9",
+"b; c #2E5BCC",
+"c; c #325ECC",
+"d; c #325ECB",
+"e; c #1F40B1",
+"f; c #1F40B2",
+"g; c #1F40B3",
+"h; c #2A44BD",
+"i; c #2845BE",
+"j; c #2745BE",
+"k; c #2646BF",
+"l; c #2546BE",
+"m; c #2347BF",
+"n; c #2147BF",
+"o; c #2048C0",
+"p; c #1D48C0",
+"q; c #1C48C0",
+"r; c #1B47C0",
+"s; c #1C48BF",
+"t; c #1E49BE",
+"u; c #214ABD",
+"v; c #244CBD",
+"w; c #264DBE",
+"x; c #254EC0",
+"y; c #214FC2",
+"z; c #1B51C5",
+"A; c #1C51C7",
+"B; c #2250C8",
+"C; c #2A52C8",
+"D; c #3254C6",
+"E; c #3355C5",
+"F; c #3154C8",
+"G; c #3355C6",
+"H; c #2F57C8",
+"I; c #2E58C9",
+"J; c #2E59C9",
+"K; c #3059C9",
+"L; c #2040B6",
+"M; c #2743BB",
+"N; c #2844BC",
+"O; c #2743BD",
+"P; c #2844BE",
+"Q; c #2844BD",
+"R; c #2346BE",
+"S; c #2047BF",
+"T; c #1E48C0",
+"U; c #1D47C0",
+"V; c #1D49BF",
+"W; c #1F49BF",
+"X; c #204ABE",
+"Y; c #254DBF",
+"Z; c #234EC0",
+"`; c #2050C1",
+" > c #1C51C3",
+".> c #1F51C6",
+"+> c #2651C8",
+"@> c #2D53C7",
+"#> c #3155C6",
+"$> c #3155C7",
+"%> c #3355C7",
+"&> c #3254C7",
+"*> c #1E40B1",
+"=> c #2141B8",
+"-> c #2442B9",
+";> c #2744BB",
+">> c #2945BB",
+",> c #2A45BB",
+"'> c #2944BA",
+")> c #2745BB",
+"!> c #2545BC",
+"~> c #2246BD",
+"{> c #2047BE",
+"]> c #1F47BD",
+"^> c #1D48BE",
+"/> c #1E49C0",
+"(> c #1F4AC0",
+"_> c #214BBF",
+":> c #244CBE",
+"<> c #254DBE",
+"[> c #244DBE",
+"}> c #224FBF",
+"|> c #2051C1",
+"1> c #2151C3",
+"2> c #2252C5",
+"3> c #2151C1",
+"4> c #2851C6",
+"5> c #2A50C6",
+"6> c #2E54C6",
+"7> c #1F51C2",
+"8> c #1D52C5",
+"9> c #2651C9",
+"0> c #2950C7",
+"a> c #2D40A5",
+"b> c #2040B0",
+"c> c #1F40B0",
+"d> c #223CAE",
+"e> c #233CAE",
+"f> c #253BAC",
+"g> c #253BAD",
+"h> c #233CB0",
+"i> c #213EB2",
+"j> c #1F3FB4",
+"k> c #1E40B6",
+"l> c #1F3FB7",
+"m> c #1E3EB8",
+"n> c #1F3FB8",
+"o> c #2040B7",
+"p> c #2141B6",
+"q> c #2140B7",
+"r> c #2241B6",
+"s> c #2342B5",
+"t> c #2442B6",
+"u> c #2543B5",
+"v> c #2643B4",
+"w> c #2544B6",
+"x> c #2346B8",
+"y> c #2247B9",
+"z> c #2048BC",
+"A> c #1F48BF",
+"B> c #2049C0",
+"C> c #214AC0",
+"D> c #224BBF",
+"E> c #234CBE",
+"F> c #244DBF",
+"G> c #234CBF",
+"H> c #264DC0",
+"I> c #274EBF",
+"J> c #264DBF",
+"K> c #254EBF",
+"L> c #2050C0",
+"M> c #1F51C1",
+"N> c #1E42A4",
+"O> c #263BA6",
+"P> c #253BA7",
+"Q> c #253CA7",
+"R> c #1E41A5",
+"S> c #1F40AF",
+"T> c #273AAC",
+"U> c #1E40B0",
+"V> c #1F40B5",
+"W> c #1F40B6",
+"X> c #1F40B8",
+"Y> c #1E40B8",
+"Z> c #1F3EB8",
+"`> c #203FB7",
+" , c #2240B6",
+"., c #2341B7",
+"+, c #2345B9",
+"@, c #2147BB",
+"#, c #2148BA",
+"$, c #2049BB",
+"%, c #2049BD",
+"&, c #2049BF",
+"*, c #224BBE",
+"=, c #244DBD",
+"-, c #244CBF",
+";, c #182969",
+">, c #273BAD",
+",, c #2739AB",
+"', c #263AAC",
+"), c #243CAE",
+"!, c #233DAE",
+"~, c #213EAF",
+"{, c #1F3FB0",
+"], c #2040B4",
+"^, c #1F3FB6",
+"/, c #1E3EB7",
+"(, c #2240B7",
+"_, c #2341B6",
+":, c #2543B4",
+"<, c #2644B3",
+"[, c #2544B5",
+"}, c #2545B5",
+"|, c #2547B6",
+"1, c #2548B7",
+"2, c #2349BA",
+"3, c #1F49BE",
+"4, c #2149BD",
+"5, c #2049BE",
+"6, c #214BBE",
+"7, c #2249BE",
+"8, c #234CBD",
+"9, c #2149BE",
+"0, c #1E49BF",
+"a, c #253BA9",
+"b, c #253BAB",
+"c, c #263AAB",
+"d, c #213DAF",
+"e, c #203EAF",
+"f, c #1D40AF",
+"g, c #1D40B0",
+"h, c #1E40B4",
+"i, c #2241B7",
+"j, c #2643B6",
+"k, c #2744B5",
+"l, c #2643B5",
+"m, c #2346B6",
+"n, c #2147B7",
+"o, c #2644B6",
+"p, c #2247B7",
+"q, c #2248B8",
+"r, c #2647B7",
+"s, c #2549B7",
+"t, c #2645B7",
+"u, c #2148B8",
+"v, c #2847B6",
+"w, c #2549B6",
+"x, c #2849B6",
+"y, c #2049B7",
+"z, c #2A49B5",
+"A, c #243BA4",
+"B, c #253BA5",
+"C, c #253BA6",
+"D, c #263AA7",
+"E, c #263AA8",
+"F, c #2739AA",
+"G, c #243CAD",
+"H, c #223DAE",
+"I, c #1F3EAF",
+"J, c #1E3FB0",
+"K, c #1D40B1",
+"L, c #1E3FB1",
+"M, c #1F3FB3",
+"N, c #1F3FB5",
+"O, c #2140B6",
+"P, c #2140B8",
+"Q, c #2744B4",
+"R, c #2746B6",
+"S, c #2947B6",
+"T, c #2946B5",
+"U, c #2A48B6",
+"V, c #3551A8",
+"W, c #1F399C",
+"X, c #143D9F",
+"Y, c #263BA5",
+"Z, c #273BA8",
+"`, c #273BAA",
+" ' c #263AAD",
+".' c #233CAD",
+"+' c #213DAE",
+"@' c #203FB2",
+"#' c #2342B6",
+"$' c #2443B6",
+"%' c #2543B6",
+"&' c #2644B5",
+"*' c #133D9E",
+"=' c #263BA7",
+"-' c #263BA9",
+";' c #273BA9",
+">' c #263AAA",
+",' c #2539AB",
+"'' c #2639AB",
+")' c #253AAC",
+"!' c #243BAD",
+"~' c #223DAF",
+"{' c #203FB0",
+"]' c #2040B1",
+"^' c #2140B3",
+"/' c #2543B1",
+"(' c #2744AF",
+"_' c #1A3CA0",
+":' c #1D3BA2",
+"<' c #233BA4",
+"[' c #263AA5",
+"}' c #253AA5",
+"|' c #263AA6",
+"1' c #263BA4",
+"2' c #243BA5",
+"3' c #263BA8",
+"4' c #223EAF",
+"5' c #3B4CA5",
+"6' c #1D379A",
+"7' c #1E389C",
+"8' c #1E399F",
+"9' c #1F3BA2",
+"0' c #1F3BA3",
+"a' c #213BA4",
+"b' c #233AA3",
+"c' c #243AA3",
+"d' c #2539A4",
+"e' c #253AA6",
+"f' c #243BA7",
+"g' c #253CAA",
+"h' c #253CAC",
+"i' c #253CAD",
+"j' c #253CAE",
+"k' c #243DAE",
+"l' c #213FAF",
+"m' c #223FAF",
+"n' c #2040AF",
+"o' c #253D93",
+"p' c #1D3894",
+"q' c #1F379A",
+"r' c #1E389B",
+"s' c #1D399C",
+"t' c #1C3A9D",
+"u' c #1B3A9D",
+"v' c #183B9E",
+"w' c #163C9E",
+"x' c #153C9E",
+"y' c #163B9D",
+"z' c #173B9D",
+"A' c #193A9D",
+"B' c #1C3A9E",
+"C' c #1F3AA1",
+"D' c #223AA4",
+"E' c #253BA8",
+"F' c #273BA7",
+"G' c #263CAB",
+"H' c #263CAC",
+"I' c #243EAE",
+"J' c #273BAC",
+"K' c #2A3795",
+"L' c #1F389B",
+"M' c #1D389B",
+"N' c #1C399C",
+"O' c #1B399C",
+"P' c #1A3A9D",
+"Q' c #1D399B",
+"R' c #1B399B",
+"S' c #1A3A9C",
+"T' c #1B3A9F",
+"U' c #1D3AA0",
+"V' c #203BA2",
+"W' c #203BA3",
+"X' c #2639A6",
+"Y' c #1B3692",
+"Z' c #1C3794",
+"`' c #1D3796",
+" ) c #1E3898",
+".) c #1E389A",
+"+) c #1F399B",
+"@) c #1A399C",
+"#) c #193A9E",
+"$) c #1A3BA0",
+"%) c #1C3BA2",
+"&) c #1D3CA3",
+"*) c #203CA4",
+"=) c #223BA5",
+"-) c #3C4699",
+";) c #2B4595",
+">) c #1C3793",
+",) c #1D3895",
+"') c #1E3897",
+")) c #1F3998",
+"!) c #1F3999",
+"~) c #1F399A",
+"{) c #1E399C",
+"]) c #1C3B9E",
+"^) c #1D3BA0",
+"/) c #1E3CA2",
+"() c #223CA5",
+"_) c #243CA6",
+":) c #596FA9",
+"<) c #3B4894",
+"[) c #314993",
+"}) c #29499F",
+"|) c #28489E",
+"1) c #2B4BA1",
+"2) c #2C4BA1",
+"3) c #2D4CA2",
+"4) c #2E4CA3",
+"5) c #2F4CA4",
+"6) c #2E4CA4",
+"7) c #2F4DA3",
+"8) c #2F4DA4",
+"9) c #D3D5D2",
+"0) c #3B4794",
+"a) c #314791",
+"b) c #304892",
+"c) c #304893",
+"d) c #2F4995",
+"e) c #2F4997",
+"f) c #2D4A9A",
+"g) c #2A4A9D",
+"h) c #294A9F",
+"i) c #284AA0",
+"j) c #294AA0",
+"k) c #2B4AA1",
+"l) c #2D4CA3",
+"m) c #C9CAC9",
+"n) c #455D9B",
+"o) c #242F78",
+"p) c #1B2F85",
+"q) c #C6C3C8",
+"r) c #B5B2B6",
+"s) c #B5B7B4",
+"t) c #B5B7B3",
+"u) c #B5B2B5",
+"v) c #B5B3B4",
+"w) c #B5B5B4",
+"x) c #B5B6B3",
+"y) c #B5B4B4",
+"z) c #B5B3B5",
+"A) c #B5B4B5",
+"B) c #B5B5B5",
+"C) c #B5B5B3",
+"D) c #B5B5B6",
+"E) c #BAC3BE",
+"F) c #B9C3BD",
+"G) c #C1C3C4",
+"H) c #BFC3C2",
+"I) c #B9C3BE",
+"J) c #BBC3BF",
+"K) c #BDC3C1",
+"L) c #C0C3C3",
+"M) c #BEC3C1",
+"N) c #C2C3C5",
+"O) c #E6E3E8",
+"P) c #E0E2DF",
+"Q) c #E1E1E1",
+"R) c #E2E1E3",
+"S) c #E4E1E6",
+"T) c #E4E2E7",
+"U) c #E4E2E6",
+"V) c #E3E3E4",
+"W) c #E2E3E3",
+"X) c #E1E3E2",
+"Y) c #E3E3E3",
+"Z) c #E3E3E2",
+"`) c #EBEDEA",
+" ! c #EAECE9",
+".! c #E9EBE8",
+"+! c #ECEEEB",
". . + @ # $ $ $ $ $ $ $ % $ $ $ $ $ % $ $ $ $ $ $ % $ $ $ $ $ % $ $ $ $ $ $ $ $ $ % $ $ & * = - ; > , , ' ) ! ! ~ { ] ^ / ( _ : < [ } | | 1 2 3 3 4 4 4 4 4 4 4 5 6 4 4 4 5 6 7 8 9 4 5 6 7 8 9 6 7 8 9 ",
"0 a b % $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ c d d d d $ $ $ $ $ c d e f g h i i i i j k l m n o p q r s t u v w x y z 4 A B C D 9 9 E 9 E F G H I F J K L L L L J K L L L L L L L L ",
"@ % M N O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O P Q R S T U V W X Y Z ` ...+.@.#.$.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.b.b.b.b.b.",
@@ -2788,786 +2788,786 @@ static char * listviewhighcornerleft_xpm[] = {
static char * listviewhighcornerright_xpm[] = {
"100 46 780 2",
-" c None",
-". c #6A779D",
-"+ c #6C789C",
-"@ c #6C789D",
-"# c #6B789D",
-"$ c #6A779E",
-"% c #66759E",
-"& c #64749E",
-"* c #63749E",
-"= c #61739D",
-"- c #576D9B",
-"; c #556C9C",
-"> c #4D679D",
-", c #4A649D",
-"' c #49629D",
-") c #465E9C",
-"! c #40579C",
-"~ c #3B5394",
-"{ c #2C4E97",
-"] c #314993",
-"^ c #2B4595",
-"/ c #1B4296",
-"( c #253D93",
-"_ c #19418F",
-": c #0F3C96",
-"< c #42599E",
-"[ c #758DC3",
-"} c #E8EAE7",
-"| c #EEF0ED",
-"1 c #FBFBFC",
-"2 c #6F7D9B",
-"3 c #6F7D9A",
-"4 c #6E7B9C",
-"5 c #67759E",
-"6 c #63739E",
-"7 c #62739D",
-"8 c #596F9C",
-"9 c #4A639D",
-"0 c #47609C",
-"a c #445B9F",
-"b c #3E5697",
-"c c #2E509A",
-"d c #2D509A",
-"e c #2D4F99",
-"f c #2D4F98",
-"g c #28418A",
-"h c #3E51A3",
-"i c #D0D3DC",
-"j c #A1B6EF",
-"k c #A2B6F0",
-"l c #A1B6F0",
-"m c #A3B6F0",
-"n c #A0B6EF",
-"o c #9DB6EE",
-"p c #9CB5EF",
-"q c #9CB2F0",
-"r c #9FB5EE",
-"s c #9CB4EB",
-"t c #9AB3EC",
-"u c #9AB0EC",
-"v c #9DB3EB",
-"w c #9BB4EC",
-"x c #9BB4EE",
-"y c #9BB1EF",
-"z c #9BB0F0",
-"A c #90ACF0",
-"B c #93ABEE",
-"C c #91A8EB",
-"D c #8BA3E8",
-"E c #88A1E7",
-"F c #809DE9",
-"G c #7A99E8",
-"H c #7491E5",
-"I c #698AE4",
-"J c #6184E3",
-"K c #507EDC",
-"L c #4E7CDB",
-"M c #4F7DDC",
-"N c #5479DA",
-"O c #567BDC",
-"P c #577CDD",
-"Q c #5074DA",
-"R c #5174DB",
-"S c #5175DC",
-"T c #5276DD",
-"U c #4D71DE",
-"V c #4C72D8",
-"W c #3A6CE0",
-"X c #2B49A6",
-"Y c #E0E2DF",
-"Z c #93AAE9",
-"` c #94A9E8",
-" . c #94AAE9",
-".. c #93A9E9",
-"+. c #92AAE9",
-"@. c #8DA9E8",
-"#. c #8CA7E9",
-"$. c #92ABE9",
-"%. c #8EAAE9",
-"&. c #8EA9E9",
-"*. c #8FAAE9",
-"=. c #8CA8E9",
-"-. c #8CA2E7",
-";. c #86A1E6",
-">. c #839EE9",
-",. c #7F9CE9",
-"'. c #7A97E8",
-"). c #7693E7",
-"!. c #6E8EE8",
-"~. c #678AE9",
-"{. c #5D84E3",
-"]. c #577CDF",
-"^. c #4E77DF",
-"/. c #4A70DB",
-"(. c #4870DB",
-"_. c #4870DC",
-":. c #4770E3",
-"<. c #496FDC",
-"[. c #486EDB",
-"}. c #466FE4",
-"|. c #466EE3",
-"1. c #4167D9",
-"2. c #4066D8",
-"3. c #3F66D8",
-"4. c #3D64D7",
-"5. c #3960DA",
-"6. c #476DD9",
-"7. c #446EE5",
-"8. c #305EC8",
-"9. c #8EAAE8",
-"0. c #8FAAE8",
-"a. c #91AAE9",
-"b. c #8FA9E8",
-"c. c #8BA8E8",
-"d. c #8AA7E9",
-"e. c #8BA5EA",
-"f. c #8AA7E8",
-"g. c #87A2E6",
-"h. c #859FE8",
-"i. c #7F9DE8",
-"j. c #7C9AE8",
-"k. c #7B95E7",
-"l. c #7090E8",
-"m. c #6B8BE9",
-"n. c #6386E6",
-"o. c #5881E1",
-"p. c #5479DE",
-"q. c #4D74DE",
-"r. c #476EDB",
-"s. c #446EE1",
-"t. c #446EE0",
-"u. c #446EDF",
-"v. c #446DE0",
-"w. c #426ADF",
-"x. c #3C64DA",
-"y. c #4360CC",
-"z. c #D3D5D2",
-"A. c #E6E3E8",
-"B. c #8DA2E7",
-"C. c #8CA6EA",
-"D. c #8DA3E9",
-"E. c #88A2E7",
-"F. c #87A1E7",
-"G. c #8AA1E7",
-"H. c #849EE9",
-"I. c #7D9AE9",
-"J. c #7B98E8",
-"K. c #7796E5",
-"L. c #7191E7",
-"M. c #688CE9",
-"N. c #6687E5",
-"O. c #5C83E1",
-"P. c #557BDE",
-"Q. c #4F76DE",
-"R. c #4C72DE",
-"S. c #456EDF",
-"T. c #426AD9",
-"U. c #4269D9",
-"V. c #4269D8",
-"W. c #3D64D9",
-"X. c #3A61DA",
-"Y. c #345ED6",
-"Z. c #335ECF",
-"`. c #C6C3C8",
-" + c #86A1E7",
-".+ c #87A2E7",
-"++ c #87A0E7",
-"@+ c #859EE8",
-"#+ c #849DE9",
-"$+ c #7E9BE9",
-"%+ c #7A99E9",
-"&+ c #7A95E5",
-"*+ c #7593E7",
-"=+ c #6F8EE9",
-"-+ c #668AE5",
-";+ c #6386E0",
-">+ c #5B82DF",
-",+ c #5379DE",
-"'+ c #5075DE",
-")+ c #4B6FDC",
-"!+ c #446AD7",
-"~+ c #4269D6",
-"{+ c #4269D5",
-"]+ c #3E65D7",
-"^+ c #C9CAC9",
-"/+ c #869EE9",
-"(+ c #859FE9",
-"_+ c #849FE9",
-":+ c #829DE8",
-"<+ c #819DE8",
-"[+ c #7B9AE9",
-"}+ c #7A96E6",
-"|+ c #7290E8",
-"1+ c #698CE6",
-"2+ c #6689E0",
-"3+ c #5D84E0",
-"4+ c #587FDF",
-"5+ c #5377DD",
-"6+ c #4B74DE",
-"7+ c #496BD8",
-"8+ c #7C9BE9",
-"9+ c #7E9CE9",
-"0+ c #7D9AEA",
-"a+ c #7D9BEA",
-"b+ c #7D98E8",
-"c+ c #7C98E8",
-"d+ c #7796E4",
-"e+ c #7592E6",
-"f+ c #7390E1",
-"g+ c #698DE0",
-"h+ c #6588DE",
-"i+ c #5E84E0",
-"j+ c #5880DF",
-"k+ c #5479DC",
-"l+ c #4F75DE",
-"m+ c #4A6FDB",
-"n+ c #436AD7",
-"o+ c #3F65D7",
-"p+ c #BAC3BE",
-"q+ c #7B9AE8",
-"r+ c #7B9AEA",
-"s+ c #7A9AEA",
-"t+ c #7B99E9",
-"u+ c #7D97E7",
-"v+ c #7D95E6",
-"w+ c #7D95E5",
-"x+ c #7C95E6",
-"y+ c #7493E3",
-"z+ c #7290DF",
-"A+ c #6C8DDE",
-"B+ c #6B89E1",
-"C+ c #6486DF",
-"D+ c #5D81DF",
-"E+ c #567DDE",
-"F+ c #4F73DE",
-"G+ c #496EDA",
-"H+ c #355ED6",
-"I+ c #345ED5",
-"J+ c #7E95E5",
-"K+ c #7C97E8",
-"L+ c #7C97E7",
-"M+ c #7B94E6",
-"N+ c #7A95E4",
-"O+ c #7695E5",
-"P+ c #7694E4",
-"Q+ c #7994E6",
-"R+ c #7995E4",
-"S+ c #7594E4",
-"T+ c #7391E2",
-"U+ c #6E8EDE",
-"V+ c #6B8ADE",
-"W+ c #6688DF",
-"X+ c #5F84E0",
-"Y+ c #5980E0",
-"Z+ c #4D72DD",
-"`+ c #456BD7",
-" @ c #4168D6",
-".@ c #3C64D7",
-"+@ c #335ED0",
-"@@ c #4659C7",
-"#@ c #7292E1",
-"$@ c #7392E1",
-"%@ c #7492E1",
-"&@ c #718FDF",
-"*@ c #6F8EDE",
-"=@ c #6D8BDE",
-"-@ c #6B88DF",
-";@ c #597FDF",
-">@ c #557ADD",
-",@ c #5176DC",
-"'@ c #4D74DD",
-")@ c #496DDA",
-"!@ c #3860D8",
-"~@ c #7391E0",
-"{@ c #7290DE",
-"]@ c #6D8EDD",
-"^@ c #6D8DDD",
-"/@ c #7190E0",
-"(@ c #6C8DDD",
-"_@ c #6B89DF",
-":@ c #6487E0",
-"<@ c #6085DF",
-"[@ c #5F81DE",
-"}@ c #567EDE",
-"|@ c #4F74D9",
-"1@ c #466BD7",
-"2@ c #4067D5",
-"3@ c #3C63D7",
-"4@ c #335ED3",
-"5@ c #335ED1",
-"6@ c #718EDD",
-"7@ c #728EDD",
-"8@ c #748EDD",
-"9@ c #708EDD",
-"0@ c #6F8DDD",
-"a@ c #6E8DDD",
-"b@ c #6C8ADE",
-"c@ c #6C89DF",
-"d@ c #6988DF",
-"e@ c #6387DF",
-"f@ c #6282DE",
-"g@ c #5681E0",
-"h@ c #577BDD",
-"i@ c #5277DB",
-"j@ c #4D73D8",
-"k@ c #4A70D8",
-"l@ c #436AD5",
-"m@ c #3F66D6",
-"n@ c #3C63D8",
-"o@ c #3960D8",
-"p@ c #3860D7",
-"q@ c #335ED2",
-"r@ c #345ED4",
-"s@ c #6C88DF",
-"t@ c #6D88DF",
-"u@ c #6B89DE",
-"v@ c #6888DF",
-"w@ c #6587E0",
-"x@ c #6989DF",
-"y@ c #6687E0",
-"z@ c #6287E0",
-"A@ c #6281DD",
-"B@ c #5881E0",
-"C@ c #557ADB",
-"D@ c #5176D9",
-"E@ c #4E75D7",
-"F@ c #4A6FD8",
-"G@ c #476BD6",
-"H@ c #4067D6",
-"I@ c #3C62D7",
-"J@ c #3C60D4",
-"K@ c #365ED1",
-"L@ c #345ED3",
-"M@ c #6786DF",
-"N@ c #5F85E0",
-"O@ c #5F86E0",
-"P@ c #6186DF",
-"Q@ c #6286E0",
-"R@ c #6284DF",
-"S@ c #6384DF",
-"T@ c #5B7FDE",
-"U@ c #577DDC",
-"V@ c #557BDA",
-"W@ c #5278D8",
-"X@ c #4E76D6",
-"Y@ c #4C72D7",
-"Z@ c #486DD8",
-"`@ c #4469D6",
-" # c #3F62D2",
-".# c #3C60CF",
-"+# c #345ECF",
-"@# c #6086DF",
-"## c #6085E0",
-"$# c #6285DF",
-"%# c #6383DD",
-"&# c #6481DC",
-"*# c #6380DD",
-"=# c #6183DE",
-"-# c #6083DD",
-";# c #6081DC",
-"># c #6080DD",
-",# c #6083DE",
-"'# c #6181DC",
-")# c #6280DD",
-"!# c #577EDB",
-"~# c #557CD7",
-"{# c #4F76D6",
-"]# c #4E74D7",
-"^# c #466CD7",
-"/# c #3B64D6",
-"(# c #4261CD",
-"_# c #375FCE",
-":# c #5A7FD8",
-"<# c #6281DA",
-"[# c #5F81D8",
-"}# c #5C80D8",
-"|# c #557DD7",
-"1# c #577ED8",
-"2# c #567ED7",
-"3# c #587DD8",
-"4# c #577DD8",
-"5# c #587ED8",
-"6# c #567DD8",
-"7# c #5379D9",
-"8# c #5177D7",
-"9# c #4D74D5",
-"0# c #486ED9",
-"a# c #4068D4",
-"b# c #3D65D2",
-"c# c #4361CC",
-"d# c #345ECE",
-"e# c #325DCF",
-"f# c #2C5AD1",
-"g# c #3959C5",
-"h# c #547BD8",
-"i# c #567DD7",
-"j# c #557BD8",
-"k# c #5279D9",
-"l# c #5278D9",
-"m# c #4D74D6",
-"n# c #4B71D8",
-"o# c #496CD8",
-"p# c #4669D7",
-"q# c #3D66D3",
-"r# c #3F62CF",
-"s# c #4260CC",
-"t# c #5379D8",
-"u# c #4E75D4",
-"v# c #4C73D7",
-"w# c #476CD7",
-"x# c #4869D0",
-"y# c #4067D2",
-"z# c #3D64D1",
-"A# c #4261CC",
-"B# c #395FCE",
-"C# c #4F75D3",
-"D# c #5074D2",
-"E# c #5174D1",
-"F# c #5175D1",
-"G# c #4F74D3",
-"H# c #4C73D5",
-"I# c #4C73D4",
-"J# c #4A72D1",
-"K# c #4B70CF",
-"L# c #506CCC",
-"M# c #4D6BCE",
-"N# c #4167D0",
-"O# c #3D65D1",
-"P# c #3F63CF",
-"Q# c #3B5FCD",
-"R# c #3159CD",
-"S# c #4971D0",
-"T# c #4870CF",
-"U# c #4C6FCF",
-"V# c #4E6CCE",
-"W# c #4E6BCE",
-"X# c #4769CF",
-"Y# c #3D66D0",
-"Z# c #3C65D1",
-"`# c #4062CE",
-" $ c #3D5FCD",
-".$ c #365FCF",
-"+$ c #325DCD",
-"@$ c #2D5AD0",
-"#$ c #3859C5",
-"$$ c #355FCF",
-"%$ c #355ECF",
-"&$ c #335ECE",
-"*$ c #305CCD",
-"=$ c #2B5ACE",
-"-$ c #3056C9",
-";$ c #2553C6",
-">$ c #2153C8",
-",$ c #1F4FC7",
-"'$ c #274CC5",
-")$ c #214AC7",
-"!$ c #1C48C8",
-"~$ c #1244C9",
-"{$ c #1043C9",
-"]$ c #1144C9",
-"^$ c #2A45BE",
-"/$ c #2744B5",
-"($ c #1D49C0",
-"_$ c #2B58DE",
-":$ c #002D94",
-"<$ c #2B59CA",
-"[$ c #2A59CA",
-"}$ c #2E57C8",
-"|$ c #3255C6",
-"1$ c #3355C5",
-"2$ c #1C52C8",
-"3$ c #1D50C7",
-"4$ c #234FC6",
-"5$ c #264CC5",
-"6$ c #1D48C7",
-"7$ c #1245C8",
-"8$ c #1F44C2",
-"9$ c #2945BE",
-"0$ c #2A45BD",
-"a$ c #2040BF",
-"b$ c #3156C7",
-"c$ c #3056C7",
-"d$ c #3354C5",
-"e$ c #3355C6",
-"f$ c #3255C5",
-"g$ c #3254C5",
-"h$ c #1952C7",
-"i$ c #1951C8",
-"j$ c #2050C7",
-"k$ c #274CC4",
-"l$ c #244CC6",
-"m$ c #1F49C7",
-"n$ c #1E47C5",
-"o$ c #2045C3",
-"p$ c #1C44BF",
-"q$ c #2045BE",
-"r$ c #2040B8",
-"s$ c #3254C6",
-"t$ c #3055C6",
-"u$ c #2A54C6",
-"v$ c #2353C7",
-"w$ c #3054C5",
-"x$ c #2F55C5",
-"y$ c #2A54C5",
-"z$ c #2553C5",
-"A$ c #2F54C5",
-"B$ c #3155C6",
-"C$ c #2A54C7",
-"D$ c #1A52C8",
-"E$ c #204FC2",
-"F$ c #264DC6",
-"G$ c #234BC5",
-"H$ c #1D48C1",
-"I$ c #1E48BF",
-"J$ c #2646BE",
-"K$ c #2B45BD",
-"L$ c #1E43BE",
-"M$ c #2643BF",
-"N$ c #2243BF",
-"O$ c #3049BC",
-"P$ c #1E50BE",
-"Q$ c #1D50C0",
-"R$ c #1D50BF",
-"S$ c #1852C1",
-"T$ c #1E51C0",
-"U$ c #214FBF",
-"V$ c #2050C0",
-"W$ c #244EBF",
-"X$ c #2151C0",
-"Y$ c #234FBF",
-"Z$ c #2350C0",
-"`$ c #2351C0",
-" % c #244FBF",
-".% c #2250C0",
-"+% c #2051C0",
-"@% c #1E50C0",
-"#% c #244DBE",
-"$% c #274DBF",
-"%% c #244CBF",
-"&% c #1C48C0",
-"*% c #2247BF",
-"=% c #2C44BD",
-"-% c #1C44BE",
-";% c #1444BF",
-">% c #1841BF",
-",% c #1F40BF",
-"'% c #254DBE",
-")% c #224FBE",
-"!% c #224FBF",
-"~% c #234EBF",
-"{% c #254CBD",
-"]% c #244DBD",
-"^% c #244CBD",
-"/% c #264DBE",
-"(% c #264DBD",
-"_% c #214BC0",
-":% c #1D48C0",
-"<% c #2347BF",
-"[% c #2B44BD",
-"}% c #2444BE",
-"|% c #0F42BF",
-"1% c #0641BF",
-"2% c #0F41BF",
-"3% c #1741BE",
-"4% c #1F40BD",
-"5% c #234BBF",
-"6% c #234CBE",
-"7% c #214BBE",
-"8% c #244CBE",
-"9% c #214ABE",
-"0% c #214ABF",
-"a% c #1F48C0",
-"b% c #2746BE",
-"c% c #1F43BE",
-"d% c #0941BE",
-"e% c #0342BA",
-"f% c #0242BC",
-"g% c #1241B8",
-"h% c #1F40B7",
-"i% c #2F41AC",
-"j% c #2644AE",
-"k% c #2D49B4",
-"l% c #2649B6",
-"m% c #2949B7",
-"n% c #2849B5",
-"o% c #2149B8",
-"p% c #1E49B9",
-"q% c #1F48B8",
-"r% c #1F49B9",
-"s% c #2545B6",
-"t% c #2744B7",
-"u% c #2844B7",
-"v% c #2043B8",
-"w% c #1241B7",
-"x% c #1340B8",
-"y% c #0D41B8",
-"z% c #1941B8",
-"A% c #1F40B8",
-"B% c #203FB8",
-"C% c #2549B5",
-"D% c #2648B6",
-"E% c #2547B7",
-"F% c #2248B7",
-"G% c #2048B7",
-"H% c #2346B6",
-"I% c #2146B6",
-"J% c #2247B7",
-"K% c #2148B7",
-"L% c #2743B4",
-"M% c #2643B5",
-"N% c #2542B6",
-"O% c #1D42B7",
-"P% c #0E42B8",
-"Q% c #0C41B8",
-"R% c #1341B8",
-"S% c #1740B8",
-"T% c #1C41B8",
-"U% c #1F40B1",
-"V% c #2644B5",
-"W% c #2544B5",
-"X% c #2544B4",
-"Y% c #2444B5",
-"Z% c #2444B4",
-"`% c #2744B4",
-" & c #2241B7",
-".& c #1D41B8",
-"+& c #0B42B8",
-"@& c #0942B8",
-"#& c #0C42B8",
-"$& c #0F41B8",
-"%& c #1641B8",
-"&& c #2442B5",
-"*& c #2543B3",
-"=& c #2342B2",
-"-& c #2341B4",
-";& c #2141B3",
-">& c #2141B5",
-",& c #2140B5",
-"'& c #2040B5",
-")& c #1C40B7",
-"!& c #1B41B3",
-"~& c #0142B6",
-"{& c #0E41B7",
-"]& c #1141B7",
-"^& c #1440B2",
-"/& c #113FB0",
-"(& c #1440B0",
-"_& c #213EAF",
-":& c #233DAE",
-"<& c #223EAF",
-"[& c #1E40B1",
-"}& c #173EAD",
-"|& c #1440AF",
-"1& c #0D40AF",
-"2& c #0941B0",
-"3& c #0D3FAE",
-"4& c #1B3CAC",
-"5& c #233CAD",
-"6& c #203FB0",
-"7& c #273BAD",
-"8& c #1D40B0",
-"9& c #2040B1",
-"0& c #1E40B0",
-"a& c #1C40B0",
-"b& c #1B3DAC",
-"c& c #143DAC",
-"d& c #193DAD",
-"e& c #1B3DAD",
-"f& c #173DAD",
-"g& c #153DAC",
-"h& c #1C3CAC",
-"i& c #243CAD",
-"j& c #213FB0",
-"k& c #263BAA",
-"l& c #253CAE",
-"m& c #273AAC",
-"n& c #273AAD",
-"o& c #253BAD",
-"p& c #1D3CAC",
-"q& c #243BAD",
-"r& c #1E3CAC",
-"s& c #263BAD",
-"t& c #1A3DAC",
-"u& c #143DAB",
-"v& c #163DAC",
-"w& c #1A3CAC",
-"x& c #1F3CAD",
-"y& c #263BAB",
-"z& c #263BA6",
-"A& c #1E42A4",
-"B& c #2D40A5",
-"C& c #253BA6",
-"D& c #253CA7",
-"E& c #263AA5",
-"F& c #253BA7",
-"G& c #1E3BA6",
-"H& c #193DA6",
-"I& c #173DA5",
-"J& c #143DA6",
-"K& c #1A3DA7",
-"L& c #133DA6",
-"M& c #123DA5",
-"N& c #1A3CA7",
-"O& c #243BA6",
-"P& c #263AA7",
-"Q& c #273BA7",
-"R& c #263AA6",
-"S& c #223BA6",
-"T& c #1D3BA6",
-"U& c #173CA6",
-"V& c #133DA5",
-"W& c #1B3DA6",
-"X& c #193DA5",
-"Y& c #123DA4",
-"Z& c #163CA5",
-"`& c #213CA6",
-" * c #273BA8",
-".* c #263BA7",
-"+* c #253BA5",
-"@* c #263BA5",
-"#* c #1C3BA6",
-"$* c #1B3BA9",
-"%* c #133BA8",
-"&* c #0A3BA7",
-"** c #083AA6",
-"=* c #123CA5",
-"-* c #0839A8",
-";* c #0239A6",
-">* c #123AA8",
-",* c #1F49C8",
-"'* c #2F4DA4",
-")* c #2E4DA3",
-"!* c #384CA4",
-"~* c #3C4DA7",
-"{* c #394EA7",
-"]* c #3B4CA5",
-"^* c #3C52B1",
-"/* c #3551A8",
-"(* c #3759BE",
-"_* c #4161C7",
-":* c #0033A8",
-"<* c #596FA9",
-"[* c #2F4DA3",
-"}* c #2D4BA5",
-"|* c #2E4CA4",
-"1* c #2C4AA5",
-"2* c #2D4BA4",
-"3* c #354DA4",
-"4* c #3A4BA4",
-"5* c #394DA6",
-"6* c #4056AD",
-"7* c #445BBB",
-"8* c #B5B7B4",
-"9* c #1B2F85",
-"0* c #242F79",
-"a* c #B5B5B5",
-"b* c #B5B2B6",
-"c* c #C0C3C3",
-"d* c #E3E3E4",
-"e* c #EBEDEA",
+" c None",
+". c #6A779D",
+"+ c #6C789C",
+"@ c #6C789D",
+"# c #6B789D",
+"$ c #6A779E",
+"% c #66759E",
+"& c #64749E",
+"* c #63749E",
+"= c #61739D",
+"- c #576D9B",
+"; c #556C9C",
+"> c #4D679D",
+", c #4A649D",
+"' c #49629D",
+") c #465E9C",
+"! c #40579C",
+"~ c #3B5394",
+"{ c #2C4E97",
+"] c #314993",
+"^ c #2B4595",
+"/ c #1B4296",
+"( c #253D93",
+"_ c #19418F",
+": c #0F3C96",
+"< c #42599E",
+"[ c #758DC3",
+"} c #E8EAE7",
+"| c #EEF0ED",
+"1 c #FBFBFC",
+"2 c #6F7D9B",
+"3 c #6F7D9A",
+"4 c #6E7B9C",
+"5 c #67759E",
+"6 c #63739E",
+"7 c #62739D",
+"8 c #596F9C",
+"9 c #4A639D",
+"0 c #47609C",
+"a c #445B9F",
+"b c #3E5697",
+"c c #2E509A",
+"d c #2D509A",
+"e c #2D4F99",
+"f c #2D4F98",
+"g c #28418A",
+"h c #3E51A3",
+"i c #D0D3DC",
+"j c #A1B6EF",
+"k c #A2B6F0",
+"l c #A1B6F0",
+"m c #A3B6F0",
+"n c #A0B6EF",
+"o c #9DB6EE",
+"p c #9CB5EF",
+"q c #9CB2F0",
+"r c #9FB5EE",
+"s c #9CB4EB",
+"t c #9AB3EC",
+"u c #9AB0EC",
+"v c #9DB3EB",
+"w c #9BB4EC",
+"x c #9BB4EE",
+"y c #9BB1EF",
+"z c #9BB0F0",
+"A c #90ACF0",
+"B c #93ABEE",
+"C c #91A8EB",
+"D c #8BA3E8",
+"E c #88A1E7",
+"F c #809DE9",
+"G c #7A99E8",
+"H c #7491E5",
+"I c #698AE4",
+"J c #6184E3",
+"K c #507EDC",
+"L c #4E7CDB",
+"M c #4F7DDC",
+"N c #5479DA",
+"O c #567BDC",
+"P c #577CDD",
+"Q c #5074DA",
+"R c #5174DB",
+"S c #5175DC",
+"T c #5276DD",
+"U c #4D71DE",
+"V c #4C72D8",
+"W c #3A6CE0",
+"X c #2B49A6",
+"Y c #E0E2DF",
+"Z c #93AAE9",
+"` c #94A9E8",
+" . c #94AAE9",
+".. c #93A9E9",
+"+. c #92AAE9",
+"@. c #8DA9E8",
+"#. c #8CA7E9",
+"$. c #92ABE9",
+"%. c #8EAAE9",
+"&. c #8EA9E9",
+"*. c #8FAAE9",
+"=. c #8CA8E9",
+"-. c #8CA2E7",
+";. c #86A1E6",
+">. c #839EE9",
+",. c #7F9CE9",
+"'. c #7A97E8",
+"). c #7693E7",
+"!. c #6E8EE8",
+"~. c #678AE9",
+"{. c #5D84E3",
+"]. c #577CDF",
+"^. c #4E77DF",
+"/. c #4A70DB",
+"(. c #4870DB",
+"_. c #4870DC",
+":. c #4770E3",
+"<. c #496FDC",
+"[. c #486EDB",
+"}. c #466FE4",
+"|. c #466EE3",
+"1. c #4167D9",
+"2. c #4066D8",
+"3. c #3F66D8",
+"4. c #3D64D7",
+"5. c #3960DA",
+"6. c #476DD9",
+"7. c #446EE5",
+"8. c #305EC8",
+"9. c #8EAAE8",
+"0. c #8FAAE8",
+"a. c #91AAE9",
+"b. c #8FA9E8",
+"c. c #8BA8E8",
+"d. c #8AA7E9",
+"e. c #8BA5EA",
+"f. c #8AA7E8",
+"g. c #87A2E6",
+"h. c #859FE8",
+"i. c #7F9DE8",
+"j. c #7C9AE8",
+"k. c #7B95E7",
+"l. c #7090E8",
+"m. c #6B8BE9",
+"n. c #6386E6",
+"o. c #5881E1",
+"p. c #5479DE",
+"q. c #4D74DE",
+"r. c #476EDB",
+"s. c #446EE1",
+"t. c #446EE0",
+"u. c #446EDF",
+"v. c #446DE0",
+"w. c #426ADF",
+"x. c #3C64DA",
+"y. c #4360CC",
+"z. c #D3D5D2",
+"A. c #E6E3E8",
+"B. c #8DA2E7",
+"C. c #8CA6EA",
+"D. c #8DA3E9",
+"E. c #88A2E7",
+"F. c #87A1E7",
+"G. c #8AA1E7",
+"H. c #849EE9",
+"I. c #7D9AE9",
+"J. c #7B98E8",
+"K. c #7796E5",
+"L. c #7191E7",
+"M. c #688CE9",
+"N. c #6687E5",
+"O. c #5C83E1",
+"P. c #557BDE",
+"Q. c #4F76DE",
+"R. c #4C72DE",
+"S. c #456EDF",
+"T. c #426AD9",
+"U. c #4269D9",
+"V. c #4269D8",
+"W. c #3D64D9",
+"X. c #3A61DA",
+"Y. c #345ED6",
+"Z. c #335ECF",
+"`. c #C6C3C8",
+" + c #86A1E7",
+".+ c #87A2E7",
+"++ c #87A0E7",
+"@+ c #859EE8",
+"#+ c #849DE9",
+"$+ c #7E9BE9",
+"%+ c #7A99E9",
+"&+ c #7A95E5",
+"*+ c #7593E7",
+"=+ c #6F8EE9",
+"-+ c #668AE5",
+";+ c #6386E0",
+">+ c #5B82DF",
+",+ c #5379DE",
+"'+ c #5075DE",
+")+ c #4B6FDC",
+"!+ c #446AD7",
+"~+ c #4269D6",
+"{+ c #4269D5",
+"]+ c #3E65D7",
+"^+ c #C9CAC9",
+"/+ c #869EE9",
+"(+ c #859FE9",
+"_+ c #849FE9",
+":+ c #829DE8",
+"<+ c #819DE8",
+"[+ c #7B9AE9",
+"}+ c #7A96E6",
+"|+ c #7290E8",
+"1+ c #698CE6",
+"2+ c #6689E0",
+"3+ c #5D84E0",
+"4+ c #587FDF",
+"5+ c #5377DD",
+"6+ c #4B74DE",
+"7+ c #496BD8",
+"8+ c #7C9BE9",
+"9+ c #7E9CE9",
+"0+ c #7D9AEA",
+"a+ c #7D9BEA",
+"b+ c #7D98E8",
+"c+ c #7C98E8",
+"d+ c #7796E4",
+"e+ c #7592E6",
+"f+ c #7390E1",
+"g+ c #698DE0",
+"h+ c #6588DE",
+"i+ c #5E84E0",
+"j+ c #5880DF",
+"k+ c #5479DC",
+"l+ c #4F75DE",
+"m+ c #4A6FDB",
+"n+ c #436AD7",
+"o+ c #3F65D7",
+"p+ c #BAC3BE",
+"q+ c #7B9AE8",
+"r+ c #7B9AEA",
+"s+ c #7A9AEA",
+"t+ c #7B99E9",
+"u+ c #7D97E7",
+"v+ c #7D95E6",
+"w+ c #7D95E5",
+"x+ c #7C95E6",
+"y+ c #7493E3",
+"z+ c #7290DF",
+"A+ c #6C8DDE",
+"B+ c #6B89E1",
+"C+ c #6486DF",
+"D+ c #5D81DF",
+"E+ c #567DDE",
+"F+ c #4F73DE",
+"G+ c #496EDA",
+"H+ c #355ED6",
+"I+ c #345ED5",
+"J+ c #7E95E5",
+"K+ c #7C97E8",
+"L+ c #7C97E7",
+"M+ c #7B94E6",
+"N+ c #7A95E4",
+"O+ c #7695E5",
+"P+ c #7694E4",
+"Q+ c #7994E6",
+"R+ c #7995E4",
+"S+ c #7594E4",
+"T+ c #7391E2",
+"U+ c #6E8EDE",
+"V+ c #6B8ADE",
+"W+ c #6688DF",
+"X+ c #5F84E0",
+"Y+ c #5980E0",
+"Z+ c #4D72DD",
+"`+ c #456BD7",
+" @ c #4168D6",
+".@ c #3C64D7",
+"+@ c #335ED0",
+"@@ c #4659C7",
+"#@ c #7292E1",
+"$@ c #7392E1",
+"%@ c #7492E1",
+"&@ c #718FDF",
+"*@ c #6F8EDE",
+"=@ c #6D8BDE",
+"-@ c #6B88DF",
+";@ c #597FDF",
+">@ c #557ADD",
+",@ c #5176DC",
+"'@ c #4D74DD",
+")@ c #496DDA",
+"!@ c #3860D8",
+"~@ c #7391E0",
+"{@ c #7290DE",
+"]@ c #6D8EDD",
+"^@ c #6D8DDD",
+"/@ c #7190E0",
+"(@ c #6C8DDD",
+"_@ c #6B89DF",
+":@ c #6487E0",
+"<@ c #6085DF",
+"[@ c #5F81DE",
+"}@ c #567EDE",
+"|@ c #4F74D9",
+"1@ c #466BD7",
+"2@ c #4067D5",
+"3@ c #3C63D7",
+"4@ c #335ED3",
+"5@ c #335ED1",
+"6@ c #718EDD",
+"7@ c #728EDD",
+"8@ c #748EDD",
+"9@ c #708EDD",
+"0@ c #6F8DDD",
+"a@ c #6E8DDD",
+"b@ c #6C8ADE",
+"c@ c #6C89DF",
+"d@ c #6988DF",
+"e@ c #6387DF",
+"f@ c #6282DE",
+"g@ c #5681E0",
+"h@ c #577BDD",
+"i@ c #5277DB",
+"j@ c #4D73D8",
+"k@ c #4A70D8",
+"l@ c #436AD5",
+"m@ c #3F66D6",
+"n@ c #3C63D8",
+"o@ c #3960D8",
+"p@ c #3860D7",
+"q@ c #335ED2",
+"r@ c #345ED4",
+"s@ c #6C88DF",
+"t@ c #6D88DF",
+"u@ c #6B89DE",
+"v@ c #6888DF",
+"w@ c #6587E0",
+"x@ c #6989DF",
+"y@ c #6687E0",
+"z@ c #6287E0",
+"A@ c #6281DD",
+"B@ c #5881E0",
+"C@ c #557ADB",
+"D@ c #5176D9",
+"E@ c #4E75D7",
+"F@ c #4A6FD8",
+"G@ c #476BD6",
+"H@ c #4067D6",
+"I@ c #3C62D7",
+"J@ c #3C60D4",
+"K@ c #365ED1",
+"L@ c #345ED3",
+"M@ c #6786DF",
+"N@ c #5F85E0",
+"O@ c #5F86E0",
+"P@ c #6186DF",
+"Q@ c #6286E0",
+"R@ c #6284DF",
+"S@ c #6384DF",
+"T@ c #5B7FDE",
+"U@ c #577DDC",
+"V@ c #557BDA",
+"W@ c #5278D8",
+"X@ c #4E76D6",
+"Y@ c #4C72D7",
+"Z@ c #486DD8",
+"`@ c #4469D6",
+" # c #3F62D2",
+".# c #3C60CF",
+"+# c #345ECF",
+"@# c #6086DF",
+"## c #6085E0",
+"$# c #6285DF",
+"%# c #6383DD",
+"&# c #6481DC",
+"*# c #6380DD",
+"=# c #6183DE",
+"-# c #6083DD",
+";# c #6081DC",
+"># c #6080DD",
+",# c #6083DE",
+"'# c #6181DC",
+")# c #6280DD",
+"!# c #577EDB",
+"~# c #557CD7",
+"{# c #4F76D6",
+"]# c #4E74D7",
+"^# c #466CD7",
+"/# c #3B64D6",
+"(# c #4261CD",
+"_# c #375FCE",
+":# c #5A7FD8",
+"<# c #6281DA",
+"[# c #5F81D8",
+"}# c #5C80D8",
+"|# c #557DD7",
+"1# c #577ED8",
+"2# c #567ED7",
+"3# c #587DD8",
+"4# c #577DD8",
+"5# c #587ED8",
+"6# c #567DD8",
+"7# c #5379D9",
+"8# c #5177D7",
+"9# c #4D74D5",
+"0# c #486ED9",
+"a# c #4068D4",
+"b# c #3D65D2",
+"c# c #4361CC",
+"d# c #345ECE",
+"e# c #325DCF",
+"f# c #2C5AD1",
+"g# c #3959C5",
+"h# c #547BD8",
+"i# c #567DD7",
+"j# c #557BD8",
+"k# c #5279D9",
+"l# c #5278D9",
+"m# c #4D74D6",
+"n# c #4B71D8",
+"o# c #496CD8",
+"p# c #4669D7",
+"q# c #3D66D3",
+"r# c #3F62CF",
+"s# c #4260CC",
+"t# c #5379D8",
+"u# c #4E75D4",
+"v# c #4C73D7",
+"w# c #476CD7",
+"x# c #4869D0",
+"y# c #4067D2",
+"z# c #3D64D1",
+"A# c #4261CC",
+"B# c #395FCE",
+"C# c #4F75D3",
+"D# c #5074D2",
+"E# c #5174D1",
+"F# c #5175D1",
+"G# c #4F74D3",
+"H# c #4C73D5",
+"I# c #4C73D4",
+"J# c #4A72D1",
+"K# c #4B70CF",
+"L# c #506CCC",
+"M# c #4D6BCE",
+"N# c #4167D0",
+"O# c #3D65D1",
+"P# c #3F63CF",
+"Q# c #3B5FCD",
+"R# c #3159CD",
+"S# c #4971D0",
+"T# c #4870CF",
+"U# c #4C6FCF",
+"V# c #4E6CCE",
+"W# c #4E6BCE",
+"X# c #4769CF",
+"Y# c #3D66D0",
+"Z# c #3C65D1",
+"`# c #4062CE",
+" $ c #3D5FCD",
+".$ c #365FCF",
+"+$ c #325DCD",
+"@$ c #2D5AD0",
+"#$ c #3859C5",
+"$$ c #355FCF",
+"%$ c #355ECF",
+"&$ c #335ECE",
+"*$ c #305CCD",
+"=$ c #2B5ACE",
+"-$ c #3056C9",
+";$ c #2553C6",
+">$ c #2153C8",
+",$ c #1F4FC7",
+"'$ c #274CC5",
+")$ c #214AC7",
+"!$ c #1C48C8",
+"~$ c #1244C9",
+"{$ c #1043C9",
+"]$ c #1144C9",
+"^$ c #2A45BE",
+"/$ c #2744B5",
+"($ c #1D49C0",
+"_$ c #2B58DE",
+":$ c #002D94",
+"<$ c #2B59CA",
+"[$ c #2A59CA",
+"}$ c #2E57C8",
+"|$ c #3255C6",
+"1$ c #3355C5",
+"2$ c #1C52C8",
+"3$ c #1D50C7",
+"4$ c #234FC6",
+"5$ c #264CC5",
+"6$ c #1D48C7",
+"7$ c #1245C8",
+"8$ c #1F44C2",
+"9$ c #2945BE",
+"0$ c #2A45BD",
+"a$ c #2040BF",
+"b$ c #3156C7",
+"c$ c #3056C7",
+"d$ c #3354C5",
+"e$ c #3355C6",
+"f$ c #3255C5",
+"g$ c #3254C5",
+"h$ c #1952C7",
+"i$ c #1951C8",
+"j$ c #2050C7",
+"k$ c #274CC4",
+"l$ c #244CC6",
+"m$ c #1F49C7",
+"n$ c #1E47C5",
+"o$ c #2045C3",
+"p$ c #1C44BF",
+"q$ c #2045BE",
+"r$ c #2040B8",
+"s$ c #3254C6",
+"t$ c #3055C6",
+"u$ c #2A54C6",
+"v$ c #2353C7",
+"w$ c #3054C5",
+"x$ c #2F55C5",
+"y$ c #2A54C5",
+"z$ c #2553C5",
+"A$ c #2F54C5",
+"B$ c #3155C6",
+"C$ c #2A54C7",
+"D$ c #1A52C8",
+"E$ c #204FC2",
+"F$ c #264DC6",
+"G$ c #234BC5",
+"H$ c #1D48C1",
+"I$ c #1E48BF",
+"J$ c #2646BE",
+"K$ c #2B45BD",
+"L$ c #1E43BE",
+"M$ c #2643BF",
+"N$ c #2243BF",
+"O$ c #3049BC",
+"P$ c #1E50BE",
+"Q$ c #1D50C0",
+"R$ c #1D50BF",
+"S$ c #1852C1",
+"T$ c #1E51C0",
+"U$ c #214FBF",
+"V$ c #2050C0",
+"W$ c #244EBF",
+"X$ c #2151C0",
+"Y$ c #234FBF",
+"Z$ c #2350C0",
+"`$ c #2351C0",
+" % c #244FBF",
+".% c #2250C0",
+"+% c #2051C0",
+"@% c #1E50C0",
+"#% c #244DBE",
+"$% c #274DBF",
+"%% c #244CBF",
+"&% c #1C48C0",
+"*% c #2247BF",
+"=% c #2C44BD",
+"-% c #1C44BE",
+";% c #1444BF",
+">% c #1841BF",
+",% c #1F40BF",
+"'% c #254DBE",
+")% c #224FBE",
+"!% c #224FBF",
+"~% c #234EBF",
+"{% c #254CBD",
+"]% c #244DBD",
+"^% c #244CBD",
+"/% c #264DBE",
+"(% c #264DBD",
+"_% c #214BC0",
+":% c #1D48C0",
+"<% c #2347BF",
+"[% c #2B44BD",
+"}% c #2444BE",
+"|% c #0F42BF",
+"1% c #0641BF",
+"2% c #0F41BF",
+"3% c #1741BE",
+"4% c #1F40BD",
+"5% c #234BBF",
+"6% c #234CBE",
+"7% c #214BBE",
+"8% c #244CBE",
+"9% c #214ABE",
+"0% c #214ABF",
+"a% c #1F48C0",
+"b% c #2746BE",
+"c% c #1F43BE",
+"d% c #0941BE",
+"e% c #0342BA",
+"f% c #0242BC",
+"g% c #1241B8",
+"h% c #1F40B7",
+"i% c #2F41AC",
+"j% c #2644AE",
+"k% c #2D49B4",
+"l% c #2649B6",
+"m% c #2949B7",
+"n% c #2849B5",
+"o% c #2149B8",
+"p% c #1E49B9",
+"q% c #1F48B8",
+"r% c #1F49B9",
+"s% c #2545B6",
+"t% c #2744B7",
+"u% c #2844B7",
+"v% c #2043B8",
+"w% c #1241B7",
+"x% c #1340B8",
+"y% c #0D41B8",
+"z% c #1941B8",
+"A% c #1F40B8",
+"B% c #203FB8",
+"C% c #2549B5",
+"D% c #2648B6",
+"E% c #2547B7",
+"F% c #2248B7",
+"G% c #2048B7",
+"H% c #2346B6",
+"I% c #2146B6",
+"J% c #2247B7",
+"K% c #2148B7",
+"L% c #2743B4",
+"M% c #2643B5",
+"N% c #2542B6",
+"O% c #1D42B7",
+"P% c #0E42B8",
+"Q% c #0C41B8",
+"R% c #1341B8",
+"S% c #1740B8",
+"T% c #1C41B8",
+"U% c #1F40B1",
+"V% c #2644B5",
+"W% c #2544B5",
+"X% c #2544B4",
+"Y% c #2444B5",
+"Z% c #2444B4",
+"`% c #2744B4",
+" & c #2241B7",
+".& c #1D41B8",
+"+& c #0B42B8",
+"@& c #0942B8",
+"#& c #0C42B8",
+"$& c #0F41B8",
+"%& c #1641B8",
+"&& c #2442B5",
+"*& c #2543B3",
+"=& c #2342B2",
+"-& c #2341B4",
+";& c #2141B3",
+">& c #2141B5",
+",& c #2140B5",
+"'& c #2040B5",
+")& c #1C40B7",
+"!& c #1B41B3",
+"~& c #0142B6",
+"{& c #0E41B7",
+"]& c #1141B7",
+"^& c #1440B2",
+"/& c #113FB0",
+"(& c #1440B0",
+"_& c #213EAF",
+":& c #233DAE",
+"<& c #223EAF",
+"[& c #1E40B1",
+"}& c #173EAD",
+"|& c #1440AF",
+"1& c #0D40AF",
+"2& c #0941B0",
+"3& c #0D3FAE",
+"4& c #1B3CAC",
+"5& c #233CAD",
+"6& c #203FB0",
+"7& c #273BAD",
+"8& c #1D40B0",
+"9& c #2040B1",
+"0& c #1E40B0",
+"a& c #1C40B0",
+"b& c #1B3DAC",
+"c& c #143DAC",
+"d& c #193DAD",
+"e& c #1B3DAD",
+"f& c #173DAD",
+"g& c #153DAC",
+"h& c #1C3CAC",
+"i& c #243CAD",
+"j& c #213FB0",
+"k& c #263BAA",
+"l& c #253CAE",
+"m& c #273AAC",
+"n& c #273AAD",
+"o& c #253BAD",
+"p& c #1D3CAC",
+"q& c #243BAD",
+"r& c #1E3CAC",
+"s& c #263BAD",
+"t& c #1A3DAC",
+"u& c #143DAB",
+"v& c #163DAC",
+"w& c #1A3CAC",
+"x& c #1F3CAD",
+"y& c #263BAB",
+"z& c #263BA6",
+"A& c #1E42A4",
+"B& c #2D40A5",
+"C& c #253BA6",
+"D& c #253CA7",
+"E& c #263AA5",
+"F& c #253BA7",
+"G& c #1E3BA6",
+"H& c #193DA6",
+"I& c #173DA5",
+"J& c #143DA6",
+"K& c #1A3DA7",
+"L& c #133DA6",
+"M& c #123DA5",
+"N& c #1A3CA7",
+"O& c #243BA6",
+"P& c #263AA7",
+"Q& c #273BA7",
+"R& c #263AA6",
+"S& c #223BA6",
+"T& c #1D3BA6",
+"U& c #173CA6",
+"V& c #133DA5",
+"W& c #1B3DA6",
+"X& c #193DA5",
+"Y& c #123DA4",
+"Z& c #163CA5",
+"`& c #213CA6",
+" * c #273BA8",
+".* c #263BA7",
+"+* c #253BA5",
+"@* c #263BA5",
+"#* c #1C3BA6",
+"$* c #1B3BA9",
+"%* c #133BA8",
+"&* c #0A3BA7",
+"** c #083AA6",
+"=* c #123CA5",
+"-* c #0839A8",
+";* c #0239A6",
+">* c #123AA8",
+",* c #1F49C8",
+"'* c #2F4DA4",
+")* c #2E4DA3",
+"!* c #384CA4",
+"~* c #3C4DA7",
+"{* c #394EA7",
+"]* c #3B4CA5",
+"^* c #3C52B1",
+"/* c #3551A8",
+"(* c #3759BE",
+"_* c #4161C7",
+":* c #0033A8",
+"<* c #596FA9",
+"[* c #2F4DA3",
+"}* c #2D4BA5",
+"|* c #2E4CA4",
+"1* c #2C4AA5",
+"2* c #2D4BA4",
+"3* c #354DA4",
+"4* c #3A4BA4",
+"5* c #394DA6",
+"6* c #4056AD",
+"7* c #445BBB",
+"8* c #B5B7B4",
+"9* c #1B2F85",
+"0* c #242F79",
+"a* c #B5B5B5",
+"b* c #B5B2B6",
+"c* c #C0C3C3",
+"d* c #E3E3E4",
+"e* c #EBEDEA",
". + @ + # $ % & # $ % & # $ % & # $ % & & * = - ; > , ' ) ! ~ { { { { { { { ] ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / / / ( / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / _ _ / / : / < [ } | | | 1 1 ",
"2 2 2 2 3 2 4 @ 3 2 4 @ 3 2 4 @ 3 2 4 @ # 5 6 7 8 ; > 9 0 a b c d e f { { { ] ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ( ( ( ( ( ( ( ( ( / / / / / / / / / / / / / / / / / _ _ _ _ _ _ _ _ _ _ _ g g _ / / : : : h i } 1 | 1 ",
"j k l m n o p q n o p q r s t u v w x y z A B C D E F G H I J K L M N O P O O Q R S T T T T T T T T T T T T T T T T T T U U U U U U U U U U U U U U U U U U U U U U U U U U U U V V V U U W X : [ Y | | ",
@@ -3618,38 +3618,38 @@ static char * listviewhighcornerright_xpm[] = {
static char * tabmiddle_xpm[] = {
"33 42 32 1",
-" c None",
-". c #CECFEF",
-"+ c #CECBE7",
-"@ c #C6C7E7",
-"# c #C6CBE7",
-"$ c #BDBEDE",
-"% c #BDC3DE",
-"& c #CECBEF",
-"* c #B5B6D6",
-"= c #ADAECE",
-"- c #ADB2CE",
-"; c #BDBAD6",
-"> c #B5BAD6",
-", c #C6C3DE",
-"' c #ADAAC6",
-") c #B5B2CE",
-"! c #B5B6CE",
-"~ c #A5A2BD",
-"{ c #A5A6BD",
-"] c #9C9EB5",
-"^ c #9CA2BD",
-"/ c #ADAEC6",
-"( c #C6C3E7",
-"_ c #9C9AB5",
-": c #A5A6C6",
-"< c #949AAD",
-"[ c #A5AAC6",
-"} c #9496AD",
-"| c #BDBADE",
-"1 c #BDBED6",
-"2 c #9CA2B5",
-"3 c #A5AABD",
+" c None",
+". c #CECFEF",
+"+ c #CECBE7",
+"@ c #C6C7E7",
+"# c #C6CBE7",
+"$ c #BDBEDE",
+"% c #BDC3DE",
+"& c #CECBEF",
+"* c #B5B6D6",
+"= c #ADAECE",
+"- c #ADB2CE",
+"; c #BDBAD6",
+"> c #B5BAD6",
+", c #C6C3DE",
+"' c #ADAAC6",
+") c #B5B2CE",
+"! c #B5B6CE",
+"~ c #A5A2BD",
+"{ c #A5A6BD",
+"] c #9C9EB5",
+"^ c #9CA2BD",
+"/ c #ADAEC6",
+"( c #C6C3E7",
+"_ c #9C9AB5",
+": c #A5A6C6",
+"< c #949AAD",
+"[ c #A5AAC6",
+"} c #9496AD",
+"| c #BDBADE",
+"1 c #BDBED6",
+"2 c #9CA2B5",
+"3 c #A5AABD",
"..........................+@.#.#.",
"........................$@%&#.#..",
"......................**$$@@&#.#.",
@@ -3696,34 +3696,34 @@ static char * tabmiddle_xpm[] = {
static char * tabselectedbeginn_xpm[] = {
"33 39 28 1",
-" c None",
-". c #CECFEF",
-"+ c #EFF3EF",
-"@ c #FFFBFF",
-"# c #F7FBF7",
-"$ c #FFFFFF",
-"% c #EFEFEF",
-"& c #F7F7F7",
-"* c #DEDFDE",
-"= c #E7E7E7",
-"- c #D6D3D6",
-"; c #DEE3DE",
-"> c #EFEBEF",
-", c #F7F3F7",
-"' c #CECBCE",
-") c #CECFCE",
-"! c #D6D7D6",
-"~ c #DEDBDE",
-"{ c #E7EBE7",
-"] c #C6C7C6",
-"^ c #E7E3E7",
-"/ c #BDC3BD",
-"( c #CED3CE",
-"_ c #BDBABD",
-": c #C6C3C6",
-"< c #C6CBC6",
-"[ c #D6DBD6",
-"} c #BDBEBD",
+" c None",
+". c #CECFEF",
+"+ c #EFF3EF",
+"@ c #FFFBFF",
+"# c #F7FBF7",
+"$ c #FFFFFF",
+"% c #EFEFEF",
+"& c #F7F7F7",
+"* c #DEDFDE",
+"= c #E7E7E7",
+"- c #D6D3D6",
+"; c #DEE3DE",
+"> c #EFEBEF",
+", c #F7F3F7",
+"' c #CECBCE",
+") c #CECFCE",
+"! c #D6D7D6",
+"~ c #DEDBDE",
+"{ c #E7EBE7",
+"] c #C6C7C6",
+"^ c #E7E3E7",
+"/ c #BDC3BD",
+"( c #CED3CE",
+"_ c #BDBABD",
+": c #C6C3C6",
+"< c #C6CBC6",
+"[ c #D6DBD6",
+"} c #BDBEBD",
"..........................+@#$#$$",
"........................%%&&@#$#$",
"......................*==%%&&@#$$",
@@ -3767,39 +3767,39 @@ static char * tabselectedbeginn_xpm[] = {
static char * tabselectedend_xpm[] = {
"33 42 33 1",
-" c None",
-". c #FFFFFF",
-"+ c #CECBE7",
-"@ c #C6C7E7",
-"# c #CECFEF",
-"$ c #C6CBE7",
-"% c #BDBEDE",
-"& c #BDC3DE",
-"* c #CECBEF",
-"= c #B5B6D6",
-"- c #ADAECE",
-"; c #ADB2CE",
-"> c #BDBAD6",
-", c #B5BAD6",
-"' c #C6C3DE",
-") c #ADAAC6",
-"! c #B5B2CE",
-"~ c #B5B6CE",
-"{ c #A5A2BD",
-"] c #A5A6BD",
-"^ c #9C9EB5",
-"/ c #9CA2BD",
-"( c #ADAEC6",
-"_ c #C6C3E7",
-": c #9C9AB5",
-"< c #A5A6C6",
-"[ c #949AAD",
-"} c #A5AAC6",
-"| c #9496AD",
-"1 c #BDBADE",
-"2 c #BDBED6",
-"3 c #9CA2B5",
-"4 c #A5AABD",
+" c None",
+". c #FFFFFF",
+"+ c #CECBE7",
+"@ c #C6C7E7",
+"# c #CECFEF",
+"$ c #C6CBE7",
+"% c #BDBEDE",
+"& c #BDC3DE",
+"* c #CECBEF",
+"= c #B5B6D6",
+"- c #ADAECE",
+"; c #ADB2CE",
+"> c #BDBAD6",
+", c #B5BAD6",
+"' c #C6C3DE",
+") c #ADAAC6",
+"! c #B5B2CE",
+"~ c #B5B6CE",
+"{ c #A5A2BD",
+"] c #A5A6BD",
+"^ c #9C9EB5",
+"/ c #9CA2BD",
+"( c #ADAEC6",
+"_ c #C6C3E7",
+": c #9C9AB5",
+"< c #A5A6C6",
+"[ c #949AAD",
+"} c #A5AAC6",
+"| c #9496AD",
+"1 c #BDBADE",
+"2 c #BDBED6",
+"3 c #9CA2B5",
+"4 c #A5AABD",
"..........................+@#$#$#",
"........................%@&*$#$##",
"......................==%%@@*$#$#",
@@ -3846,9 +3846,9 @@ static char * tabselectedend_xpm[] = {
static char * tabend_xpm[] = {
"33 42 3 1",
-" c None",
-". c #CECFEF",
-"+ c #FFFFFF",
+" c None",
+". c #CECFEF",
+"+ c #FFFFFF",
"..........................+++++++",
"........................+++++++++",
"......................+++++++++++",
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index dde705f9b9..9ab8f8f08a 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -252,7 +252,7 @@ void QWindowsStyle::polish(QApplication *app)
d->inactiveGradientCaptionColor = app->palette().dark().color();
d->inactiveCaptionText = app->palette().background().color();
-#if defined(Q_OS_WIN) //fetch native title bar colors
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) //fetch native title bar colors
if(app->desktopSettingsAware()){
DWORD activeCaption = GetSysColor(COLOR_ACTIVECAPTION);
DWORD gradientActiveCaption = GetSysColor(COLOR_GRADIENTACTIVECAPTION);
@@ -413,6 +413,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
#if defined(Q_OS_WIN)
+#ifndef Q_OS_WINRT // There is no title bar in Windows Runtime applications
case PM_TitleBarHeight:
if (widget && (widget->windowType() == Qt::Tool)) {
// MS always use one less than they say
@@ -426,16 +427,17 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
}
break;
+#endif // !Q_OS_WINRT
case PM_ScrollBarExtent:
{
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
NONCLIENTMETRICS ncm;
ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICS, lfMessageFont) + sizeof(LOGFONT);
if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0))
ret = qMax(ncm.iScrollHeight, ncm.iScrollWidth);
else
-#endif
+#endif // !Q_OS_WINCE && !Q_OS_WINRT
ret = QCommonStyle::pixelMetric(pm, opt, widget);
}
break;
@@ -446,6 +448,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
break;
#if defined(Q_OS_WIN)
+#ifndef Q_OS_WINRT // Mdi concept not available for WinRT applications
case PM_MdiSubWindowFrameWidth:
#if defined(Q_OS_WINCE)
ret = GetSystemMetrics(SM_CYDLGFRAME);
@@ -453,7 +456,8 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
ret = GetSystemMetrics(SM_CYFRAME);
#endif
break;
-#endif
+#endif // !Q_OS_WINRT
+#endif // Q_OS_WIN
case PM_ToolBarItemMargin:
ret = 1;
break;
@@ -477,7 +481,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
QPixmap QWindowsStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
const QWidget *widget) const
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
QPixmap desktopIcon;
switch(standardPixmap) {
case SP_DriveCDIcon:
@@ -516,7 +520,7 @@ QPixmap QWindowsStyle::standardPixmap(StandardPixmap standardPixmap, const QStyl
if (!desktopIcon.isNull()) {
return desktopIcon;
}
-#endif
+#endif // Q_OS_WIN && !Q_OS_WINCE && !Q_OS_WINRT
return QCommonStyle::standardPixmap(standardPixmap, opt, widget);
}
@@ -554,7 +558,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
ret = 0;
break;
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) // Option not used on WinRT -> common style
case SH_UnderlineShortcut:
{
ret = 1;
@@ -590,7 +594,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
#endif // QT_NO_ACCESSIBILITY
break;
}
-#endif
+#endif // Q_OS_WIN && !Q_OS_WINRT
#ifndef QT_NO_RUBBERBAND
case SH_RubberBand_Mask:
if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index af379b756e..6c7b71bd74 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -1236,7 +1236,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
case CE_MenuItem:
if (const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
// windows always has a check column, regardless whether we have an icon or not
- int checkcol = 28;
+ int checkcol = 25;
{
SIZE size;
MARGINS margins;
@@ -1244,11 +1244,13 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
MENU_POPUPCHECKBACKGROUND, MBI_HOT);
pGetThemePartSize(theme.handle(), NULL, MENU_POPUPCHECK, 0, NULL,TS_TRUE, &size);
pGetThemeMargins(theme.handle(), NULL, MENU_POPUPCHECK, 0, TMT_CONTENTMARGINS, NULL, &margins);
- checkcol = qMax(menuitem->maxIconWidth, int(6 + size.cx + margins.cxLeftWidth + margins.cxRightWidth));
+ checkcol = qMax(menuitem->maxIconWidth, int(3 + size.cx + margins.cxLeftWidth + margins.cxRightWidth));
}
QRect rect = option->rect;
//draw vertical menu line
+ if (option->direction == Qt::LeftToRight)
+ checkcol += rect.x();
QPoint p1 = QStyle::visualPos(option->direction, menuitem->rect, QPoint(checkcol, rect.top()));
QPoint p2 = QStyle::visualPos(option->direction, menuitem->rect, QPoint(checkcol, rect.bottom()));
QRect gutterRect(p1.x(), p1.y(), 3, p2.y() - p1.y() + 1);
@@ -1340,11 +1342,9 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
painter->setPen(menuitem->palette.buttonText().color());
- QColor discol;
- if (dis) {
- discol = menuitem->palette.text().color();
- painter->setPen(discol);
- }
+ const QColor textColor = menuitem->palette.text().color();
+ if (dis)
+ painter->setPen(textColor);
int xm = windowsItemFrame + checkcol + windowsItemHMargin;
int xpos = menuitem->rect.x() + xm;
@@ -1368,7 +1368,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem)
font.setBold(true);
painter->setFont(font);
- painter->setPen(discol);
+ painter->setPen(textColor);
painter->drawText(vTextRect, text_flags, s.left(t));
painter->restore();
}
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index 79ca0a5bdb..f1a69e6b36 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -505,10 +505,10 @@ QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title
si = style()->standardIcon(QStyle::SP_MessageBoxWarning);
break;
case QSystemTrayIcon::Critical:
- si = style()->standardIcon(QStyle::SP_MessageBoxCritical);
+ si = style()->standardIcon(QStyle::SP_MessageBoxCritical);
break;
case QSystemTrayIcon::Information:
- si = style()->standardIcon(QStyle::SP_MessageBoxInformation);
+ si = style()->standardIcon(QStyle::SP_MessageBoxInformation);
break;
case QSystemTrayIcon::NoIcon:
default:
diff --git a/src/widgets/util/qsystemtrayicon_qpa.cpp b/src/widgets/util/qsystemtrayicon_qpa.cpp
index 3ce89e352d..f98aeaf678 100644
--- a/src/widgets/util/qsystemtrayicon_qpa.cpp
+++ b/src/widgets/util/qsystemtrayicon_qpa.cpp
@@ -99,8 +99,14 @@ void QSystemTrayIconPrivate::updateIcon_sys()
void QSystemTrayIconPrivate::updateMenu_sys()
{
- if (qpa_sys && menu)
+ if (qpa_sys && menu) {
+ if (!menu->platformMenu()) {
+ QPlatformMenu *platformMenu = qpa_sys->createMenu();
+ if (platformMenu)
+ menu->setPlatformMenu(platformMenu);
+ }
qpa_sys->updateMenu(menu->platformMenu());
+ }
}
void QSystemTrayIconPrivate::updateToolTip_sys()
diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri
index 072c736f71..b4bbc5fc30 100644
--- a/src/widgets/util/util.pri
+++ b/src/widgets/util/util.pri
@@ -27,7 +27,7 @@ SOURCES += \
util/qundostack.cpp \
util/qundoview.cpp
-win32:!wince* {
+win32:!wince*:!winrt {
SOURCES += util/qsystemtrayicon_win.cpp
} else:contains(QT_CONFIG, xcb) {
SOURCES += util/qsystemtrayicon_x11.cpp
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index 25369a01b6..92af91b66e 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -396,6 +396,30 @@ bool QAbstractSpinBox::isAccelerated() const
}
/*!
+ \property QAbstractSpinBox::showGroupSeparator
+ \since 5.3
+
+
+ This property holds whether a thousands separator is enabled. By default this
+ property is false.
+*/
+bool QAbstractSpinBox::isGroupSeparatorShown() const
+{
+ Q_D(const QAbstractSpinBox);
+ return d->showGroupSeparator;
+}
+
+void QAbstractSpinBox::setGroupSeparatorShown(bool shown)
+{
+ Q_D(QAbstractSpinBox);
+ if (d->showGroupSeparator == shown)
+ return;
+ d->showGroupSeparator = shown;
+ d->setValue(d->value, EmitIfChanged);
+ updateGeometry();
+}
+
+/*!
\enum QAbstractSpinBox::CorrectionMode
This enum type describes the mode the spinbox will use to correct
@@ -1316,7 +1340,8 @@ QAbstractSpinBoxPrivate::QAbstractSpinBoxPrivate()
cachedState(QValidator::Invalid), pendingEmit(false), readOnly(false), wrapping(false),
ignoreCursorPositionChanged(false), frame(true), accelerate(false), keyboardTracking(true),
cleared(false), ignoreUpdateEdit(false), correctionMode(QAbstractSpinBox::CorrectToPreviousValue),
- acceleration(0), hoverControl(QStyle::SC_None), buttonSymbols(QAbstractSpinBox::UpDownArrows), validator(0)
+ acceleration(0), hoverControl(QStyle::SC_None), buttonSymbols(QAbstractSpinBox::UpDownArrows), validator(0),
+ showGroupSeparator(0)
{
}
@@ -1491,13 +1516,12 @@ void QAbstractSpinBoxPrivate::_q_editorCursorPositionChanged(int oldpos, int new
* (newpos < pos ? -1 : 1)) - newpos + pos
: 0;
- const bool wasBlocked = edit->blockSignals(true);
+ const QSignalBlocker blocker(edit);
if (selSize != 0) {
edit->setSelection(pos - selSize, selSize);
} else {
edit->setCursorPosition(pos);
}
- edit->blockSignals(wasBlocked);
}
ignoreCursorPositionChanged = false;
}
@@ -1697,7 +1721,7 @@ void QAbstractSpinBoxPrivate::updateEdit()
const bool empty = edit->text().isEmpty();
int cursor = edit->cursorPosition();
int selsize = edit->selectedText().size();
- const bool sb = edit->blockSignals(true);
+ const QSignalBlocker blocker(edit);
edit->setText(newText);
if (!specialValue()) {
@@ -1709,7 +1733,6 @@ void QAbstractSpinBoxPrivate::updateEdit()
edit->setCursorPosition(empty ? prefix.size() : cursor);
}
}
- edit->blockSignals(sb);
q->update();
}
diff --git a/src/widgets/widgets/qabstractspinbox.h b/src/widgets/widgets/qabstractspinbox.h
index 4f6aad0cde..7989000cc8 100644
--- a/src/widgets/widgets/qabstractspinbox.h
+++ b/src/widgets/widgets/qabstractspinbox.h
@@ -72,6 +72,7 @@ class Q_WIDGETS_EXPORT QAbstractSpinBox : public QWidget
Q_PROPERTY(CorrectionMode correctionMode READ correctionMode WRITE setCorrectionMode)
Q_PROPERTY(bool acceptableInput READ hasAcceptableInput)
Q_PROPERTY(bool keyboardTracking READ keyboardTracking WRITE setKeyboardTracking)
+ Q_PROPERTY(bool showGroupSeparator READ isGroupSeparatorShown WRITE setGroupSeparatorShown)
public:
explicit QAbstractSpinBox(QWidget *parent = 0);
~QAbstractSpinBox();
@@ -114,6 +115,9 @@ public:
void setAccelerated(bool on);
bool isAccelerated() const;
+ void setGroupSeparatorShown(bool shown);
+ bool isGroupSeparatorShown() const;
+
QSize sizeHint() const;
QSize minimumSizeHint() const;
void interpretText();
diff --git a/src/widgets/widgets/qabstractspinbox_p.h b/src/widgets/widgets/qabstractspinbox_p.h
index 0eeec02abc..da9f1d9757 100644
--- a/src/widgets/widgets/qabstractspinbox_p.h
+++ b/src/widgets/widgets/qabstractspinbox_p.h
@@ -150,6 +150,7 @@ public:
QRect hoverRect;
QAbstractSpinBox::ButtonSymbols buttonSymbols;
QSpinBoxValidator *validator;
+ uint showGroupSeparator : 1;
};
class QSpinBoxValidator : public QValidator
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 2c09f5a8f1..17a6ededfe 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -2608,9 +2608,9 @@ void QComboBox::hidePopup()
Q_D(QComboBox);
if (d->container && d->container->isVisible()) {
#if !defined(QT_NO_EFFECTS)
- d->model->blockSignals(true);
- d->container->itemView()->blockSignals(true);
- d->container->blockSignals(true);
+ QSignalBlocker modelBlocker(d->model);
+ QSignalBlocker viewBlocker(d->container->itemView());
+ QSignalBlocker containerBlocker(d->container);
// Flash selected/triggered item (if any).
if (style()->styleHint(QStyle::SH_Menu_FlashTriggeredItem)) {
QItemSelectionModel *selectionModel = view() ? view()->selectionModel() : 0;
@@ -2646,9 +2646,9 @@ void QComboBox::hidePopup()
#endif // Q_OS_MAC
// Other platform implementations welcome :-)
}
- d->model->blockSignals(false);
- d->container->itemView()->blockSignals(false);
- d->container->blockSignals(false);
+ containerBlocker.unblock();
+ viewBlocker.unblock();
+ modelBlocker.unblock();
if (!didFade)
#endif // QT_NO_EFFECTS
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index a0bbbbf7c7..7a723c5f1f 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -1718,7 +1718,7 @@ void QDateTimeEditPrivate::updateEdit()
if (newText == displayText())
return;
int selsize = edit->selectedText().size();
- const bool sb = edit->blockSignals(true);
+ const QSignalBlocker blocker(edit);
edit->setText(newText);
@@ -1740,7 +1740,6 @@ void QDateTimeEditPrivate::updateEdit()
}
}
- edit->blockSignals(sb);
}
@@ -1871,7 +1870,7 @@ void QDateTimeEditPrivate::clearSection(int index)
{
const QLatin1Char space(' ');
int cursorPos = edit->cursorPosition();
- bool blocked = edit->blockSignals(true);
+ const QSignalBlocker blocker(edit);
QString t = edit->text();
const int pos = sectionPos(index);
if (pos == -1) {
@@ -1883,8 +1882,6 @@ void QDateTimeEditPrivate::clearSection(int index)
edit->setText(t);
edit->setCursorPosition(cursorPos);
QDTEDEBUG << cursorPos;
-
- edit->blockSignals(blocked);
}
@@ -2313,7 +2310,7 @@ void QDateTimeEdit::paintEvent(QPaintEvent *event)
optCombo.init(this);
optCombo.editable = true;
- optCombo.frame = opt.frame;
+ optCombo.frame = opt.frame;
optCombo.subControls = opt.subControls;
optCombo.activeSubControls = opt.activeSubControls;
optCombo.state = opt.state;
@@ -2574,10 +2571,9 @@ void QDateTimeEditPrivate::syncCalendarWidget()
{
Q_Q(QDateTimeEdit);
if (monthCalendar) {
- const bool sb = monthCalendar->blockSignals(true);
+ const QSignalBlocker blocker(monthCalendar);
monthCalendar->setDateRange(q->minimumDate(), q->maximumDate());
monthCalendar->setDate(q->date());
- monthCalendar->blockSignals(sb);
}
}
diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp
index 6b183d3759..3acd4f0701 100644
--- a/src/widgets/widgets/qdialogbuttonbox.cpp
+++ b/src/widgets/widgets/qdialogbuttonbox.cpp
@@ -46,7 +46,9 @@
#include <QtWidgets/qdialog.h>
#include <QtWidgets/qapplication.h>
#include <private/qwidget_p.h>
+#include <private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformdialoghelper.h>
+#include <QtGui/qpa/qplatformtheme.h>
#include <QtWidgets/qaction.h>
#include "qdialogbuttonbox.h"
@@ -148,77 +150,6 @@ QT_BEGIN_NAMESPACE
\sa QMessageBox, QPushButton, QDialog
*/
-enum {
- AcceptRole = QDialogButtonBox::AcceptRole,
- RejectRole = QDialogButtonBox::RejectRole,
- DestructiveRole = QDialogButtonBox::DestructiveRole,
- ActionRole = QDialogButtonBox::ActionRole,
- HelpRole = QDialogButtonBox::HelpRole,
- YesRole = QDialogButtonBox::YesRole,
- NoRole = QDialogButtonBox::NoRole,
- ApplyRole = QDialogButtonBox::ApplyRole,
- ResetRole = QDialogButtonBox::ResetRole,
-
- AlternateRole = 0x10000000,
- Stretch = 0x20000000,
- EOL = 0x40000000,
- Reverse = 0x80000000
-};
-
-static QDialogButtonBox::ButtonRole roleFor(QDialogButtonBox::StandardButton button)
-{
- return static_cast<QDialogButtonBox::ButtonRole>(QMessageDialogOptions::buttonRole(
- static_cast<QMessageDialogOptions::StandardButton>(button)));
-}
-
-static const uint layouts[2][5][14] =
-{
- // Qt::Horizontal
- {
- // WinLayout
- { ResetRole, Stretch, YesRole, AcceptRole, AlternateRole, DestructiveRole, NoRole, ActionRole, RejectRole, ApplyRole,
- HelpRole, EOL, EOL, EOL },
-
- // MacLayout
- { HelpRole, ResetRole, ApplyRole, ActionRole, Stretch, DestructiveRole | Reverse,
- AlternateRole | Reverse, RejectRole | Reverse, AcceptRole | Reverse, NoRole | Reverse, YesRole | Reverse, EOL, EOL },
-
- // KdeLayout
- { HelpRole, ResetRole, Stretch, YesRole, NoRole, ActionRole, AcceptRole, AlternateRole,
- ApplyRole, DestructiveRole, RejectRole, EOL },
-
- // GnomeLayout
- { HelpRole, ResetRole, Stretch, ActionRole, ApplyRole | Reverse, DestructiveRole | Reverse,
- AlternateRole | Reverse, RejectRole | Reverse, AcceptRole | Reverse, NoRole | Reverse, YesRole | Reverse, EOL },
-
- // Mac modeless
- { ResetRole, ApplyRole, ActionRole, Stretch, HelpRole, EOL, EOL, EOL, EOL, EOL, EOL, EOL, EOL, EOL }
- },
-
- // Qt::Vertical
- {
- // WinLayout
- { ActionRole, YesRole, AcceptRole, AlternateRole, DestructiveRole, NoRole, RejectRole, ApplyRole, ResetRole,
- HelpRole, Stretch, EOL, EOL, EOL },
-
- // MacLayout
- { YesRole, NoRole, AcceptRole, RejectRole, AlternateRole, DestructiveRole, Stretch, ActionRole, ApplyRole,
- ResetRole, HelpRole, EOL, EOL },
-
- // KdeLayout
- { AcceptRole, AlternateRole, ApplyRole, ActionRole, YesRole, NoRole, Stretch, ResetRole,
- DestructiveRole, RejectRole, HelpRole, EOL },
-
- // GnomeLayout
- { YesRole, NoRole, AcceptRole, RejectRole, AlternateRole, DestructiveRole, ApplyRole, ActionRole, Stretch,
- ResetRole, HelpRole, EOL, EOL, EOL },
-
- // Mac modeless
- { ActionRole, ApplyRole, ResetRole, Stretch, HelpRole, EOL, EOL, EOL, EOL, EOL, EOL, EOL, EOL, EOL }
- }
-};
-
-
class QDialogButtonBoxPrivate : public QWidgetPrivate
{
Q_DECLARE_PUBLIC(QDialogButtonBox)
@@ -246,7 +177,6 @@ public:
void _q_handleButtonClicked();
void addButtonsToLayout(const QList<QAbstractButton *> &buttonList, bool reverse);
void retranslateStrings();
- const char *standardButtonText(QDialogButtonBox::StandardButton sbutton) const;
};
QDialogButtonBoxPrivate::QDialogButtonBoxPrivate(Qt::Orientation orient)
@@ -322,7 +252,8 @@ void QDialogButtonBoxPrivate::layoutButtons()
int tmpPolicy = layoutPolicy;
static const int M = 5;
- static const int ModalRoles[M] = { AcceptRole, RejectRole, DestructiveRole, YesRole, NoRole };
+ static const int ModalRoles[M] = { QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::RejectRole,
+ QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::YesRole, QPlatformDialogHelper::NoRole };
if (tmpPolicy == QDialogButtonBox::MacLayout) {
bool hasModalButton = false;
for (int i = 0; i < M; ++i) {
@@ -335,23 +266,24 @@ void QDialogButtonBoxPrivate::layoutButtons()
tmpPolicy = 4; // Mac modeless
}
- const uint *currentLayout = layouts[orientation == Qt::Vertical][tmpPolicy];
+ const int *currentLayout = QPlatformDialogHelper::buttonLayout(
+ orientation, static_cast<QPlatformDialogHelper::ButtonLayout>(tmpPolicy));
if (center)
buttonLayout->addStretch();
- QList<QAbstractButton *> acceptRoleList = buttonLists[AcceptRole];
+ QList<QAbstractButton *> acceptRoleList = buttonLists[QPlatformDialogHelper::AcceptRole];
- while (*currentLayout != EOL) {
- int role = (*currentLayout & ~Reverse);
- bool reverse = (*currentLayout & Reverse);
+ while (*currentLayout != QPlatformDialogHelper::EOL) {
+ int role = (*currentLayout & ~QPlatformDialogHelper::Reverse);
+ bool reverse = (*currentLayout & QPlatformDialogHelper::Reverse);
switch (role) {
- case Stretch:
+ case QPlatformDialogHelper::Stretch:
if (!center)
buttonLayout->addStretch();
break;
- case AcceptRole: {
+ case QPlatformDialogHelper::AcceptRole: {
if (acceptRoleList.isEmpty())
break;
// Only the first one
@@ -360,7 +292,7 @@ void QDialogButtonBoxPrivate::layoutButtons()
button->show();
}
break;
- case AlternateRole:
+ case QPlatformDialogHelper::AlternateRole:
{
if (acceptRoleList.size() < 2)
break;
@@ -369,7 +301,7 @@ void QDialogButtonBoxPrivate::layoutButtons()
addButtonsToLayout(list, reverse);
}
break;
- case DestructiveRole:
+ case QPlatformDialogHelper::DestructiveRole:
{
const QList<QAbstractButton *> &list = buttonLists[role];
@@ -395,13 +327,13 @@ void QDialogButtonBoxPrivate::layoutButtons()
buttonLayout->addSpacing(MacGap);
}
break;
- case RejectRole:
- case ActionRole:
- case HelpRole:
- case YesRole:
- case NoRole:
- case ApplyRole:
- case ResetRole:
+ case QPlatformDialogHelper::RejectRole:
+ case QPlatformDialogHelper::ActionRole:
+ case QPlatformDialogHelper::HelpRole:
+ case QPlatformDialogHelper::YesRole:
+ case QPlatformDialogHelper::NoRole:
+ case QPlatformDialogHelper::ApplyRole:
+ case QPlatformDialogHelper::ResetRole:
addButtonsToLayout(buttonLists[role], reverse);
}
++currentLayout;
@@ -428,7 +360,6 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut
bool doLayout)
{
Q_Q(QDialogButtonBox);
- const char *buttonText = 0;
int icon = 0;
switch (sbutton) {
@@ -477,17 +408,16 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut
return 0;
;
}
- buttonText = standardButtonText(sbutton);
-
- QPushButton *button = new QPushButton(QDialogButtonBox::tr(buttonText), q);
+ QPushButton *button = new QPushButton(QGuiApplicationPrivate::platformTheme()->standardButtonText(sbutton), q);
QStyle *style = q->style();
if (style->styleHint(QStyle::SH_DialogButtonBox_ButtonsHaveIcons, 0, q) && icon != 0)
button->setIcon(style->standardIcon(QStyle::StandardPixmap(icon), 0, q));
if (style != QApplication::style()) // Propagate style
button->setStyle(style);
standardButtonHash.insert(button, sbutton);
- if (roleFor(sbutton) != QDialogButtonBox::InvalidRole) {
- addButton(button, roleFor(sbutton), doLayout);
+ QPlatformDialogHelper::ButtonRole role = QPlatformDialogHelper::buttonRole(static_cast<QPlatformDialogHelper::StandardButton>(sbutton));
+ if (role != QPlatformDialogHelper::InvalidRole) {
+ addButton(button, static_cast<QDialogButtonBox::ButtonRole>(role), doLayout);
} else {
qWarning("QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
}
@@ -525,87 +455,15 @@ void QDialogButtonBoxPrivate::createStandardButtons(QDialogButtonBox::StandardBu
layoutButtons();
}
-const char *QDialogButtonBoxPrivate::standardButtonText(QDialogButtonBox::StandardButton sbutton) const
-{
- const char *buttonText = 0;
- bool gnomeLayout = (layoutPolicy == QDialogButtonBox::GnomeLayout);
- switch (sbutton) {
- case QDialogButtonBox::Ok:
- buttonText = gnomeLayout ? QT_TRANSLATE_NOOP("QDialogButtonBox", "&OK") : QT_TRANSLATE_NOOP("QDialogButtonBox", "OK");
- break;
- case QDialogButtonBox::Save:
- buttonText = gnomeLayout ? QT_TRANSLATE_NOOP("QDialogButtonBox", "&Save") : QT_TRANSLATE_NOOP("QDialogButtonBox", "Save");
- break;
- case QDialogButtonBox::Open:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Open");
- break;
- case QDialogButtonBox::Cancel:
- buttonText = gnomeLayout ? QT_TRANSLATE_NOOP("QDialogButtonBox", "&Cancel") : QT_TRANSLATE_NOOP("QDialogButtonBox", "Cancel");
- break;
- case QDialogButtonBox::Close:
- buttonText = gnomeLayout ? QT_TRANSLATE_NOOP("QDialogButtonBox", "&Close") : QT_TRANSLATE_NOOP("QDialogButtonBox", "Close");
- break;
- case QDialogButtonBox::Apply:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Apply");
- break;
- case QDialogButtonBox::Reset:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Reset");
- break;
- case QDialogButtonBox::Help:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Help");
- break;
- case QDialogButtonBox::Discard:
- if (layoutPolicy == QDialogButtonBox::MacLayout)
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Don't Save");
- else if (layoutPolicy == QDialogButtonBox::GnomeLayout)
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Close without Saving");
- else
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Discard");
- break;
- case QDialogButtonBox::Yes:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "&Yes");
- break;
- case QDialogButtonBox::YesToAll:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Yes to &All");
- break;
- case QDialogButtonBox::No:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "&No");
- break;
- case QDialogButtonBox::NoToAll:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "N&o to All");
- break;
- case QDialogButtonBox::SaveAll:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Save All");
- break;
- case QDialogButtonBox::Abort:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Abort");
- break;
- case QDialogButtonBox::Retry:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Retry");
- break;
- case QDialogButtonBox::Ignore:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Ignore");
- break;
- case QDialogButtonBox::RestoreDefaults:
- buttonText = QT_TRANSLATE_NOOP("QDialogButtonBox", "Restore Defaults");
- break;
- case QDialogButtonBox::NoButton:
- ;
- } // switch
- return buttonText;
-}
-
void QDialogButtonBoxPrivate::retranslateStrings()
{
- const char *buttonText = 0;
- QHash<QPushButton *, QDialogButtonBox::StandardButton>::iterator it = standardButtonHash.begin();
- while (it != standardButtonHash.end()) {
- buttonText = standardButtonText(it.value());
- if (buttonText) {
- QPushButton *button = it.key();
- button->setText(QDialogButtonBox::tr(buttonText));
- }
- ++it;
+ typedef QHash<QPushButton *, QDialogButtonBox::StandardButton>::iterator Iterator;
+
+ const Iterator end = standardButtonHash.end();
+ for (Iterator it = standardButtonHash.begin(); it != end; ++it) {
+ const QString text = QGuiApplicationPrivate::platformTheme()->standardButtonText(it.value());
+ if (!text.isEmpty())
+ it.key()->setText(text);
}
}
@@ -1008,15 +866,15 @@ void QDialogButtonBoxPrivate::_q_handleButtonClicked()
emit q->clicked(button);
switch (q->buttonRole(button)) {
- case AcceptRole:
- case YesRole:
+ case QPlatformDialogHelper::AcceptRole:
+ case QPlatformDialogHelper::YesRole:
emit q->accepted();
break;
- case RejectRole:
- case NoRole:
+ case QPlatformDialogHelper::RejectRole:
+ case QPlatformDialogHelper::NoRole:
emit q->rejected();
break;
- case HelpRole:
+ case QPlatformDialogHelper::HelpRole:
emit q->helpRequested();
break;
default:
diff --git a/src/widgets/widgets/qdialogbuttonbox.h b/src/widgets/widgets/qdialogbuttonbox.h
index d8e1a997d4..5cd94f88b0 100644
--- a/src/widgets/widgets/qdialogbuttonbox.h
+++ b/src/widgets/widgets/qdialogbuttonbox.h
@@ -61,7 +61,7 @@ class Q_WIDGETS_EXPORT QDialogButtonBox : public QWidget
public:
enum ButtonRole {
- // keep this in sync with QMessageBox::ButtonRole
+ // keep this in sync with QMessageBox::ButtonRole and QPlatformDialogHelper::ButtonRole
InvalidRole = -1,
AcceptRole,
RejectRole,
@@ -77,7 +77,7 @@ public:
};
enum StandardButton {
- // keep this in sync with QMessageBox::StandardButton
+ // keep this in sync with QMessageBox::StandardButton and QPlatformDialogHelper::StandardButton
NoButton = 0x00000000,
Ok = 0x00000400,
Save = 0x00000800,
@@ -107,6 +107,7 @@ public:
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
enum ButtonLayout {
+ // keep this in sync with QMessageBox::ButtonLayout and QPlatformDialogHelper::ButtonLayout
WinLayout,
MacLayout,
KdeLayout,
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp
index 72a463b30b..066b3c7a86 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -1940,9 +1940,9 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*>
} else {
QDockAreaLayoutItem item(new QDockWidgetItem(widget));
if (flags & StateFlagFloating) {
- bool drawer = false;
+ bool drawer = false;
#ifdef Q_WS_MAC // drawer support
- extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp
+ extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp
extern bool qt_mac_set_drawer_preferred_edge(QWidget *, Qt::DockWidgetArea); //qwidget_mac.cpp
drawer = qt_mac_is_macdrawer(widget);
#endif
@@ -1988,10 +1988,10 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*>
emit widget->dockLocationChanged(toDockWidgetArea(dockPos));
}
}
- if (testing) {
- //was it is not really added to the layout, we need to delete the object here
- delete item.widgetItem;
- }
+ if (testing) {
+ //was it is not really added to the layout, we need to delete the object here
+ delete item.widgetItem;
+ }
}
} else if (nextMarker == SequenceMarker) {
int dummy;
@@ -2096,7 +2096,7 @@ bool QDockAreaLayoutInfo::updateTabBar() const
that->tabBar->setDrawBase(true);
}
- bool blocked = tabBar->blockSignals(true);
+ const QSignalBlocker blocker(tabBar);
bool gap = false;
int tab_idx = 0;
@@ -2147,8 +2147,6 @@ bool QDockAreaLayoutInfo::updateTabBar() const
tabBar->removeTab(tab_idx);
}
- tabBar->blockSignals(blocked);
-
//returns if the tabbar is visible or not
return ( (gap ? 1 : 0) + tabBar->count()) > 1;
}
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index 46929397a0..ad9481a928 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -667,6 +667,7 @@ void QDockWidgetPrivate::updateButtons()
button->setIcon(q->style()->standardIcon(QStyle::SP_TitleBarNormalButton, &opt, q));
button->setVisible(canFloat && !hideButtons);
#ifndef QT_NO_ACCESSIBILITY
+ //: Accessible name for button undocking a dock widget (floating state)
button->setAccessibleName(QDockWidget::tr("Float"));
button->setAccessibleDescription(QDockWidget::tr("Undocks and re-attaches the dock widget"));
#endif
@@ -675,6 +676,7 @@ void QDockWidgetPrivate::updateButtons()
button->setIcon(q->style()->standardIcon(QStyle::SP_TitleBarCloseButton, &opt, q));
button->setVisible(canClose && !hideButtons);
#ifndef QT_NO_ACCESSIBILITY
+ //: Accessible name for button closing a dock widget
button->setAccessibleName(QDockWidget::tr("Close"));
button->setAccessibleDescription(QDockWidget::tr("Closes the dock widget"));
#endif
@@ -1104,8 +1106,8 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
\enum QDockWidget::DockWidgetFeature
\value DockWidgetClosable The dock widget can be closed. On some systems the dock
- widget always has a close button when it's floating
- (for example on MacOS 10.5).
+ widget always has a close button when it's floating
+ (for example on MacOS 10.5).
\value DockWidgetMovable The dock widget can be moved between docks
by the user.
\value DockWidgetFloatable The dock widget can be detached from the
diff --git a/src/widgets/widgets/qdockwidget_p.h b/src/widgets/widgets/qdockwidget_p.h
index 800f523825..f7cd8c0039 100644
--- a/src/widgets/widgets/qdockwidget_p.h
+++ b/src/widgets/widgets/qdockwidget_p.h
@@ -84,7 +84,7 @@ class QDockWidgetPrivate : public QWidgetPrivate
public:
inline QDockWidgetPrivate()
- : QWidgetPrivate(), state(0),
+ : QWidgetPrivate(), state(0),
features(QDockWidget::DockWidgetClosable
| QDockWidget::DockWidgetMovable
| QDockWidget::DockWidgetFloatable),
diff --git a/src/widgets/widgets/qeffects.cpp b/src/widgets/widgets/qeffects.cpp
index 83060bb571..cd8ae81ace 100644
--- a/src/widgets/widgets/qeffects.cpp
+++ b/src/widgets/widgets/qeffects.cpp
@@ -189,32 +189,32 @@ bool QAlphaWidget::eventFilter(QObject *o, QEvent *e)
{
switch (e->type()) {
case QEvent::Move:
- if (o != widget)
- break;
- move(widget->geometry().x(),widget->geometry().y());
- update();
- break;
+ if (o != widget)
+ break;
+ move(widget->geometry().x(),widget->geometry().y());
+ update();
+ break;
case QEvent::Hide:
case QEvent::Close:
- if (o != widget)
- break;
+ if (o != widget)
+ break;
case QEvent::MouseButtonPress:
- case QEvent::MouseButtonDblClick:
- showWidget = false;
- render();
- break;
+ case QEvent::MouseButtonDblClick:
+ showWidget = false;
+ render();
+ break;
case QEvent::KeyPress: {
- QKeyEvent *ke = (QKeyEvent*)e;
- if (ke->key() == Qt::Key_Escape) {
- showWidget = false;
- } else {
- duration = 0;
- }
- render();
- break;
- }
+ QKeyEvent *ke = (QKeyEvent*)e;
+ if (ke->key() == Qt::Key_Escape) {
+ showWidget = false;
+ } else {
+ duration = 0;
+ }
+ render();
+ break;
+ }
default:
- break;
+ break;
}
return QWidget::eventFilter(o, e);
}
diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp
index 0b0efa2bdf..2bbf3730db 100644
--- a/src/widgets/widgets/qfontcombobox.cpp
+++ b/src/widgets/widgets/qfontcombobox.cpp
@@ -346,9 +346,10 @@ void QFontComboBoxPrivate::_q_updateModel()
//this prevents the current index from changing
//it will be updated just after this
///TODO: we should finda way to avoid blocking signals and have a real update of the model
- const bool old = m->blockSignals(true);
- m->setStringList(list);
- m->blockSignals(old);
+ {
+ const QSignalBlocker blocker(m);
+ m->setStringList(list);
+ }
if (list.isEmpty()) {
if (currentFont != QFont()) {
diff --git a/src/widgets/widgets/qlcdnumber.h b/src/widgets/widgets/qlcdnumber.h
index 3dde1527f2..ba7b2d8494 100644
--- a/src/widgets/widgets/qlcdnumber.h
+++ b/src/widgets/widgets/qlcdnumber.h
@@ -43,7 +43,6 @@
#define QLCDNUMBER_H
#include <QtWidgets/qframe.h>
-#include <QtCore/qbitarray.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index df5ae0171c..1833dce40b 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -333,7 +333,12 @@ void QLineEdit::setText(const QString& text)
\brief the line edit's placeholder text
Setting this property makes the line edit display a grayed-out
- placeholder text as long as the text() is empty.
+ placeholder text as long as the line edit is empty.
+
+ Normally, an empty line edit shows the placeholder text even
+ when it has focus. However, if the content is horizontally
+ centered, the placeholder text is not displayed under
+ the cursor when the line edit has focus.
By default, this property contains an empty string.
@@ -350,7 +355,7 @@ void QLineEdit::setPlaceholderText(const QString& placeholderText)
Q_D(QLineEdit);
if (d->placeholderText != placeholderText) {
d->placeholderText = placeholderText;
- if (d->control->text().isEmpty())
+ if (d->shouldShowPlaceholderText())
update();
}
}
@@ -1895,7 +1900,7 @@ void QLineEdit::paintEvent(QPaintEvent *)
int minLB = qMax(0, -fm.minLeftBearing());
int minRB = qMax(0, -fm.minRightBearing());
- if (d->control->text().isEmpty() && d->control->preeditAreaText().isEmpty()) {
+ if (d->shouldShowPlaceholderText()) {
if (!d->placeholderText.isEmpty()) {
QColor col = pal.text().color();
col.setAlpha(128);
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index 181a23449b..aa5b57a920 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -148,6 +148,11 @@ public:
{
return !control->isReadOnly();
}
+ inline bool shouldShowPlaceholderText() const
+ {
+ return control->text().isEmpty() && control->preeditAreaText().isEmpty()
+ && !((alignment & Qt::AlignHCenter) && q_func()->hasFocus());
+ }
static inline QLineEditPrivate *get(QLineEdit *lineEdit) {
return lineEdit->d_func();
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp
index 349d8c3423..600d9b536f 100644
--- a/src/widgets/widgets/qmdiarea.cpp
+++ b/src/widgets/widgets/qmdiarea.cpp
@@ -1115,10 +1115,9 @@ void QMdiAreaPrivate::updateActiveWindow(int removedIndex, bool activeRemoved)
#ifndef QT_NO_TABBAR
if (tabBar && removedIndex >= 0) {
- tabBar->blockSignals(true);
+ const QSignalBlocker blocker(tabBar);
tabBar->removeTab(removedIndex);
updateTabBarGeometry();
- tabBar->blockSignals(false);
}
#endif
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index 8e1dcbee18..94674319bc 100644
--- a/src/widgets/widgets/qmdisubwindow.cpp
+++ b/src/widgets/widgets/qmdisubwindow.cpp
@@ -2057,13 +2057,13 @@ void QMdiSubWindowPrivate::restoreFocus()
/*!
\internal
- ### Please add QEvent::WindowFlagsChange event
*/
void QMdiSubWindowPrivate::setWindowFlags(Qt::WindowFlags windowFlags)
{
Q_Q(QMdiSubWindow);
+
if (!parent) {
- q->setWindowFlags(windowFlags);
+ QWidgetPrivate::setWindowFlags(windowFlags);
return;
}
@@ -2097,7 +2097,7 @@ void QMdiSubWindowPrivate::setWindowFlags(Qt::WindowFlags windowFlags)
delete sizeGrip;
#endif
- q->setWindowFlags(windowFlags);
+ QWidgetPrivate::setWindowFlags(windowFlags);
updateGeometryConstraints();
updateActions();
QSize currentSize = q->size();
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 3a4fd449c8..edfeb840b1 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -153,13 +153,48 @@ void QMenuPrivate::init()
scroll->scrollFlags = QMenuPrivate::QMenuScroller::ScrollNone;
}
- platformMenu = QGuiApplicationPrivate::platformTheme()->createPlatformMenu();
+ setPlatformMenu(QGuiApplicationPrivate::platformTheme()->createPlatformMenu());
+}
+
+void QMenuPrivate::setPlatformMenu(QPlatformMenu *menu)
+{
+ Q_Q(QMenu);
+ if (!platformMenu.isNull() && !platformMenu->parent())
+ delete platformMenu.data();
+
+ platformMenu = menu;
if (!platformMenu.isNull()) {
QObject::connect(platformMenu, SIGNAL(aboutToShow()), q, SIGNAL(aboutToShow()));
QObject::connect(platformMenu, SIGNAL(aboutToHide()), q, SIGNAL(aboutToHide()));
}
}
+// forward declare function
+static void copyActionToPlatformItem(const QAction *action, QPlatformMenuItem* item);
+
+void QMenuPrivate::syncPlatformMenu()
+{
+ Q_Q(QMenu);
+ if (platformMenu.isNull())
+ return;
+
+ QPlatformMenuItem *beforeItem = Q_NULLPTR;
+ QListIterator<QAction*> it(q->actions());
+ it.toBack();
+ while (it.hasPrevious()) {
+ QPlatformMenuItem *menuItem = platformMenu->createMenuItem();
+ QAction *action = it.previous();
+ menuItem->setTag(reinterpret_cast<quintptr>(action));
+ QObject::connect(menuItem, SIGNAL(activated()), action, SLOT(trigger()));
+ QObject::connect(menuItem, SIGNAL(hovered()), action, SIGNAL(hovered()));
+ copyActionToPlatformItem(action, menuItem);
+ platformMenu->insertMenuItem(menuItem, beforeItem);
+ beforeItem = menuItem;
+ }
+ platformMenu->syncSeparatorsCollapsible(collapsibleSeparators);
+ platformMenu->setEnabled(q->isEnabled());
+}
+
int QMenuPrivate::scrollerHeight() const
{
Q_Q(const QMenu);
@@ -435,7 +470,7 @@ void QMenuPrivate::hideMenu(QMenu *menu)
if (!menu)
return;
#if !defined(QT_NO_EFFECTS)
- menu->blockSignals(true);
+ QSignalBlocker blocker(menu);
aboutToHide = true;
// Flash item which is about to trigger (if any).
if (menu->style()->styleHint(QStyle::SH_Menu_FlashTriggeredItem)
@@ -455,7 +490,7 @@ void QMenuPrivate::hideMenu(QMenu *menu)
}
aboutToHide = false;
- menu->blockSignals(false);
+ blocker.unblock();
#endif // QT_NO_EFFECTS
menu->close();
}
@@ -2976,8 +3011,7 @@ void QMenu::actionEvent(QActionEvent *e)
if (!d->platformMenu.isNull()) {
if (e->type() == QEvent::ActionAdded) {
- QPlatformMenuItem *menuItem =
- QGuiApplicationPrivate::platformTheme()->createPlatformMenuItem();
+ QPlatformMenuItem *menuItem = d->platformMenu->createMenuItem();
menuItem->setTag(reinterpret_cast<quintptr>(e->action()));
QObject::connect(menuItem, SIGNAL(activated()), e->action(), SLOT(trigger()));
QObject::connect(menuItem, SIGNAL(hovered()), e->action(), SIGNAL(hovered()));
@@ -3154,6 +3188,14 @@ QPlatformMenu *QMenu::platformMenu()
return d_func()->platformMenu;
}
+/*!\internal
+*/
+void QMenu::setPlatformMenu(QPlatformMenu *platformMenu)
+{
+ d_func()->setPlatformMenu(platformMenu);
+ d_func()->syncPlatformMenu();
+}
+
/*!
\property QMenu::separatorsCollapsible
\since 4.2
diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h
index 7a128e871c..8a8eaf3bae 100644
--- a/src/widgets/widgets/qmenu.h
+++ b/src/widgets/widgets/qmenu.h
@@ -140,6 +140,7 @@ public:
void setNoReplayFor(QWidget *widget);
QPlatformMenu *platformMenu();
+ void setPlatformMenu(QPlatformMenu *platformMenu);
#ifdef Q_OS_WINCE
HMENU wceMenu();
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index 71a3fca237..afd34a5c47 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -108,6 +108,8 @@ public:
#endif
}
void init();
+ void setPlatformMenu(QPlatformMenu *menu);
+ void syncPlatformMenu();
static QMenuPrivate *get(QMenu *m) { return m->d_func(); }
int scrollerHeight() const;
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 01db2bda7a..03ab490823 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -1833,9 +1833,9 @@ void QMenuBar::setNativeMenuBar(bool nativeMenuBar)
d->platformMenuBar = QGuiApplicationPrivate::platformTheme()->createPlatformMenuBar();
}
- updateGeometry();
- if (!d->nativeMenuBar && parentWidget())
- setVisible(true);
+ updateGeometry();
+ if (!d->nativeMenuBar && parentWidget())
+ setVisible(true);
}
}
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 5f055d436a..d51dce4765 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -347,7 +347,7 @@ void QPlainTextDocumentLayout::documentChanged(int from, int /*charsRemoved*/, i
}
if (!d->blockUpdate)
- emit update(QRectF(0., -doc->documentMargin(), 1000000000., 1000000000.)); // optimization potential
+ emit update(QRectF(0., -doc->documentMargin(), 1000000000., 1000000000.)); // optimization potential
}
@@ -639,9 +639,10 @@ void QPlainTextEditPrivate::setTopBlock(int blockNumber, int lineNumber, int dx)
lineNumber = maxTopLine - block.firstLineNumber();
}
- bool vbarSignalsBlocked = vbar->blockSignals(true);
- vbar->setValue(newTopLine);
- vbar->blockSignals(vbarSignalsBlocked);
+ {
+ const QSignalBlocker blocker(vbar);
+ vbar->setValue(newTopLine);
+ }
if (!dx && blockNumber == control->topBlock && lineNumber == topLine)
return;
@@ -657,9 +658,10 @@ void QPlainTextEditPrivate::setTopBlock(int blockNumber, int lineNumber, int dx)
control->topBlock = blockNumber;
topLine = lineNumber;
- bool vbarSignalsBlocked = vbar->blockSignals(true);
- vbar->setValue(block.firstLineNumber() + lineNumber);
- vbar->blockSignals(vbarSignalsBlocked);
+ {
+ const QSignalBlocker blocker(vbar);
+ vbar->setValue(block.firstLineNumber() + lineNumber);
+ }
if (dx || dy) {
viewport->scroll(q->isRightToLeft() ? -dx : dx, dy);
@@ -1007,9 +1009,11 @@ void QPlainTextEditPrivate::_q_adjustScrollbars()
QTextBlock firstVisibleBlock = q->firstVisibleBlock();
if (firstVisibleBlock.isValid())
visualTopLine = firstVisibleBlock.firstLineNumber() + topLine;
- bool vbarSignalsBlocked = vbar->blockSignals(true);
- vbar->setValue(visualTopLine);
- vbar->blockSignals(vbarSignalsBlocked);
+
+ {
+ const QSignalBlocker blocker(vbar);
+ vbar->setValue(visualTopLine);
+ }
hbar->setRange(0, (int)documentSize.width() - viewport->width());
hbar->setPageStep(viewport->width());
@@ -1317,6 +1321,35 @@ QTextDocument *QPlainTextEdit::document() const
}
/*!
+ \since 5.3
+
+ \property QPlainTextEdit::placeholderText
+ \brief the editor placeholder text
+
+ Setting this property makes the editor display a grayed-out
+ placeholder text as long as the document() is empty.
+
+ By default, this property contains an empty string.
+
+ \sa document()
+*/
+void QPlainTextEdit::setPlaceholderText(const QString &placeholderText)
+{
+ Q_D(QPlainTextEdit);
+ if (d->placeholderText != placeholderText) {
+ d->placeholderText = placeholderText;
+ if (d->control->document()->isEmpty())
+ d->viewport->update();
+ }
+}
+
+QString QPlainTextEdit::placeholderText() const
+{
+ Q_D(const QPlainTextEdit);
+ return d->placeholderText;
+}
+
+/*!
Sets the visible \a cursor.
*/
void QPlainTextEdit::setTextCursor(const QTextCursor &cursor)
@@ -1942,7 +1975,16 @@ void QPlainTextEdit::paintEvent(QPaintEvent *e)
}
- layout->draw(&painter, offset, selections, er);
+ if (!placeholderText().isEmpty() && document()->isEmpty()) {
+ Q_D(QPlainTextEdit);
+ QColor col = d->control->palette().text().color();
+ col.setAlpha(128);
+ painter.setPen(col);
+ const int margin = int(document()->documentMargin());
+ painter.drawText(r.adjusted(margin, 0, 0, 0), Qt::AlignTop | Qt::TextWordWrap, placeholderText());
+ } else {
+ layout->draw(&painter, offset, selections, er);
+ }
if ((drawCursor && !drawCursorAsBlock)
|| (editable && context.cursorPosition < -1
&& !layout->preeditAreaText().isEmpty())) {
@@ -2150,7 +2192,7 @@ QVariant QPlainTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const
v = QWidget::inputMethodQuery(property);
break;
default:
- v = d->control->inputMethodQuery(property);
+ v = d->control->inputMethodQuery(property, QVariant());
const QPoint offset(-d->horizontalOffset(), -0);
if (v.type() == QVariant::RectF)
v = v.toRectF().toRect().translated(offset);
@@ -2758,6 +2800,27 @@ bool QPlainTextEdit::find(const QString &exp, QTextDocument::FindFlags options)
}
/*!
+ \fn bool QPlainTextEdit::find(const QRegExp &exp, QTextDocument::FindFlags options)
+
+ \since 5.3
+ \overload
+
+ Finds the next occurrence, matching the regular expression, \a exp, using the given
+ \a options. The QTextDocument::FindCaseSensitively option is ignored for this overload,
+ use QRegExp::caseSensitivity instead.
+
+ Returns \c true if a match was found and changes the cursor to select the match;
+ otherwise returns \c false.
+*/
+#ifndef QT_NO_REGEXP
+bool QPlainTextEdit::find(const QRegExp &exp, QTextDocument::FindFlags options)
+{
+ Q_D(QPlainTextEdit);
+ return d->control->find(exp, options);
+}
+#endif
+
+/*!
\fn void QPlainTextEdit::copyAvailable(bool yes)
This signal is emitted when text is selected or de-selected in the
diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h
index 81548818ef..1fb4625fb1 100644
--- a/src/widgets/widgets/qplaintextedit.h
+++ b/src/widgets/widgets/qplaintextedit.h
@@ -83,6 +83,7 @@ class Q_WIDGETS_EXPORT QPlainTextEdit : public QAbstractScrollArea
Q_PROPERTY(int maximumBlockCount READ maximumBlockCount WRITE setMaximumBlockCount)
Q_PROPERTY(bool backgroundVisible READ backgroundVisible WRITE setBackgroundVisible)
Q_PROPERTY(bool centerOnScroll READ centerOnScroll WRITE setCenterOnScroll)
+ Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText)
public:
enum LineWrapMode {
NoWrap,
@@ -96,6 +97,9 @@ public:
void setDocument(QTextDocument *document);
QTextDocument *document() const;
+ void setPlaceholderText(const QString &placeholderText);
+ QString placeholderText() const;
+
void setTextCursor(const QTextCursor &cursor);
QTextCursor textCursor() const;
@@ -141,6 +145,9 @@ public:
bool centerOnScroll() const;
bool find(const QString &exp, QTextDocument::FindFlags options = 0);
+#ifndef QT_NO_REGEXP
+ bool find(const QRegExp &exp, QTextDocument::FindFlags options = 0);
+#endif
inline QString toPlainText() const
{ return document()->toPlainText(); }
diff --git a/src/widgets/widgets/qplaintextedit_p.h b/src/widgets/widgets/qplaintextedit_p.h
index ab464676e5..3585b8307f 100644
--- a/src/widgets/widgets/qplaintextedit_p.h
+++ b/src/widgets/widgets/qplaintextedit_p.h
@@ -179,6 +179,7 @@ public:
void _q_modificationChanged(bool);
int originalOffsetY;
+ QString placeholderText;
};
QT_END_NAMESPACE
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index a10d726e36..264123abf0 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -647,7 +647,7 @@ void QPushButton::setFlat(bool flat)
if (d->flat == flat)
return;
d->flat = flat;
- d->resetLayoutItemMargins();
+ d->resetLayoutItemMargins();
d->sizeHint = QSize();
update();
updateGeometry();
@@ -673,8 +673,8 @@ bool QPushButton::event(QEvent *e)
|| e->type() == QEvent::MacSizeChange
#endif
) {
- d->resetLayoutItemMargins();
- updateGeometry();
+ d->resetLayoutItemMargins();
+ updateGeometry();
} else if (e->type() == QEvent::PolishRequest) {
updateGeometry();
}
diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp
index 106a8d770a..e46de3958f 100644
--- a/src/widgets/widgets/qsizegrip.cpp
+++ b/src/widgets/widgets/qsizegrip.cpp
@@ -482,7 +482,7 @@ bool QSizeGrip::eventFilter(QObject *o, QEvent *e)
Q_D(QSizeGrip);
if ((isHidden() && testAttribute(Qt::WA_WState_ExplicitShowHide))
|| e->type() != QEvent::WindowStateChange
- || o != d->tlw) {
+ || o != d->tlw) {
return QWidget::eventFilter(o, e);
}
Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen;
diff --git a/src/widgets/widgets/qslider.cpp b/src/widgets/widgets/qslider.cpp
index 2d91cd07e6..0ff31af630 100644
--- a/src/widgets/widgets/qslider.cpp
+++ b/src/widgets/widgets/qslider.cpp
@@ -63,7 +63,7 @@ public:
QSlider::TickPosition tickPosition;
int clickOffset;
void init();
- void resetLayoutItemMargins();
+ void resetLayoutItemMargins();
int pixelPosToRangeValue(int pos) const;
inline int pick(const QPoint &pt) const;
@@ -86,7 +86,7 @@ void QSliderPrivate::init()
sp.transpose();
q->setSizePolicy(sp);
q->setAttribute(Qt::WA_WState_OwnSizePolicy, false);
- resetLayoutItemMargins();
+ resetLayoutItemMargins();
}
void QSliderPrivate::resetLayoutItemMargins()
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index 2a34451408..e198dae168 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -463,8 +463,8 @@ void QSpinBox::setDisplayIntegerBase(int base)
display the given \a value. The default implementation returns a
string containing \a value printed in the standard way using
QWidget::locale().toString(), but with the thousand separator
- removed. Reimplementations may return anything. (See the example
- in the detailed description.)
+ removed unless setGroupSeparatorShown() is set. Reimplementations may
+ return anything. (See the example in the detailed description.)
Note: QSpinBox does not call this function for specialValueText()
and that neither prefix() nor suffix() should be included in the
@@ -487,7 +487,7 @@ QString QSpinBox::textFromValue(int value) const
str.prepend('-');
} else {
str = locale().toString(value);
- if (qAbs(value) >= 1000 || value == INT_MIN) {
+ if (!d->showGroupSeparator && (qAbs(value) >= 1000 || value == INT_MIN)) {
str.remove(locale().groupSeparator());
}
}
@@ -538,7 +538,8 @@ QValidator::State QSpinBox::validate(QString &text, int &pos) const
*/
void QSpinBox::fixup(QString &input) const
{
- input.remove(locale().groupSeparator());
+ if (!isGroupSeparatorShown())
+ input.remove(locale().groupSeparator());
}
@@ -891,7 +892,8 @@ void QDoubleSpinBox::setDecimals(int decimals)
display the given \a value. The default implementation returns a string
containing \a value printed using QWidget::locale().toString(\a value,
QLatin1Char('f'), decimals()) and will remove the thousand
- separator. Reimplementations may return anything.
+ separator unless setGroupSeparatorShown() is set. Reimplementations may
+ return anything.
Note: QDoubleSpinBox does not call this function for
specialValueText() and that neither prefix() nor suffix() should
@@ -908,9 +910,9 @@ QString QDoubleSpinBox::textFromValue(double value) const
{
Q_D(const QDoubleSpinBox);
QString str = locale().toString(value, 'f', d->decimals);
- if (qAbs(value) >= 1000.0) {
+ if (!d->showGroupSeparator && qAbs(value) >= 1000.0)
str.remove(locale().groupSeparator());
- }
+
return str;
}
diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp
index b2a0d3f8b8..db9db68039 100644
--- a/src/widgets/widgets/qsplashscreen.cpp
+++ b/src/widgets/widgets/qsplashscreen.cpp
@@ -251,7 +251,9 @@ inline static bool waitForWindowExposed(QWindow *window, int timeout = 1000)
break;
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WINRT)
+ WaitForSingleObjectEx(GetCurrentThread(), TimeOutMs, false);
+#elif defined(Q_OS_WIN)
Sleep(uint(TimeOutMs));
#else
struct timespec ts = { TimeOutMs / 1000, (TimeOutMs % 1000) * 1000 * 1000 };
diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index 8c15b3e58e..fced1c01ec 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -759,11 +759,10 @@ void QTabWidgetPrivate::_q_removeTab(int index)
void QTabWidgetPrivate::_q_tabMoved(int from, int to)
{
- stack->blockSignals(true);
+ const QSignalBlocker blocker(stack);
QWidget *w = stack->widget(from);
stack->removeWidget(w);
stack->insertWidget(to, w);
- stack->blockSignals(false);
}
/*
diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp
index 273a5dabeb..9ecc87aac4 100644
--- a/src/widgets/widgets/qtextbrowser.cpp
+++ b/src/widgets/widgets/qtextbrowser.cpp
@@ -296,7 +296,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url)
QTextCodec *codec = Qt::codecForHtml(ba);
txt = codec->toUnicode(ba);
#else
- txt = data.toString();
+ txt = data.toString();
#endif
}
if (txt.isEmpty())
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 29538e1b70..a33ac0817f 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -1717,14 +1717,21 @@ void QTextEdit::scrollContentsBy(int dx, int dy)
*/
QVariant QTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const
{
+ return inputMethodQuery(property, QVariant());
+}
+
+/*!\internal
+ */
+QVariant QTextEdit::inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const
+{
Q_D(const QTextEdit);
QVariant v;
- switch (property) {
+ switch (query) {
case Qt::ImHints:
- v = QWidget::inputMethodQuery(property);
+ v = QWidget::inputMethodQuery(query);
break;
default:
- v = d->control->inputMethodQuery(property);
+ v = d->control->inputMethodQuery(query, argument);
const QPoint offset(-d->horizontalOffset(), -d->verticalOffset());
if (v.type() == QVariant::RectF)
v = v.toRectF().toRect().translated(offset);
@@ -2456,6 +2463,27 @@ bool QTextEdit::find(const QString &exp, QTextDocument::FindFlags options)
}
/*!
+ \fn bool QTextEdit::find(const QRegExp &exp, QTextDocument::FindFlags options)
+
+ \since 5.3
+ \overload
+
+ Finds the next occurrence, matching the regular expression, \a exp, using the given
+ \a options. The QTextDocument::FindCaseSensitively option is ignored for this overload,
+ use QRegExp::caseSensitivity instead.
+
+ Returns \c true if a match was found and changes the cursor to select the match;
+ otherwise returns \c false.
+*/
+#ifndef QT_NO_REGEXP
+bool QTextEdit::find(const QRegExp &exp, QTextDocument::FindFlags options)
+{
+ Q_D(QTextEdit);
+ return d->control->find(exp, options);
+}
+#endif
+
+/*!
\fn void QTextEdit::copyAvailable(bool yes)
This signal is emitted when text is selected or de-selected in the
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h
index 06ec5fb889..a283a51b90 100644
--- a/src/widgets/widgets/qtextedit.h
+++ b/src/widgets/widgets/qtextedit.h
@@ -162,6 +162,9 @@ public:
void setWordWrapMode(QTextOption::WrapMode policy);
bool find(const QString &exp, QTextDocument::FindFlags options = 0);
+#ifndef QT_NO_REGEXP
+ bool find(const QRegExp &exp, QTextDocument::FindFlags options = 0);
+#endif
QString toPlainText() const;
#ifndef QT_NO_TEXTHTMLPARSER
@@ -209,6 +212,7 @@ public:
void print(QPagedPaintDevice *printer) const;
QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
+ Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
public Q_SLOTS:
void setFontPointSize(qreal s);
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index 5e7eb943ab..d20b7a380d 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -650,9 +650,9 @@ void QToolBar::setOrientation(Qt::Orientation orientation)
d->orientation = orientation;
if (orientation == Qt::Vertical)
- setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
+ setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
else
- setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
+ setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
d->layout->invalidate();
d->layout->activate();
diff --git a/src/widgets/widgets/qtoolbar.h b/src/widgets/widgets/qtoolbar.h
index 663497493f..fbe509f522 100644
--- a/src/widgets/widgets/qtoolbar.h
+++ b/src/widgets/widgets/qtoolbar.h
@@ -105,7 +105,7 @@ public:
QAction *addAction(const QIcon &icon, const QString &text);
QAction *addAction(const QString &text, const QObject *receiver, const char* member);
QAction *addAction(const QIcon &icon, const QString &text,
- const QObject *receiver, const char* member);
+ const QObject *receiver, const char* member);
QAction *addSeparator();
QAction *insertSeparator(QAction *before);
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index b8f8762240..98f85e681b 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -2024,7 +2024,7 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
emit q->microFocusChanged();
}
-QVariant QWidgetTextControl::inputMethodQuery(Qt::InputMethodQuery property) const
+QVariant QWidgetTextControl::inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const
{
Q_D(const QWidgetTextControl);
QTextBlock block = d->cursor.block();
@@ -2043,6 +2043,47 @@ QVariant QWidgetTextControl::inputMethodQuery(Qt::InputMethodQuery property) con
return QVariant(); // No limit.
case Qt::ImAnchorPosition:
return QVariant(d->cursor.anchor() - block.position());
+ case Qt::ImAbsolutePosition:
+ return QVariant(d->cursor.position());
+ case Qt::ImTextAfterCursor:
+ {
+ int maxLength = argument.isValid() ? argument.toInt() : 1024;
+ QTextCursor tmpCursor = d->cursor;
+ int localPos = d->cursor.position() - block.position();
+ QString result = block.text().mid(localPos);
+ while (result.length() < maxLength) {
+ int currentBlock = tmpCursor.blockNumber();
+ tmpCursor.movePosition(QTextCursor::NextBlock);
+ if (tmpCursor.blockNumber() == currentBlock)
+ break;
+ result += QLatin1Char('\n') + tmpCursor.block().text();
+ }
+ return QVariant(result);
+ }
+ case Qt::ImTextBeforeCursor:
+ {
+ int maxLength = argument.isValid() ? argument.toInt() : 1024;
+ QTextCursor tmpCursor = d->cursor;
+ int localPos = d->cursor.position() - block.position();
+ int numBlocks = 0;
+ int resultLen = localPos;
+ while (resultLen < maxLength) {
+ int currentBlock = tmpCursor.blockNumber();
+ tmpCursor.movePosition(QTextCursor::PreviousBlock);
+ if (tmpCursor.blockNumber() == currentBlock)
+ break;
+ numBlocks++;
+ resultLen += tmpCursor.block().length();
+ }
+ QString result;
+ while (numBlocks) {
+ result += tmpCursor.block().text() + QLatin1Char('\n');
+ tmpCursor.movePosition(QTextCursor::NextBlock);
+ --numBlocks;
+ }
+ result += block.text().mid(0,localPos);
+ return QVariant(result);
+ }
default:
return QVariant();
}
@@ -2958,6 +2999,19 @@ bool QWidgetTextControl::find(const QString &exp, QTextDocument::FindFlags optio
return true;
}
+#ifndef QT_NO_REGEXP
+bool QWidgetTextControl::find(const QRegExp &exp, QTextDocument::FindFlags options)
+{
+ Q_D(QWidgetTextControl);
+ QTextCursor search = d->doc->find(exp, d->cursor, options);
+ if (search.isNull())
+ return false;
+
+ setTextCursor(search);
+ return true;
+}
+#endif
+
QString QWidgetTextControl::toPlainText() const
{
return document()->toPlainText();
@@ -3126,7 +3180,7 @@ QRectF QWidgetTextControl::blockBoundingRect(const QTextBlock &block) const
}
#ifndef QT_NO_CONTEXTMENU
-#define NUM_CONTROL_CHARACTERS 10
+#define NUM_CONTROL_CHARACTERS 14
const struct QUnicodeControlCharacter {
const char *text;
ushort character;
@@ -3141,6 +3195,10 @@ const struct QUnicodeControlCharacter {
{ QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "LRO Start of left-to-right override"), 0x202d },
{ QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "RLO Start of right-to-left override"), 0x202e },
{ QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "PDF Pop directional formatting"), 0x202c },
+ { QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "LRI Left-to-right isolate"), 0x2066 },
+ { QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "RLI Right-to-left isolate"), 0x2067 },
+ { QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "FSI First strong isolate"), 0x2068 },
+ { QT_TRANSLATE_NOOP("QUnicodeControlCharacterMenu", "PDI Pop directional isolate"), 0x2069 }
};
QUnicodeControlCharacterMenu::QUnicodeControlCharacterMenu(QObject *_editWidget, QWidget *parent)
diff --git a/src/widgets/widgets/qwidgettextcontrol_p.h b/src/widgets/widgets/qwidgettextcontrol_p.h
index e857fffba5..0c76355ca1 100644
--- a/src/widgets/widgets/qwidgettextcontrol_p.h
+++ b/src/widgets/widgets/qwidgettextcontrol_p.h
@@ -110,6 +110,9 @@ public:
QTextCharFormat currentCharFormat() const;
bool find(const QString &exp, QTextDocument::FindFlags options = 0);
+#ifndef QT_NO_REGEXP
+ bool find(const QRegExp &exp, QTextDocument::FindFlags options = 0);
+#endif
QString toPlainText() const;
#ifndef QT_NO_TEXTHTMLPARSER
@@ -236,7 +239,7 @@ public:
void setFocus(bool focus, Qt::FocusReason = Qt::OtherFocusReason);
- virtual QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const;
virtual QMimeData *createMimeDataFromSelection() const;
virtual bool canInsertFromMimeData(const QMimeData *source) const;