From: Ivailo Monev Date: Tue, 16 Jun 2020 20:39:24 +0000 (+0000) Subject: remove unused window filepath setter and getter of QWidget class X-Git-Tag: 4.12.0~3781 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=231dc75f8a1f84db6093de7ab2a279fa0e36bd3f;p=kde%2FKatie.git remove unused window filepath setter and getter of QWidget class Signed-off-by: Ivailo Monev --- diff --git a/src/designer/components/formeditor/formwindow.cpp b/src/designer/components/formeditor/formwindow.cpp index 063bb285b..f1edc01f7 100644 --- a/src/designer/components/formeditor/formwindow.cpp +++ b/src/designer/components/formeditor/formwindow.cpp @@ -476,7 +476,6 @@ void FormWindow::setMainContainer(QWidget *w) sheet->setVisible(sheet->indexOf(QLatin1String("windowIcon")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowModality")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowOpacity")), true); - sheet->setVisible(sheet->indexOf(QLatin1String("windowFilePath")), true); // ### generalize } diff --git a/src/designer/shared/qdesigner_propertysheet.cpp b/src/designer/shared/qdesigner_propertysheet.cpp index b8f731965..08f78e590 100644 --- a/src/designer/shared/qdesigner_propertysheet.cpp +++ b/src/designer/shared/qdesigner_propertysheet.cpp @@ -519,7 +519,6 @@ QDesignerPropertySheet::PropertyType QDesignerPropertySheet::propertyTypeFromNam propertyTypeHash.insert(QLatin1String("accessibleDescription"), PropertyAccessibility); propertyTypeHash.insert(QLatin1String("windowTitle"), PropertyWindowTitle); propertyTypeHash.insert(QLatin1String("windowIcon"), PropertyWindowIcon); - propertyTypeHash.insert(QLatin1String("windowFilePath"), PropertyWindowFilePath); propertyTypeHash.insert(QLatin1String("windowOpacity"), PropertyWindowOpacity); propertyTypeHash.insert(QLatin1String("windowIconText"), PropertyWindowIconText); propertyTypeHash.insert(QLatin1String("windowModality"), PropertyWindowModality); @@ -1435,7 +1434,6 @@ bool QDesignerPropertySheet::isVisible(int index) const switch (type) { case PropertyWindowTitle: case PropertyWindowIcon: - case PropertyWindowFilePath: case PropertyWindowOpacity: case PropertyWindowIconText: case PropertyWindowModified: diff --git a/src/designer/shared/qdesigner_propertysheet_p.h b/src/designer/shared/qdesigner_propertysheet_p.h index 305b4ab8c..d22d0de18 100644 --- a/src/designer/shared/qdesigner_propertysheet_p.h +++ b/src/designer/shared/qdesigner_propertysheet_p.h @@ -163,7 +163,6 @@ public: PropertyCheckable, PropertyWindowTitle, PropertyWindowIcon, - PropertyWindowFilePath, PropertyWindowOpacity, PropertyWindowIconText, PropertyWindowModality, diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 12b087650..4484687d9 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5076,9 +5076,8 @@ static QString constructWindowTitleFromFilePath(const QString &filePath) \brief the window title (caption) This property only makes sense for top-level widgets, such as - windows and dialogs. If no caption has been set, the title is based of the - \l windowFilePath. If neither of these is set, then the title is - an empty string. + windows and dialogs. If no caption has been set, the title is an + empty string. If you use the \l windowModified mechanism, the window title must contain a "[*]" placeholder, which indicates where the '*' should @@ -5087,7 +5086,7 @@ static QString constructWindowTitleFromFilePath(const QString &filePath) windowModified property is false (the default), the placeholder is simply removed. - \sa windowIcon, windowIconText, windowModified, windowFilePath + \sa windowIcon, windowIconText, windowModified */ QString QWidget::windowTitle() const { @@ -5095,8 +5094,6 @@ QString QWidget::windowTitle() const if (d->extra && d->extra->topextra) { if (!d->extra->topextra->caption.isEmpty()) return d->extra->topextra->caption; - if (!d->extra->topextra->filePath.isEmpty()) - return constructWindowTitleFromFilePath(d->extra->topextra->filePath); } return QString(); } @@ -5262,63 +5259,6 @@ QString QWidget::windowIconText() const } /*! - \property QWidget::windowFilePath - \since 4.4 - \brief the file path associated with a widget - - This property only makes sense for windows. It associates a file path with - a window. If you set the file path, but have not set the window title, Qt - sets the window title to contain a string created using the following - components. - - On Mac OS X: - - \list - \o The file name of the specified path, obtained using QFileInfo::fileName(). - \endlist - - On Windows and X11: - - \list - \o The file name of the specified path, obtained using QFileInfo::fileName(). - \o An optional \c{*} character, if the \l windowModified property is set. - \o The \c{0x2014} unicode character, padded either side by spaces. - \o The application name, obtained from the application's - \l{QCoreApplication::}{applicationName} property. - \endlist - - If the window title is set at any point, then the window title takes precedence and - will be shown instead of the file path string. - - If no file path is set, this property contains an empty string. - - By default, this property contains an empty string. - - \sa windowTitle, windowIcon -*/ - -QString QWidget::windowFilePath() const -{ - Q_D(const QWidget); - return (d->extra && d->extra->topextra) ? d->extra->topextra->filePath : QString(); -} - -void QWidget::setWindowFilePath(const QString &filePath) -{ - if (filePath == windowFilePath()) - return; - - Q_D(QWidget); - - d->createTLExtra(); - d->extra->topextra->filePath = filePath; - - if (d->extra->topextra->caption.isEmpty()) { - d->setWindowTitle_helper(windowTitle()); - } -} - -/*! Returns the window's role, or an empty string. \sa windowIcon, windowTitle diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 7ad993fc3..047babb3e 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -174,7 +174,6 @@ class Q_GUI_EXPORT QWidget : public QObject, public QPaintDevice Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) #endif Q_PROPERTY(QLocale locale READ locale WRITE setLocale RESET unsetLocale) - Q_PROPERTY(QString windowFilePath READ windowFilePath WRITE setWindowFilePath DESIGNABLE isWindow) public: enum RenderFlag { @@ -214,9 +213,8 @@ public Q_SLOTS: void setDisabled(bool); void setWindowModified(bool); - // Widget coordinates - public: + // Widget coordinates QRect frameGeometry() const; const QRect &geometry() const; QRect normalGeometry() const; @@ -247,7 +245,6 @@ public: void setMaximumWidth(int maxw); void setMaximumHeight(int maxh); - QSize sizeIncrement() const; void setSizeIncrement(const QSize &); void setSizeIncrement(int w, int h); @@ -261,7 +258,6 @@ public: void setFixedHeight(int h); // Widget coordinate mapping - QPoint mapToGlobal(const QPoint &) const; QPoint mapFromGlobal(const QPoint &) const; QPoint mapToParent(const QPoint &) const; @@ -336,8 +332,6 @@ public: QString windowIconText() const; void setWindowRole(const QString &); QString windowRole() const; - void setWindowFilePath(const QString &filePath); - QString windowFilePath() const; void setWindowOpacity(qreal level); qreal windowOpacity() const; @@ -431,7 +425,6 @@ public: public Q_SLOTS: // Widget management functions - virtual void setVisible(bool visible); inline void setHidden(bool hidden) { setVisible(!hidden); } inline void show() { setVisible(true); } @@ -497,17 +490,16 @@ public: void scroll(int dx, int dy, const QRect&); // Misc. functions - QWidget *focusWidget() const; QWidget *nextInFocusChain() const; QWidget *previousInFocusChain() const; - // drag and drop + // Drag and drop bool acceptDrops() const; void setAcceptDrops(bool on); #ifndef QT_NO_ACTION - //actions + // Actions void addAction(QAction *action); void addActions(const QList &actions); void insertAction(QAction *before, QAction *action); @@ -543,7 +535,6 @@ public: void ensurePolished() const; bool isAncestorOf(const QWidget *child) const; - bool autoFillBackground() const; void setAutoFillBackground(bool enabled); diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 0ff6f106b..57fd1f710 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -134,7 +134,6 @@ struct QTLWExtra { QString caption; // widget caption QString iconText; // widget icon text QString role; // widget role - QString filePath; // widget file path // Other variables. short incw, inch; // size increments