diff options
Diffstat (limited to 'src/gui')
37 files changed, 268 insertions, 184 deletions
diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp index 44a82ef..a9126f6 100644 --- a/src/gui/dialogs/qcolordialog.cpp +++ b/src/gui/dialogs/qcolordialog.cpp @@ -1594,8 +1594,8 @@ void QColorDialogPrivate::init(const QColor &initial) cs = new QColorShower(q); QObject::connect(cs, SIGNAL(newCol(QRgb)), q, SLOT(_q_newColorTypedIn(QRgb))); - QObject::connect(cs, SIGNAL(currentColorChanged(const QColor&)), - q, SIGNAL(currentColorChanged(const QColor&))); + QObject::connect(cs, SIGNAL(currentColorChanged(QColor)), + q, SIGNAL(currentColorChanged(QColor))); #if defined(Q_WS_S60) if (!nonTouchUI) pWidth -= cp->size().width(); @@ -1904,7 +1904,7 @@ void QColorDialog::setVisible(bool visible) void QColorDialog::open(QObject *receiver, const char *member) { Q_D(QColorDialog); - connect(this, SIGNAL(colorSelected(const QColor&)), receiver, member); + connect(this, SIGNAL(colorSelected(QColor)), receiver, member); d->receiverToDisconnectOnClose = receiver; d->memberToDisconnectOnClose = member; QDialog::open(); @@ -2036,7 +2036,7 @@ void QColorDialog::done(int result) d->selectedQColor = QColor(); } if (d->receiverToDisconnectOnClose) { - disconnect(this, SIGNAL(colorSelected(const QColor&)), + disconnect(this, SIGNAL(colorSelected(QColor)), d->receiverToDisconnectOnClose, d->memberToDisconnectOnClose); d->receiverToDisconnectOnClose = 0; } diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 3b1befd..45a410f 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -691,8 +691,8 @@ QFileDialog::Options QFileDialog::options() const void QFileDialog::open(QObject *receiver, const char *member) { Q_D(QFileDialog); - const char *signal = (fileMode() == ExistingFiles) ? SIGNAL(filesSelected(const QStringList&)) - : SIGNAL(fileSelected(const QString&)); + const char *signal = (fileMode() == ExistingFiles) ? SIGNAL(filesSelected(QStringList)) + : SIGNAL(fileSelected(QString)); connect(this, signal, receiver, member); d->signalToDisconnectOnClose = signal; d->receiverToDisconnectOnClose = receiver; @@ -2145,11 +2145,11 @@ void QFileDialogPrivate::createWidgets() model->setNameFilterDisables(false); #endif model->d_func()->disableRecursiveSort = true; - QFileDialog::connect(model, SIGNAL(fileRenamed(const QString &, const QString &, const QString &)), q, SLOT(_q_fileRenamed(const QString &, const QString &, const QString &))); - QFileDialog::connect(model, SIGNAL(rootPathChanged(const QString &)), - q, SLOT(_q_pathChanged(const QString &))); - QFileDialog::connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), - q, SLOT(_q_rowsInserted(const QModelIndex &))); + QFileDialog::connect(model, SIGNAL(fileRenamed(QString,QString,QString)), q, SLOT(_q_fileRenamed(QString,QString,QString))); + QFileDialog::connect(model, SIGNAL(rootPathChanged(QString)), + q, SLOT(_q_pathChanged(QString))); + QFileDialog::connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), + q, SLOT(_q_rowsInserted(QModelIndex))); model->setReadOnly(false); qFileDialogUi.reset(new Ui_QFileDialog()); @@ -2159,8 +2159,8 @@ void QFileDialogPrivate::createWidgets() initialBookmarks << QUrl::fromLocalFile(QLatin1String("")) << QUrl::fromLocalFile(QDir::homePath()); qFileDialogUi->sidebar->init(model, initialBookmarks); - QFileDialog::connect(qFileDialogUi->sidebar, SIGNAL(goToUrl(const QUrl &)), - q, SLOT(_q_goToUrl(const QUrl &))); + QFileDialog::connect(qFileDialogUi->sidebar, SIGNAL(goToUrl(QUrl)), + q, SLOT(_q_goToUrl(QUrl))); QObject::connect(qFileDialogUi->buttonBox, SIGNAL(accepted()), q, SLOT(accept())); QObject::connect(qFileDialogUi->buttonBox, SIGNAL(rejected()), q, SLOT(reject())); @@ -2194,8 +2194,8 @@ void QFileDialogPrivate::createWidgets() qFileDialogUi->fileTypeCombo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); QObject::connect(qFileDialogUi->fileTypeCombo, SIGNAL(activated(int)), q, SLOT(_q_useNameFilter(int))); - QObject::connect(qFileDialogUi->fileTypeCombo, SIGNAL(activated(const QString &)), - q, SIGNAL(filterSelected(const QString &))); + QObject::connect(qFileDialogUi->fileTypeCombo, SIGNAL(activated(QString)), + q, SIGNAL(filterSelected(QString))); qFileDialogUi->listView->init(this); qFileDialogUi->listView->setModel(model); @@ -2221,8 +2221,8 @@ void QFileDialogPrivate::createWidgets() QActionGroup *showActionGroup = new QActionGroup(q); showActionGroup->setExclusive(false); - QObject::connect(showActionGroup, SIGNAL(triggered(QAction *)), - q, SLOT(_q_showHeader(QAction *)));; + QObject::connect(showActionGroup, SIGNAL(triggered(QAction*)), + q, SLOT(_q_showHeader(QAction*)));; QAbstractItemModel *abstractModel = model; #ifndef QT_NO_PROXYMODEL @@ -2251,7 +2251,7 @@ void QFileDialogPrivate::createWidgets() // Selections QItemSelectionModel *selections = qFileDialogUi->listView->selectionModel(); - QObject::connect(selections, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), + QObject::connect(selections, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), q, SLOT(_q_selectionChanged())); QObject::connect(selections, SIGNAL(currentChanged(QModelIndex,QModelIndex)), q, SLOT(_q_currentChanged(QModelIndex))); @@ -2289,11 +2289,11 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel) QModelIndex idx = d->rootIndex(); if (d->proxyModel) { - disconnect(d->proxyModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)), - this, SLOT(_q_rowsInserted(const QModelIndex &))); + disconnect(d->proxyModel, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(_q_rowsInserted(QModelIndex))); } else { - disconnect(d->model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), - this, SLOT(_q_rowsInserted(const QModelIndex &))); + disconnect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(_q_rowsInserted(QModelIndex))); } if (proxyModel != 0) { @@ -2306,8 +2306,8 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel) d->completer->setModel(d->proxyModel); d->completer->proxyModel = d->proxyModel; #endif - connect(d->proxyModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)), - this, SLOT(_q_rowsInserted(const QModelIndex &))); + connect(d->proxyModel, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(_q_rowsInserted(QModelIndex))); } else { d->proxyModel = 0; d->qFileDialogUi->listView->setModel(d->model); @@ -2317,8 +2317,8 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel) d->completer->sourceModel = d->model; d->completer->proxyModel = 0; #endif - connect(d->model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), - this, SLOT(_q_rowsInserted(const QModelIndex &))); + connect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(_q_rowsInserted(QModelIndex))); } QScopedPointer<QItemSelectionModel> selModel(d->qFileDialogUi->treeView->selectionModel()); d->qFileDialogUi->treeView->setSelectionModel(d->qFileDialogUi->listView->selectionModel()); @@ -2327,7 +2327,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel) // reconnect selection QItemSelectionModel *selections = d->qFileDialogUi->listView->selectionModel(); - QObject::connect(selections, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), + QObject::connect(selections, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(_q_selectionChanged())); QObject::connect(selections, SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(_q_currentChanged(QModelIndex))); diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp index 76d87ae..2729530 100644 --- a/src/gui/dialogs/qfileinfogatherer.cpp +++ b/src/gui/dialogs/qfileinfogatherer.cpp @@ -75,8 +75,8 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent) #endif #ifndef QT_NO_FILESYSTEMWATCHER watcher = new QFileSystemWatcher(this); - connect(watcher, SIGNAL(directoryChanged(const QString &)), this, SLOT(list(const QString &))); - connect(watcher, SIGNAL(fileChanged(const QString &)), this, SLOT(updateFile(const QString &))); + connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(list(QString))); + connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(updateFile(QString))); #endif start(LowPriority); } diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index b9012c7..8e78503 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -1864,12 +1864,12 @@ void QFileSystemModelPrivate::init() { Q_Q(QFileSystemModel); qRegisterMetaType<QList<QPair<QString,QFileInfo> > >("QList<QPair<QString,QFileInfo> >"); - q->connect(&fileInfoGatherer, SIGNAL(newListOfFiles(const QString &, const QStringList &)), - q, SLOT(_q_directoryChanged(const QString &, const QStringList &))); - q->connect(&fileInfoGatherer, SIGNAL(updates(const QString &, const QList<QPair<QString, QFileInfo> > &)), - q, SLOT(_q_fileSystemChanged(const QString &, const QList<QPair<QString, QFileInfo> > &))); - q->connect(&fileInfoGatherer, SIGNAL(nameResolved(const QString &, const QString &)), - q, SLOT(_q_resolvedName(const QString &, const QString &))); + q->connect(&fileInfoGatherer, SIGNAL(newListOfFiles(QString,QStringList)), + q, SLOT(_q_directoryChanged(QString,QStringList))); + q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QList<QPair<QString,QFileInfo> >)), + q, SLOT(_q_fileSystemChanged(QString,QList<QPair<QString,QFileInfo> >))); + q->connect(&fileInfoGatherer, SIGNAL(nameResolved(QString,QString)), + q, SLOT(_q_resolvedName(QString,QString))); q->connect(&delayedSortTimer, SIGNAL(timeout()), q, SLOT(_q_performDelayedSort()), Qt::QueuedConnection); } diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index 60fae27..d035ef4 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -948,7 +948,7 @@ bool QFontDialogPrivate::sharedFontPanelAvailable = true; void QFontDialog::open(QObject *receiver, const char *member) { Q_D(QFontDialog); - connect(this, SIGNAL(fontSelected(const QFont&)), receiver, member); + connect(this, SIGNAL(fontSelected(QFont)), receiver, member); d->receiverToDisconnectOnClose = receiver; d->memberToDisconnectOnClose = member; QDialog::open(); @@ -1038,7 +1038,7 @@ void QFontDialog::done(int result) d->selectedFont = QFont(); } if (d->receiverToDisconnectOnClose) { - disconnect(this, SIGNAL(fontSelected(const QFont&)), + disconnect(this, SIGNAL(fontSelected(QFont)), d->receiverToDisconnectOnClose, d->memberToDisconnectOnClose); d->receiverToDisconnectOnClose = 0; } diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index 86213b4..39ce1ab 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -95,7 +95,7 @@ class QInputDialogSpinBox : public QSpinBox public: QInputDialogSpinBox(QWidget *parent) : QSpinBox(parent) { - connect(lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(notifyTextChanged())); + connect(lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(notifyTextChanged())); connect(this, SIGNAL(editingFinished()), this, SLOT(notifyTextChanged())); } @@ -130,7 +130,7 @@ class QInputDialogDoubleSpinBox : public QDoubleSpinBox public: QInputDialogDoubleSpinBox(QWidget *parent = 0) : QDoubleSpinBox(parent) { - connect(lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(notifyTextChanged())); + connect(lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(notifyTextChanged())); connect(this, SIGNAL(editingFinished()), this, SLOT(notifyTextChanged())); } @@ -245,8 +245,8 @@ void QInputDialogPrivate::ensureLineEdit() if (!lineEdit) { lineEdit = new QLineEdit(q); lineEdit->hide(); - QObject::connect(lineEdit, SIGNAL(textChanged(const QString&)), - q, SLOT(_q_textChanged(const QString&))); + QObject::connect(lineEdit, SIGNAL(textChanged(QString)), + q, SLOT(_q_textChanged(QString))); } } @@ -256,10 +256,10 @@ void QInputDialogPrivate::ensureComboBox() if (!comboBox) { comboBox = new QComboBox(q); comboBox->hide(); - QObject::connect(comboBox, SIGNAL(editTextChanged(const QString&)), - q, SLOT(_q_textChanged(const QString&))); - QObject::connect(comboBox, SIGNAL(currentIndexChanged(const QString&)), - q, SLOT(_q_textChanged(const QString&))); + QObject::connect(comboBox, SIGNAL(editTextChanged(QString)), + q, SLOT(_q_textChanged(QString))); + QObject::connect(comboBox, SIGNAL(currentIndexChanged(QString)), + q, SLOT(_q_textChanged(QString))); } } @@ -276,8 +276,8 @@ void QInputDialogPrivate::ensureListView() listView->setModel(comboBox->model()); listView->setCurrentIndex(QModelIndex()); // ### QObject::connect(listView->selectionModel(), - SIGNAL(currentRowChanged(const QModelIndex&, const QModelIndex&)), - q, SLOT(_q_currentRowChanged(const QModelIndex&, const QModelIndex&))); + SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), + q, SLOT(_q_currentRowChanged(QModelIndex,QModelIndex))); } } diff --git a/src/gui/dialogs/qprintdialog_qws.cpp b/src/gui/dialogs/qprintdialog_qws.cpp index 37f01be..05a290d 100644 --- a/src/gui/dialogs/qprintdialog_qws.cpp +++ b/src/gui/dialogs/qprintdialog_qws.cpp @@ -266,8 +266,8 @@ void QPrintDialogPrivate::setupDestination() // print destinations printerOrFile = new QButtonGroup(q); - QObject::connect(printerOrFile, SIGNAL(buttonClicked(QAbstractButton *)), - q, SLOT(_q_printerOrFileSelected(QAbstractButton *))); + QObject::connect(printerOrFile, SIGNAL(buttonClicked(QAbstractButton*)), + q, SLOT(_q_printerOrFileSelected(QAbstractButton*))); printToPrinterButton = q->findChild<QRadioButton *>("printToPrinterButton"); printerOrFile->addButton(printToPrinterButton); @@ -288,8 +288,8 @@ void QPrintDialogPrivate::setupPrinterSettings() // color mode colorMode = new QButtonGroup(q); - QObject::connect(colorMode, SIGNAL(buttonClicked(QAbstractButton *)), - q, SLOT(_q_colorModeSelected(QAbstractButton *))); + QObject::connect(colorMode, SIGNAL(buttonClicked(QAbstractButton*)), + q, SLOT(_q_colorModeSelected(QAbstractButton*))); printColor = q->findChild<QRadioButton *>("printColor"); colorMode->addButton(printColor); diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp index 1f0b51d..bb8437c 100644 --- a/src/gui/dialogs/qprintpreviewdialog.cpp +++ b/src/gui/dialogs/qprintpreviewdialog.cpp @@ -224,7 +224,7 @@ void QPrintPreviewDialogPrivate::init(QPrinter *_printer) printer = new QPrinter; preview = new QPrintPreviewWidget(printer, q); } - QObject::connect(preview, SIGNAL(paintRequested(QPrinter *)), q, SIGNAL(paintRequested(QPrinter *))); + QObject::connect(preview, SIGNAL(paintRequested(QPrinter*)), q, SIGNAL(paintRequested(QPrinter*))); QObject::connect(preview, SIGNAL(previewChanged()), q, SLOT(_q_previewChanged())); setupActions(); diff --git a/src/gui/dialogs/qsidebar.cpp b/src/gui/dialogs/qsidebar.cpp index 396889d..879d1b1 100644 --- a/src/gui/dialogs/qsidebar.cpp +++ b/src/gui/dialogs/qsidebar.cpp @@ -293,20 +293,20 @@ void QUrlModel::setFileSystemModel(QFileSystemModel *model) if (model == fileSystemModel) return; if (fileSystemModel != 0) { - disconnect(model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(dataChanged(const QModelIndex &, const QModelIndex &))); + disconnect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), + this, SLOT(dataChanged(QModelIndex,QModelIndex))); disconnect(model, SIGNAL(layoutChanged()), this, SLOT(layoutChanged())); - disconnect(model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), + disconnect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(layoutChanged())); } fileSystemModel = model; if (fileSystemModel != 0) { - connect(model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(dataChanged(const QModelIndex &, const QModelIndex &))); + connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), + this, SLOT(dataChanged(QModelIndex,QModelIndex))); connect(model, SIGNAL(layoutChanged()), this, SLOT(layoutChanged())); - connect(model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), + connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(layoutChanged())); } clear(); @@ -381,14 +381,14 @@ void QSidebar::init(QFileSystemModel *model, const QList<QUrl> &newUrls) setModel(urlModel); setItemDelegate(new QSideBarDelegate(this)); - connect(selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(clicked(const QModelIndex &))); + connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(clicked(QModelIndex))); #ifndef QT_NO_DRAGANDDROP setDragDropMode(QAbstractItemView::DragDrop); #endif setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), - this, SLOT(showContextMenu(const QPoint &))); + connect(this, SIGNAL(customContextMenuRequested(QPoint)), + this, SLOT(showContextMenu(QPoint))); urlModel->setUrls(newUrls); setCurrentIndex(this->model()->index(0,0)); } @@ -414,8 +414,8 @@ QSize QSidebar::sizeHint() const void QSidebar::selectUrl(const QUrl &url) { - disconnect(selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(clicked(const QModelIndex &))); + disconnect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(clicked(QModelIndex))); selectionModel()->clear(); for (int i = 0; i < model()->rowCount(); ++i) { @@ -425,8 +425,8 @@ void QSidebar::selectUrl(const QUrl &url) } } - connect(selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(clicked(const QModelIndex &))); + connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(clicked(QModelIndex))); } #ifndef QT_NO_MENU diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index db1c9e9..472ca35 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -759,8 +759,8 @@ void QWizardPrivate::addField(const QWizardField &field) QObject::connect(myField.object, myField.changedSignal, myField.page, SLOT(_q_maybeEmitCompleteChanged())); QObject::connect( - myField.object, SIGNAL(destroyed(QObject *)), q, - SLOT(_q_handleFieldObjectDestroyed(QObject *))); + myField.object, SIGNAL(destroyed(QObject*)), q, + SLOT(_q_handleFieldObjectDestroyed(QObject*))); } void QWizardPrivate::removeFieldAt(int index) @@ -773,8 +773,8 @@ void QWizardPrivate::removeFieldAt(int index) QObject::disconnect(field.object, field.changedSignal, field.page, SLOT(_q_maybeEmitCompleteChanged())); QObject::disconnect( - field.object, SIGNAL(destroyed(QObject *)), q, - SLOT(_q_handleFieldObjectDestroyed(QObject *))); + field.object, SIGNAL(destroyed(QObject*)), q, + SLOT(_q_handleFieldObjectDestroyed(QObject*))); fields.remove(index); } diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 5b0643d..10d251d 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -2556,11 +2556,9 @@ void QGraphicsScene::addItem(QGraphicsItem *item) item->d_ptr->resolveFont(d->font.resolve()); item->d_ptr->resolvePalette(d->palette.resolve()); - if (!item->d_ptr->explicitlyHidden) { - if (d->unpolishedItems.isEmpty()) - QMetaObject::invokeMethod(this, "_q_polishItems", Qt::QueuedConnection); - d->unpolishedItems.insert(item); - } + if (d->unpolishedItems.isEmpty()) + QMetaObject::invokeMethod(this, "_q_polishItems", Qt::QueuedConnection); + d->unpolishedItems.insert(item); // Reenable selectionChanged() for individual items --d->selectionChanging; @@ -4422,9 +4420,12 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte bool allowPartialCacheExposure = !viewRect.contains(deviceRect); #else // Only if deviceRect is 20% taller or wider than the desktop. - QRect desktopRect = QApplication::desktop()->availableGeometry(widget); - bool allowPartialCacheExposure = (desktopRect.width() * 1.2 < deviceRect.width() - || desktopRect.height() * 1.2 < deviceRect.height()); + bool allowPartialCacheExposure = false; + if (widget) { + QRect desktopRect = QApplication::desktop()->availableGeometry(widget); + allowPartialCacheExposure = (desktopRect.width() * 1.2 < deviceRect.width() + || desktopRect.height() * 1.2 < deviceRect.height()); + } #endif QRegion scrollExposure; if (deviceData->cacheIndent != QPoint() || allowPartialCacheExposure) { diff --git a/src/gui/graphicsview/qgraphicssceneindex.cpp b/src/gui/graphicsview/qgraphicssceneindex.cpp index f0404fd..70ecd49 100644 --- a/src/gui/graphicsview/qgraphicssceneindex.cpp +++ b/src/gui/graphicsview/qgraphicssceneindex.cpp @@ -354,8 +354,8 @@ void QGraphicsSceneIndexPrivate::init() if (!scene) return; - QObject::connect(scene, SIGNAL(sceneRectChanged(const QRectF&)), - q_func(), SLOT(updateSceneRect(const QRectF&))); + QObject::connect(scene, SIGNAL(sceneRectChanged(QRectF)), + q_func(), SLOT(updateSceneRect(QRectF))); } /*! diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 6175931..365c271 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -160,8 +160,8 @@ QSet<QMacPixmapData*> QMacPixmapData::validDataPointers; QMacPixmapData::QMacPixmapData(PixelType type) : QPixmapData(type, MacClass), has_alpha(0), has_mask(0), - uninit(true), pixels(0), pixelsToFree(0), bytesPerRow(0), - cg_data(0), cg_dataBeingReleased(0), cg_mask(0), + uninit(true), pixels(0), pixelsSize(0), pixelsToFree(0), + bytesPerRow(0), cg_data(0), cg_dataBeingReleased(0), cg_mask(0), pengine(0) { } @@ -637,8 +637,9 @@ void QMacPixmapData::macCreatePixels() } if (pixels) - memcpy(base_pixels, pixels, numBytes); + memcpy(base_pixels, pixels, pixelsSize); pixels = base_pixels; + pixelsSize = numBytes; } #if 0 diff --git a/src/gui/image/qpixmap_mac_p.h b/src/gui/image/qpixmap_mac_p.h index a3fb95f..45ab8e2 100644 --- a/src/gui/image/qpixmap_mac_p.h +++ b/src/gui/image/qpixmap_mac_p.h @@ -107,6 +107,7 @@ private: pixelsToFree later on instead of malloc'ing memory. */ quint32 *pixels; + uint pixelsSize; quint32 *pixelsToFree; uint bytesPerRow; QRectF cg_mask_rect; diff --git a/src/gui/itemviews/qcolumnview.cpp b/src/gui/itemviews/qcolumnview.cpp index d27d061..da3e5a0 100644 --- a/src/gui/itemviews/qcolumnview.cpp +++ b/src/gui/itemviews/qcolumnview.cpp @@ -672,8 +672,8 @@ QAbstractItemView *QColumnViewPrivate::createColumn(const QModelIndex &index, bo QAbstractItemView *view = 0; if (model->hasChildren(index)) { view = q->createColumn(index); - q->connect(view, SIGNAL(clicked(const QModelIndex &)), - q, SLOT(_q_clicked(const QModelIndex &))); + q->connect(view, SIGNAL(clicked(QModelIndex)), + q, SLOT(_q_clicked(QModelIndex))); } else { if (!previewColumn) setPreviewWidget(new QWidget(q)); @@ -681,16 +681,16 @@ QAbstractItemView *QColumnViewPrivate::createColumn(const QModelIndex &index, bo view->setMinimumWidth(qMax(view->minimumWidth(), previewWidget->minimumWidth())); } - q->connect(view, SIGNAL(activated(const QModelIndex &)), - q, SIGNAL(activated(const QModelIndex &))); - q->connect(view, SIGNAL(clicked(const QModelIndex &)), - q, SIGNAL(clicked(const QModelIndex &))); - q->connect(view, SIGNAL(doubleClicked(const QModelIndex &)), - q, SIGNAL(doubleClicked(const QModelIndex &))); - q->connect(view, SIGNAL(entered(const QModelIndex &)), - q, SIGNAL(entered(const QModelIndex &))); - q->connect(view, SIGNAL(pressed(const QModelIndex &)), - q, SIGNAL(pressed(const QModelIndex &))); + q->connect(view, SIGNAL(activated(QModelIndex)), + q, SIGNAL(activated(QModelIndex))); + q->connect(view, SIGNAL(clicked(QModelIndex)), + q, SIGNAL(clicked(QModelIndex))); + q->connect(view, SIGNAL(doubleClicked(QModelIndex)), + q, SIGNAL(doubleClicked(QModelIndex))); + q->connect(view, SIGNAL(entered(QModelIndex)), + q, SIGNAL(entered(QModelIndex))); + q->connect(view, SIGNAL(pressed(QModelIndex)), + q, SIGNAL(pressed(QModelIndex))); view->setFocusPolicy(Qt::NoFocus); view->setParent(viewport); diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index 6f2cff9..5df8481 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -2396,7 +2396,12 @@ bool QHeaderView::viewportEvent(QEvent *e) d->state = QHeaderViewPrivate::NoState; d->pressed = d->section = d->target = -1; d->updateSectionIndicator(d->section, -1); - } + break; } + case QEvent::Wheel: { + QAbstractScrollArea *asa = qobject_cast<QAbstractScrollArea *>(parentWidget()); + if (asa) + return QApplication::sendEvent(asa->viewport(), e); + break; } default: break; } diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index c6622cb..052308c 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -773,7 +773,7 @@ void QListView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int e void QListView::mouseMoveEvent(QMouseEvent *e) { if (!isVisible()) - return; + return; Q_D(QListView); QAbstractItemView::mouseMoveEvent(e); if (state() == DragSelectingState @@ -832,16 +832,16 @@ void QListView::resizeEvent(QResizeEvent *e) return; bool listWrap = (d->viewMode == ListMode) && d->wrapItemText; - bool flowDimensionChanged = (d->flow == LeftToRight && delta.width() != 0) - || (d->flow == TopToBottom && delta.height() != 0); + bool flowDimensionChanged = (d->flow == LeftToRight && delta.width() != 0) + || (d->flow == TopToBottom && delta.height() != 0); // We post a delayed relayout in the following cases : // - we're wrapping // - the state is NoState, we're adjusting and the size has changed in the flowing direction - if (listWrap + if (listWrap || (state() == NoState && d->resizeMode == Adjust && flowDimensionChanged)) { - d->doDelayedItemsLayout(100); // wait 1/10 sec before starting the layout - } else { + d->doDelayedItemsLayout(100); // wait 1/10 sec before starting the layout + } else { QAbstractItemView::resizeEvent(e); } } @@ -1147,7 +1147,9 @@ QModelIndex QListView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie } return d->closestIndex(initialRect, intersectVector); case MovePageUp: - rect.moveTop(rect.top() - d->viewport->height()); + // move current by (visibileRowCount - 1) items. + // rect.translate(0, -rect.height()); will happen in the switch fallthrough for MoveUp. + rect.moveTop(rect.top() - d->viewport->height() + 2 * rect.height()); if (rect.top() < rect.height()) rect.moveTop(rect.height()); case MovePrevious: @@ -1173,7 +1175,9 @@ QModelIndex QListView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie } return d->closestIndex(initialRect, intersectVector); case MovePageDown: - rect.moveTop(rect.top() + d->viewport->height()); + // move current by (visibileRowCount - 1) items. + // rect.translate(0, rect.height()); will happen in the switch fallthrough for MoveDown. + rect.moveTop(rect.top() + d->viewport->height() - 2 * rect.height()); if (rect.bottom() > contents.height() - rect.height()) rect.moveBottom(contents.height() - rect.height()); case MoveNext: @@ -1445,7 +1449,7 @@ void QListView::doItemsLayout() // so we set the state to expanding to avoid // triggering another layout QAbstractItemView::State oldState = state(); - setState(ExpandingState); + setState(ExpandingState); if (d->model->columnCount(d->root) > 0) { // no columns means no contents d->resetBatchStartRow(); if (layoutMode() == SinglePass) diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index a3cbc0d..8d50870b 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -838,10 +838,10 @@ void QTreeView::setSortingEnabled(bool enable) // because otherwise it will not call sort on the model. sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder()); connect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), - this, SLOT(_q_sortIndicatorChanged(int, Qt::SortOrder)), Qt::UniqueConnection); + this, SLOT(_q_sortIndicatorChanged(int,Qt::SortOrder)), Qt::UniqueConnection); } else { disconnect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), - this, SLOT(_q_sortIndicatorChanged(int, Qt::SortOrder))); + this, SLOT(_q_sortIndicatorChanged(int,Qt::SortOrder))); } d->sortingEnabled = enable; } diff --git a/src/gui/kernel/qeventdispatcher_s60.cpp b/src/gui/kernel/qeventdispatcher_s60.cpp index 9d18c9b..4c1429a 100644 --- a/src/gui/kernel/qeventdispatcher_s60.cpp +++ b/src/gui/kernel/qeventdispatcher_s60.cpp @@ -92,7 +92,7 @@ void QEventDispatcherS60::saveInputEvent(QSymbianControl *control, QWidget *widg { DeferredInputEvent inputEvent = {control, widget, event}; m_deferredInputEvents.append(inputEvent); - connect(widget, SIGNAL(destroyed(QObject *)), SLOT(removeInputEventsForWidget(QObject *))); + connect(widget, SIGNAL(destroyed(QObject*)), SLOT(removeInputEventsForWidget(QObject*))); } bool QEventDispatcherS60::sendDeferredInputEvents() diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp index 3e5dadc..33f5489 100644 --- a/src/gui/kernel/qformlayout.cpp +++ b/src/gui/kernel/qformlayout.cpp @@ -1124,14 +1124,15 @@ QStyle* QFormLayoutPrivate::getStyle() const \value DontWrapRows Fields are always laid out next to their label. This is - the default policy for all styles except Qt Extended styles. + the default policy for all styles except Qt Extended styles + and QS60Style. \value WrapLongRows Labels are given enough horizontal space to fit the widest label, and the rest of the space is given to the fields. If the minimum size of a field pair is wider than the available space, the field is wrapped to the next line. This is the default policy for - Qt Extended styles. + Qt Extended styles and and QS60Style. \value WrapAllRows Fields are always laid out below their label. @@ -1720,8 +1721,8 @@ QFormLayout::FieldGrowthPolicy QFormLayout::fieldGrowthPolicy() const \brief the way in which the form's rows wrap The default value depends on the widget or application style. For - Qt Extended styles, the default is WrapLongRows; for the other styles, - the default is DontWrapRows. + Qt Extended styles and QS60Style, the default is WrapLongRows; + for the other styles, the default is DontWrapRows. If you want to display each label above its associated field (instead of next to it), set this property to WrapAllRows. diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 22ac319..775d773 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -210,6 +210,10 @@ bool QSoftKeyManager::event(QEvent *e) #ifdef Q_WS_S60 void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys) { + // lets not update softkeys if s60 native dialog or menu is shown + if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) + return; + CEikButtonGroupContainer* nativeContainer = S60->buttonGroupContainer(); nativeContainer->DrawableWindow()->SetOrdinalPosition(0); nativeContainer->DrawableWindow()->SetPointerCapturePriority(1); //keep softkeys available in modal dialog diff --git a/src/gui/kernel/qwidgetaction.cpp b/src/gui/kernel/qwidgetaction.cpp index 7dc2c67..b72a41a 100644 --- a/src/gui/kernel/qwidgetaction.cpp +++ b/src/gui/kernel/qwidgetaction.cpp @@ -212,8 +212,8 @@ void QWidgetAction::releaseWidget(QWidget *widget) if (!d->createdWidgets.contains(widget)) return; - disconnect(widget, SIGNAL(destroyed(QObject *)), - this, SLOT(_q_widgetDestroyed(QObject *))); + disconnect(widget, SIGNAL(destroyed(QObject*)), + this, SLOT(_q_widgetDestroyed(QObject*))); d->createdWidgets.removeAll(widget); deleteWidget(widget); } diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index b92c5c2..1d15dac 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -739,10 +739,6 @@ template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl, quint32 basex; quint32 srcy; - const int dstx = qCeil((tx1 + 0.5 - qMin(targetRect.left(), targetRect.right())) * ix) - 1; - const int dsty = qCeil((ty1 + 0.5 - qMin(targetRect.top(), targetRect.bottom())) * iy) - 1; - - if (sx < 0) { int dstx = qFloor((tx1 + qreal(0.5) - targetRect.right()) * ix) + 1; basex = quint32(srcRect.right() * 65536) + dstx; diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp index b8700c3..51be3b3 100644 --- a/src/gui/painting/qpaintbuffer.cpp +++ b/src/gui/painting/qpaintbuffer.cpp @@ -1708,7 +1708,7 @@ void QPaintEngineExReplayer::process(const QPaintBufferCommand &cmd) QPaintBufferResource::QPaintBufferResource(FreeFunc f, QObject *parent) : QObject(parent), free(f) { - connect(QPaintBufferSignalProxy::instance(), SIGNAL(aboutToDestroy(const QPaintBufferPrivate *)), this, SLOT(remove(const QPaintBufferPrivate *))); + connect(QPaintBufferSignalProxy::instance(), SIGNAL(aboutToDestroy(const QPaintBufferPrivate*)), this, SLOT(remove(const QPaintBufferPrivate*))); } QPaintBufferResource::~QPaintBufferResource() diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index a192e87..46fbaa9 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -101,7 +101,7 @@ void QTextureGlyphCache::populate(const QTextItemInt &ti, Coord c = { 0, 0, // will be filled in later glyph_width, glyph_height, // texture coords - metrics.x.truncate(), + metrics.x.round().truncate(), -metrics.y.truncate() }; // baseline for horizontal scripts listItemCoordinates.insert(glyph, c); diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 7c3e11f..b5c0d4f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -67,6 +67,7 @@ #include "qtoolbar.h" #include "qtoolbutton.h" #include "qfocusframe.h" +#include "qformlayout.h" #include "private/qtoolbarextension_p.h" #include "private/qcombobox_p.h" @@ -867,6 +868,13 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag return result; } +bool QS60StylePrivate::canDrawThemeBackground(const QBrush &backgroundBrush) +{ + //If brush is not changed from style's default values, draw theme graphics. + return (backgroundBrush.color() == Qt::transparent || + backgroundBrush.style() == Qt::NoBrush) ? true : false; +} + /*! \class QS60Style \brief The QS60Style class provides a look and feel suitable for applications on S60. @@ -1380,8 +1388,10 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, highlightRect = option->rect.adjusted(xBeginning, yBeginning, xEnd, yEnd); } if (vopt->showDecorationSelected && - (vopt->palette.highlight().color() == d->themePalette()->highlight().color())) + (vopt->palette.highlight().color() == QS60StylePrivate::themePalette()->highlight().color())) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, highlightRect, flags); + else + painter->fillRect(highlightRect, vopt->palette.highlight()); } // draw the icon @@ -1853,7 +1863,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_ShapedFrame: if (const QTextEdit *textEdit = qobject_cast<const QTextEdit *>(widget)) { const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option); - if (frame->palette.base().color()==Qt::transparent) + if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base())) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags); else QCommonStyle::drawControl(element, option, painter, widget); @@ -1927,7 +1937,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, if (option->state & State_Sunken && option->state & State_Enabled) { painter->save(); painter->setOpacity(0.5); - painter->setBrush(d->themePalette()->light()); + painter->setBrush(QS60StylePrivate::themePalette()->light()); painter->setRenderHint(QPainter::Antialiasing); const qreal roundRectRadius = 4 * goldenRatio; painter->drawRoundedRect(option->rect, roundRectRadius, roundRectRadius); @@ -1946,6 +1956,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti { Q_D(const QS60Style); const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled; + bool commonStyleDraws = false; + switch (element) { #ifndef QT_NO_LINEEDIT case PE_PanelLineEdit: @@ -1954,12 +1966,10 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti if (widget && qobject_cast<const QComboBox *>(widget->parentWidget())) break; #endif - QBrush editBrush = option->palette.brush(QPalette::Base); - if (editBrush.color() == Qt::transparent) - QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_FrameLineEdit, - painter, option->rect, flags); + if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_FrameLineEdit, painter, option->rect, flags); else - QCommonStyle::drawPrimitive(element, option, painter, widget); + commonStyleDraws = true; } break; #endif // QT_NO_LINEEDIT @@ -1969,10 +1979,13 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti const QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ? QS60StyleEnums::SP_QgnIndiCheckboxOn : QS60StyleEnums::SP_QgnIndiCheckboxOff; painter->save(); - QColor themeColor = d->s60Color(QS60StyleEnums::CL_QsnIconColors, 13, option); - QColor buttonTextColor = option->palette.buttonText().color(); - if (themeColor != buttonTextColor) - painter->setPen(buttonTextColor); + + QColor themeColor = QS60StylePrivate::themePalette()->windowText().color(); + QColor windowTextColor = option->palette.windowText().color(); + + if (themeColor != windowTextColor) + painter->setPen(windowTextColor); + QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags | QS60StylePrivate::SF_ColorSkinned ); painter->restore(); } @@ -2019,6 +2032,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti QColor buttonTextColor = option->palette.buttonText().color(); if (themeColor != buttonTextColor) painter->setPen(buttonTextColor); + else + painter->setPen(themeColor); // Draw radiobutton indicator as color skinned graphics. QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ? @@ -2032,14 +2047,13 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_PanelButtonTool: case PE_PanelButtonBevel: case PE_FrameButtonBevel: { - QBrush editBrush = option->palette.brush(QPalette::Base); - if (editBrush.color() == Qt::transparent) { + if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) { const bool isPressed = option->state & QStyle::State_Sunken; const QS60StylePrivate::SkinElements skinElement = isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal; QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); } else { - QCommonStyle::drawPrimitive(element, option, painter, widget); + commonStyleDraws = true; } } break; @@ -2067,7 +2081,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_IndicatorSpinUp: if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) { QStyleOptionSpinBox optionSpinBox = *spinBox; - if (optionSpinBox.palette.base().color()==Qt::transparent) { + if (QS60StylePrivate::canDrawThemeBackground(optionSpinBox.palette.base())) { const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ? QS60StyleEnums::SP_QgnGrafScrollArrowUp : QS60StyleEnums::SP_QgnGrafScrollArrowDown; @@ -2075,12 +2089,12 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti optionSpinBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment ); QS60StylePrivate::drawSkinPart(part, painter, optionSpinBox.rect,flags); } else { - QCommonStyle::drawPrimitive(element, &optionSpinBox, painter, widget); + commonStyleDraws = true; } } #ifndef QT_NO_COMBOBOX else if (const QStyleOptionFrame *cmb = qstyleoption_cast<const QStyleOptionFrame *>(option)) { - if (cmb->palette.base().color()==Qt::transparent) { + if (QS60StylePrivate::canDrawThemeBackground( option->palette.base())) { // We want to draw down arrow here for comboboxes as well. const QS60StyleEnums::SkinParts part = QS60StyleEnums::SP_QgnGrafScrollArrowDown; QStyleOptionFrame comboBox = *cmb; @@ -2088,7 +2102,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti comboBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment ); QS60StylePrivate::drawSkinPart(part, painter, comboBox.rect,flags); } else { - QCommonStyle::drawPrimitive(element, cmb, painter, widget); + commonStyleDraws = true; } } #endif //QT_NO_COMBOBOX @@ -2119,12 +2133,10 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti || qobject_cast<const QMenu *> (widget) #endif //QT_NO_MENU ) { - if (option->palette.base().color()==Qt::transparent) { - QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_OptionsMenu; - QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); - } else { - QCommonStyle::drawPrimitive(element, option, painter, widget); - } + if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_OptionsMenu, painter, option->rect, flags); + else + commonStyleDraws = true; } break; case PE_FrameWindow: @@ -2256,6 +2268,9 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif //QT_NO_COLUMNVIEW case PE_FrameTabBarBase: // since tabs are in S60 always in navipane, let's use common style for tab base in Qt. default: + commonStyleDraws = true; + } + if (commonStyleDraws) { QCommonStyle::drawPrimitive(element, option, painter, widget); } } @@ -2387,6 +2402,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_RequestSoftwareInputPanel: retValue = RSIP_OnMouseClickAndAlreadyFocused; break; + case SH_FormLayoutWrapPolicy: + retValue = QFormLayout::WrapLongRows; + break; default: break; } diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index cfe87ac..ea86bb2 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -453,6 +453,10 @@ public: static QSize naviPaneSize(); + //Checks that the current brush is transparent or has BrushStyle NoBrush, + //so that theme graphic background can be drawn. + static bool canDrawThemeBackground(const QBrush &backgroundBrush); + private: static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter, const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags); diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp index f894b82..30f2f35 100644 --- a/src/gui/styles/qwindowsstyle.cpp +++ b/src/gui/styles/qwindowsstyle.cpp @@ -2989,7 +2989,6 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp #ifndef QT_NO_COMBOBOX case CC_ComboBox: if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { - p->save(); QBrush editBrush = cmb->palette.brush(QPalette::Base); if ((cmb->subControls & SC_ComboBoxFrame)) { if (cmb->frame) { @@ -3059,7 +3058,6 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp proxy()->drawPrimitive(PE_FrameFocusRect, &focus, p, widget); } } - p->restore(); } break; #endif // QT_NO_COMBOBOX diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index b8c1b33..3d3f1e1 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -1367,10 +1367,13 @@ qreal QFontMetricsF::rightBearing(QChar ch) const */ qreal QFontMetricsF::width(const QString &text) const { + int pos = text.indexOf(QLatin1Char('\x9c')); + int len = (pos != -1) ? pos : text.length(); + QTextEngine layout(text, d.data()); layout.ignoreBidi = true; layout.itemize(); - return layout.width(0, text.length()).toReal(); + return layout.width(0, len).toReal(); } /*! @@ -1587,7 +1590,7 @@ QRectF QFontMetricsF::boundingRect(const QRectF &rect, int flags, const QString& */ QSizeF QFontMetricsF::size(int flags, const QString &text, int tabStops, int *tabArray) const { - return boundingRect(QRectF(), flags, text, tabStops, tabArray).size(); + return boundingRect(QRectF(), flags | Qt::TextLongestVariant, text, tabStops, tabArray).size(); } /*! @@ -1642,7 +1645,20 @@ QRectF QFontMetricsF::tightBoundingRect(const QString &text) const */ QString QFontMetricsF::elidedText(const QString &text, Qt::TextElideMode mode, qreal width, int flags) const { - QStackTextEngine engine(text, QFont(d.data())); + QString _text = text; + if (!(flags & Qt::TextLongestVariant)) { + int posA = 0; + int posB = _text.indexOf(QLatin1Char('\x9c')); + while (posB >= 0) { + QString portion = _text.mid(posA, posB - posA); + if (size(flags, portion).width() <= width) + return portion; + posA = posB + 1; + posB = _text.indexOf(QLatin1Char('\x9c'), posA); + } + _text = _text.mid(posA); + } + QStackTextEngine engine(_text, QFont(d.data())); return engine.elidedText(mode, QFixed::fromReal(width), flags); } diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 9f3fe4f..3800224 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -2004,38 +2004,48 @@ QMenu *QLineEdit::createStandardContextMenu() Q_D(QLineEdit); QMenu *popup = new QMenu(this); popup->setObjectName(QLatin1String("qt_edit_menu")); + QAction *action = 0; - QAction *action = popup->addAction(QLineEdit::tr("&Undo") + ACCEL_KEY(QKeySequence::Undo)); - action->setEnabled(d->control->isUndoAvailable()); - connect(action, SIGNAL(triggered()), SLOT(undo())); + if (!isReadOnly()) { + action = popup->addAction(QLineEdit::tr("&Undo") + ACCEL_KEY(QKeySequence::Undo)); + action->setEnabled(d->control->isUndoAvailable()); + connect(action, SIGNAL(triggered()), SLOT(undo())); - action = popup->addAction(QLineEdit::tr("&Redo") + ACCEL_KEY(QKeySequence::Redo)); - action->setEnabled(d->control->isRedoAvailable()); - connect(action, SIGNAL(triggered()), SLOT(redo())); + action = popup->addAction(QLineEdit::tr("&Redo") + ACCEL_KEY(QKeySequence::Redo)); + action->setEnabled(d->control->isRedoAvailable()); + connect(action, SIGNAL(triggered()), SLOT(redo())); - popup->addSeparator(); + popup->addSeparator(); + } #ifndef QT_NO_CLIPBOARD - action = popup->addAction(QLineEdit::tr("Cu&t") + ACCEL_KEY(QKeySequence::Cut)); - action->setEnabled(!d->control->isReadOnly() && d->control->hasSelectedText() - && d->control->echoMode() == QLineEdit::Normal); - connect(action, SIGNAL(triggered()), SLOT(cut())); + if (!isReadOnly()) { + action = popup->addAction(QLineEdit::tr("Cu&t") + ACCEL_KEY(QKeySequence::Cut)); + action->setEnabled(!d->control->isReadOnly() && d->control->hasSelectedText() + && d->control->echoMode() == QLineEdit::Normal); + connect(action, SIGNAL(triggered()), SLOT(cut())); + } action = popup->addAction(QLineEdit::tr("&Copy") + ACCEL_KEY(QKeySequence::Copy)); action->setEnabled(d->control->hasSelectedText() && d->control->echoMode() == QLineEdit::Normal); connect(action, SIGNAL(triggered()), SLOT(copy())); - action = popup->addAction(QLineEdit::tr("&Paste") + ACCEL_KEY(QKeySequence::Paste)); - action->setEnabled(!d->control->isReadOnly() && !QApplication::clipboard()->text().isEmpty()); - connect(action, SIGNAL(triggered()), SLOT(paste())); + if (!isReadOnly()) { + action = popup->addAction(QLineEdit::tr("&Paste") + ACCEL_KEY(QKeySequence::Paste)); + action->setEnabled(!d->control->isReadOnly() && !QApplication::clipboard()->text().isEmpty()); + connect(action, SIGNAL(triggered()), SLOT(paste())); + } #endif - action = popup->addAction(QLineEdit::tr("Delete")); - action->setEnabled(!d->control->isReadOnly() && !d->control->text().isEmpty() && d->control->hasSelectedText()); - connect(action, SIGNAL(triggered()), d->control, SLOT(_q_deleteSelected())); + if (!isReadOnly()) { + action = popup->addAction(QLineEdit::tr("Delete")); + action->setEnabled(!d->control->isReadOnly() && !d->control->text().isEmpty() && d->control->hasSelectedText()); + connect(action, SIGNAL(triggered()), d->control, SLOT(_q_deleteSelected())); + } - popup->addSeparator(); + if (!popup->isEmpty()) + popup->addSeparator(); action = popup->addAction(QLineEdit::tr("Select All") + ACCEL_KEY(QKeySequence::SelectAll)); action->setEnabled(!d->control->text().isEmpty() && !d->control->allSelected()); diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp index 148da1b..d03c003 100644 --- a/src/gui/widgets/qlineedit_p.cpp +++ b/src/gui/widgets/qlineedit_p.cpp @@ -131,12 +131,12 @@ void QLineEditPrivate::init(const QString& txt) Q_Q(QLineEdit); control = new QLineControl(txt); control->setFont(q->font()); - QObject::connect(control, SIGNAL(textChanged(const QString &)), - q, SIGNAL(textChanged(const QString &))); - QObject::connect(control, SIGNAL(textEdited(const QString &)), - q, SLOT(_q_textEdited(const QString &))); - QObject::connect(control, SIGNAL(cursorPositionChanged(int, int)), - q, SLOT(_q_cursorPositionChanged(int, int))); + QObject::connect(control, SIGNAL(textChanged(QString)), + q, SIGNAL(textChanged(QString))); + QObject::connect(control, SIGNAL(textEdited(QString)), + q, SLOT(_q_textEdited(QString))); + QObject::connect(control, SIGNAL(cursorPositionChanged(int,int)), + q, SLOT(_q_cursorPositionChanged(int,int))); QObject::connect(control, SIGNAL(selectionChanged()), q, SIGNAL(selectionChanged())); QObject::connect(control, SIGNAL(accepted()), @@ -147,17 +147,17 @@ void QLineEditPrivate::init(const QString& txt) QObject::connect(control, SIGNAL(editFocusChange(bool)), q, SLOT(_q_editFocusChange(bool))); #endif - QObject::connect(control, SIGNAL(cursorPositionChanged(int, int)), + QObject::connect(control, SIGNAL(cursorPositionChanged(int,int)), q, SLOT(updateMicroFocus())); // for now, going completely overboard with updates. QObject::connect(control, SIGNAL(selectionChanged()), q, SLOT(update())); - QObject::connect(control, SIGNAL(displayTextChanged(const QString &)), + QObject::connect(control, SIGNAL(displayTextChanged(QString)), q, SLOT(update())); - QObject::connect(control, SIGNAL(updateNeeded(const QRect &)), + QObject::connect(control, SIGNAL(updateNeeded(QRect)), q, SLOT(update())); QStyleOptionFrameV2 opt; diff --git a/src/gui/widgets/qmdiarea.cpp b/src/gui/widgets/qmdiarea.cpp index 60c5d7b..b3288c3 100644 --- a/src/gui/widgets/qmdiarea.cpp +++ b/src/gui/widgets/qmdiarea.cpp @@ -841,8 +841,8 @@ void QMdiAreaPrivate::appendChild(QMdiSubWindow *child) child->installEventFilter(q); QObject::connect(child, SIGNAL(aboutToActivate()), q, SLOT(_q_deactivateAllWindows())); - QObject::connect(child, SIGNAL(windowStateChanged(Qt::WindowStates, Qt::WindowStates)), - q, SLOT(_q_processWindowStateChanged(Qt::WindowStates, Qt::WindowStates))); + QObject::connect(child, SIGNAL(windowStateChanged(Qt::WindowStates,Qt::WindowStates)), + q, SLOT(_q_processWindowStateChanged(Qt::WindowStates,Qt::WindowStates))); } /*! diff --git a/src/gui/widgets/qmdisubwindow.cpp b/src/gui/widgets/qmdisubwindow.cpp index b5e28da..350f8579 100644 --- a/src/gui/widgets/qmdisubwindow.cpp +++ b/src/gui/widgets/qmdisubwindow.cpp @@ -2268,8 +2268,8 @@ QMdiSubWindow::QMdiSubWindow(QWidget *parent, Qt::WindowFlags flags) else d->menuIcon = windowIcon(); #endif - connect(qApp, SIGNAL(focusChanged(QWidget *, QWidget *)), - this, SLOT(_q_processFocusChanged(QWidget *, QWidget *))); + connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)), + this, SLOT(_q_processFocusChanged(QWidget*,QWidget*))); } /*! diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index fc88d06..761a060 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -654,6 +654,24 @@ void QMenuPrivate::_q_overrideMenuActionDestroyed() menuAction=defaultMenuAction; } + +void QMenuPrivate::updateLayoutDirection() +{ + Q_Q(QMenu); + //we need to mimic the cause of the popup's layout direction + //to allow setting it on a mainwindow for example + //we call setLayoutDirection_helper to not overwrite a user-defined value + if (!q->testAttribute(Qt::WA_SetLayoutDirection)) { + if (QWidget *w = causedPopup.widget) + setLayoutDirection_helper(w->layoutDirection()); + else if (QWidget *w = q->parentWidget()) + setLayoutDirection_helper(w->layoutDirection()); + else + setLayoutDirection_helper(QApplication::layoutDirection()); + } +} + + /*! Returns the action associated with this menu. */ @@ -1797,6 +1815,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction) d->tearoffHighlighted = 0; d->motions = 0; d->doChildEffects = true; + d->updateLayoutDirection(); #ifndef QT_NO_MENUBAR // if this menu is part of a chain attached to a QMenuBar, set the @@ -2347,6 +2366,9 @@ QMenu::event(QEvent *e) { Q_D(QMenu); switch (e->type()) { + case QEvent::Polish: + d->updateLayoutDirection(); + break; case QEvent::ShortcutOverride: { QKeyEvent *kev = static_cast<QKeyEvent*>(e); if (kev->key() == Qt::Key_Up || kev->key() == Qt::Key_Down diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h index c021063..5757885 100644 --- a/src/gui/widgets/qmenu_p.h +++ b/src/gui/widgets/qmenu_p.h @@ -292,6 +292,9 @@ public: bool hasMouseMoved(const QPoint &globalPos); + void updateLayoutDirection(); + + //menu fading/scrolling effects bool doChildEffects; diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index b1ff662..e50de02 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -1934,7 +1934,7 @@ void QMenuBar::setDefaultAction(QAction *act) if (qt_wince_is_mobile()) if (d->defaultAction) { disconnect(d->defaultAction, SIGNAL(changed()), this, SLOT(_q_updateDefaultAction())); - disconnect(d->defaultAction, SIGNAL(destroyed ()), this, SLOT(_q_updateDefaultAction())); + disconnect(d->defaultAction, SIGNAL(destroyed()), this, SLOT(_q_updateDefaultAction())); } #endif d->defaultAction = act; diff --git a/src/gui/widgets/qtabwidget.cpp b/src/gui/widgets/qtabwidget.cpp index d22bd54..49651a3 100644 --- a/src/gui/widgets/qtabwidget.cpp +++ b/src/gui/widgets/qtabwidget.cpp @@ -699,8 +699,8 @@ void QTabWidget::setTabBar(QTabBar* tb) setFocusProxy(d->tabs); connect(d->tabs, SIGNAL(currentChanged(int)), this, SLOT(_q_showTab(int))); - connect(d->tabs, SIGNAL(tabMoved(int, int)), - this, SLOT(_q_tabMoved(int, int))); + connect(d->tabs, SIGNAL(tabMoved(int,int)), + this, SLOT(_q_tabMoved(int,int))); if (d->tabs->tabsClosable()) connect(d->tabs, SIGNAL(tabCloseRequested(int)), this, SIGNAL(tabCloseRequested(int))); |