OSDN Git Service

remove unused window filepath setter and getter of QWidget class
authorIvailo Monev <xakepa10@laimg.moc>
Tue, 16 Jun 2020 20:39:24 +0000 (20:39 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Tue, 16 Jun 2020 20:39:24 +0000 (20:39 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/designer/components/formeditor/formwindow.cpp
src/designer/shared/qdesigner_propertysheet.cpp
src/designer/shared/qdesigner_propertysheet_p.h
src/gui/kernel/qwidget.cpp
src/gui/kernel/qwidget.h
src/gui/kernel/qwidget_p.h

index 063bb28..f1edc01 100644 (file)
@@ -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
     }
 
index b8f7319..08f78e5 100644 (file)
@@ -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:
index 305b4ab..d22d0de 100644 (file)
@@ -163,7 +163,6 @@ public:
                         PropertyCheckable,
                         PropertyWindowTitle,
                         PropertyWindowIcon,
-                        PropertyWindowFilePath,
                         PropertyWindowOpacity,
                         PropertyWindowIconText,
                         PropertyWindowModality,
index 12b0876..4484687 100644 (file)
@@ -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
index 7ad993f..047babb 100644 (file)
@@ -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<QAction*> &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);
 
index 0ff6f10..57fd1f7 100644 (file)
@@ -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