remove unused window filepath setter and getter of QWidget class

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2020-06-16 20:39:24 +00:00
parent 68c32ce1e7
commit 231dc75f8a
6 changed files with 6 additions and 80 deletions

View file

@ -476,7 +476,6 @@ void FormWindow::setMainContainer(QWidget *w)
sheet->setVisible(sheet->indexOf(QLatin1String("windowIcon")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowIcon")), true);
sheet->setVisible(sheet->indexOf(QLatin1String("windowModality")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowModality")), true);
sheet->setVisible(sheet->indexOf(QLatin1String("windowOpacity")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowOpacity")), true);
sheet->setVisible(sheet->indexOf(QLatin1String("windowFilePath")), true);
// ### generalize // ### generalize
} }

View file

@ -519,7 +519,6 @@ QDesignerPropertySheet::PropertyType QDesignerPropertySheet::propertyTypeFromNam
propertyTypeHash.insert(QLatin1String("accessibleDescription"), PropertyAccessibility); propertyTypeHash.insert(QLatin1String("accessibleDescription"), PropertyAccessibility);
propertyTypeHash.insert(QLatin1String("windowTitle"), PropertyWindowTitle); propertyTypeHash.insert(QLatin1String("windowTitle"), PropertyWindowTitle);
propertyTypeHash.insert(QLatin1String("windowIcon"), PropertyWindowIcon); propertyTypeHash.insert(QLatin1String("windowIcon"), PropertyWindowIcon);
propertyTypeHash.insert(QLatin1String("windowFilePath"), PropertyWindowFilePath);
propertyTypeHash.insert(QLatin1String("windowOpacity"), PropertyWindowOpacity); propertyTypeHash.insert(QLatin1String("windowOpacity"), PropertyWindowOpacity);
propertyTypeHash.insert(QLatin1String("windowIconText"), PropertyWindowIconText); propertyTypeHash.insert(QLatin1String("windowIconText"), PropertyWindowIconText);
propertyTypeHash.insert(QLatin1String("windowModality"), PropertyWindowModality); propertyTypeHash.insert(QLatin1String("windowModality"), PropertyWindowModality);
@ -1435,7 +1434,6 @@ bool QDesignerPropertySheet::isVisible(int index) const
switch (type) { switch (type) {
case PropertyWindowTitle: case PropertyWindowTitle:
case PropertyWindowIcon: case PropertyWindowIcon:
case PropertyWindowFilePath:
case PropertyWindowOpacity: case PropertyWindowOpacity:
case PropertyWindowIconText: case PropertyWindowIconText:
case PropertyWindowModified: case PropertyWindowModified:

View file

@ -163,7 +163,6 @@ public:
PropertyCheckable, PropertyCheckable,
PropertyWindowTitle, PropertyWindowTitle,
PropertyWindowIcon, PropertyWindowIcon,
PropertyWindowFilePath,
PropertyWindowOpacity, PropertyWindowOpacity,
PropertyWindowIconText, PropertyWindowIconText,
PropertyWindowModality, PropertyWindowModality,

View file

@ -5076,9 +5076,8 @@ static QString constructWindowTitleFromFilePath(const QString &filePath)
\brief the window title (caption) \brief the window title (caption)
This property only makes sense for top-level widgets, such as 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 windows and dialogs. If no caption has been set, the title is an
\l windowFilePath. If neither of these is set, then the title is empty string.
an empty string.
If you use the \l windowModified mechanism, the window title must If you use the \l windowModified mechanism, the window title must
contain a "[*]" placeholder, which indicates where the '*' should 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 windowModified property is false (the default), the placeholder
is simply removed. is simply removed.
\sa windowIcon, windowIconText, windowModified, windowFilePath \sa windowIcon, windowIconText, windowModified
*/ */
QString QWidget::windowTitle() const QString QWidget::windowTitle() const
{ {
@ -5095,8 +5094,6 @@ QString QWidget::windowTitle() const
if (d->extra && d->extra->topextra) { if (d->extra && d->extra->topextra) {
if (!d->extra->topextra->caption.isEmpty()) if (!d->extra->topextra->caption.isEmpty())
return d->extra->topextra->caption; return d->extra->topextra->caption;
if (!d->extra->topextra->filePath.isEmpty())
return constructWindowTitleFromFilePath(d->extra->topextra->filePath);
} }
return QString(); return QString();
} }
@ -5261,63 +5258,6 @@ QString QWidget::windowIconText() const
return (d->extra && d->extra->topextra) ? d->extra->topextra->iconText : QString(); return (d->extra && d->extra->topextra) ? d->extra->topextra->iconText : QString();
} }
/*!
\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. Returns the window's role, or an empty string.

View file

@ -174,7 +174,6 @@ class Q_GUI_EXPORT QWidget : public QObject, public QPaintDevice
Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
#endif #endif
Q_PROPERTY(QLocale locale READ locale WRITE setLocale RESET unsetLocale) Q_PROPERTY(QLocale locale READ locale WRITE setLocale RESET unsetLocale)
Q_PROPERTY(QString windowFilePath READ windowFilePath WRITE setWindowFilePath DESIGNABLE isWindow)
public: public:
enum RenderFlag { enum RenderFlag {
@ -214,9 +213,8 @@ public Q_SLOTS:
void setDisabled(bool); void setDisabled(bool);
void setWindowModified(bool); void setWindowModified(bool);
// Widget coordinates
public: public:
// Widget coordinates
QRect frameGeometry() const; QRect frameGeometry() const;
const QRect &geometry() const; const QRect &geometry() const;
QRect normalGeometry() const; QRect normalGeometry() const;
@ -247,7 +245,6 @@ public:
void setMaximumWidth(int maxw); void setMaximumWidth(int maxw);
void setMaximumHeight(int maxh); void setMaximumHeight(int maxh);
QSize sizeIncrement() const; QSize sizeIncrement() const;
void setSizeIncrement(const QSize &); void setSizeIncrement(const QSize &);
void setSizeIncrement(int w, int h); void setSizeIncrement(int w, int h);
@ -261,7 +258,6 @@ public:
void setFixedHeight(int h); void setFixedHeight(int h);
// Widget coordinate mapping // Widget coordinate mapping
QPoint mapToGlobal(const QPoint &) const; QPoint mapToGlobal(const QPoint &) const;
QPoint mapFromGlobal(const QPoint &) const; QPoint mapFromGlobal(const QPoint &) const;
QPoint mapToParent(const QPoint &) const; QPoint mapToParent(const QPoint &) const;
@ -336,8 +332,6 @@ public:
QString windowIconText() const; QString windowIconText() const;
void setWindowRole(const QString &); void setWindowRole(const QString &);
QString windowRole() const; QString windowRole() const;
void setWindowFilePath(const QString &filePath);
QString windowFilePath() const;
void setWindowOpacity(qreal level); void setWindowOpacity(qreal level);
qreal windowOpacity() const; qreal windowOpacity() const;
@ -431,7 +425,6 @@ public:
public Q_SLOTS: public Q_SLOTS:
// Widget management functions // Widget management functions
virtual void setVisible(bool visible); virtual void setVisible(bool visible);
inline void setHidden(bool hidden) { setVisible(!hidden); } inline void setHidden(bool hidden) { setVisible(!hidden); }
inline void show() { setVisible(true); } inline void show() { setVisible(true); }
@ -497,17 +490,16 @@ public:
void scroll(int dx, int dy, const QRect&); void scroll(int dx, int dy, const QRect&);
// Misc. functions // Misc. functions
QWidget *focusWidget() const; QWidget *focusWidget() const;
QWidget *nextInFocusChain() const; QWidget *nextInFocusChain() const;
QWidget *previousInFocusChain() const; QWidget *previousInFocusChain() const;
// drag and drop // Drag and drop
bool acceptDrops() const; bool acceptDrops() const;
void setAcceptDrops(bool on); void setAcceptDrops(bool on);
#ifndef QT_NO_ACTION #ifndef QT_NO_ACTION
//actions // Actions
void addAction(QAction *action); void addAction(QAction *action);
void addActions(const QList<QAction*> &actions); void addActions(const QList<QAction*> &actions);
void insertAction(QAction *before, QAction *action); void insertAction(QAction *before, QAction *action);
@ -543,7 +535,6 @@ public:
void ensurePolished() const; void ensurePolished() const;
bool isAncestorOf(const QWidget *child) const; bool isAncestorOf(const QWidget *child) const;
bool autoFillBackground() const; bool autoFillBackground() const;
void setAutoFillBackground(bool enabled); void setAutoFillBackground(bool enabled);

View file

@ -134,7 +134,6 @@ struct QTLWExtra {
QString caption; // widget caption QString caption; // widget caption
QString iconText; // widget icon text QString iconText; // widget icon text
QString role; // widget role QString role; // widget role
QString filePath; // widget file path
// Other variables. // Other variables.
short incw, inch; // size increments short incw, inch; // size increments