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
}
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);
switch (type) {
case PropertyWindowTitle:
case PropertyWindowIcon:
- case PropertyWindowFilePath:
case PropertyWindowOpacity:
case PropertyWindowIconText:
case PropertyWindowModified:
PropertyCheckable,
PropertyWindowTitle,
PropertyWindowIcon,
- PropertyWindowFilePath,
PropertyWindowOpacity,
PropertyWindowIconText,
PropertyWindowModality,
\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
windowModified property is false (the default), the placeholder
is simply removed.
- \sa windowIcon, windowIconText, windowModified, windowFilePath
+ \sa windowIcon, windowIconText, windowModified
*/
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();
}
}
/*!
- \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
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 {
void setDisabled(bool);
void setWindowModified(bool);
- // Widget coordinates
-
public:
+ // Widget coordinates
QRect frameGeometry() const;
const QRect &geometry() const;
QRect normalGeometry() const;
void setMaximumWidth(int maxw);
void setMaximumHeight(int maxh);
-
QSize sizeIncrement() const;
void setSizeIncrement(const QSize &);
void setSizeIncrement(int w, int h);
void setFixedHeight(int h);
// Widget coordinate mapping
-
QPoint mapToGlobal(const QPoint &) const;
QPoint mapFromGlobal(const QPoint &) const;
QPoint mapToParent(const QPoint &) const;
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;
public Q_SLOTS:
// Widget management functions
-
virtual void setVisible(bool visible);
inline void setHidden(bool hidden) { setVisible(!hidden); }
inline void show() { setVisible(true); }
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);
void ensurePolished() const;
bool isAncestorOf(const QWidget *child) const;
-
bool autoFillBackground() const;
void setAutoFillBackground(bool enabled);
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