Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

Compatibility Members for QWidget

The following members of classQWidgetare part of the Qt compatibility layer. We advise against using them in new code.

Public Types

enumBackgroundOrigin { WidgetOrigin, ParentOrigin, WindowOrigin, AncestorOrigin }

Public Functions

Qt::BackgroundModebackgroundMode() const
QStringcaption() const
QWidget *childAt(int x, int y, bool includeThis) const
QWidget *childAt(const QPoint & p, bool includeThis) const
boolclose(bool alsoDelete)
QColorGroupcolorGroup() const
voidconstPolish() const
voiddrawText(const QPoint & p, const QString & s)
voiddrawText(int x, int y, const QString & s)
voiderase()
voiderase(int x, int y, int w, int h)
voiderase(const QRect & rect)
voiderase(const QRegion & rgn)
boolhasMouse() const
const QPixmap *icon() const
QStringiconText() const
voidiconify()
boolisDesktop() const
boolisDialog() const
boolisInputMethodEnabled() const
boolisPopup() const
boolisShown() const
boolisUpdatesEnabled() const
boolisVisibleToTLW() const
boolownCursor() const
boolownFont() const
boolownPalette() const
QWidget *parentWidget(bool sameWindow) const
voidpolish()
voidrecreate(QWidget * parent, Qt::WindowFlags f, const QPoint & p, bool showIt = false)
voidrepaint(bool b)
voidrepaint(int x, int y, int w, int h, bool b)
voidrepaint(const QRect & r, bool b)
voidrepaint(const QRegion & rgn, bool b)
voidreparent(QWidget * parent, Qt::WindowFlags f, const QPoint & p, bool showIt = false)
voidreparent(QWidget * parent, const QPoint & p, bool showIt = false)
voidsetActiveWindow()
voidsetBackgroundColor(const QColor & color)
voidsetBackgroundMode(Qt::BackgroundMode widgetBackground, Qt::BackgroundMode paletteBackground = Qt::PaletteBackground)
voidsetBackgroundPixmap(const QPixmap & pixmap)
voidsetCaption(const QString & c)
voidsetEraseColor(const QColor & color)
voidsetErasePixmap(const QPixmap & pixmap)
voidsetFont(const QFont & f, bool b)
voidsetIcon(const QPixmap & i)
voidsetIconText(const QString & it)
voidsetInputMethodEnabled(bool enabled)
voidsetKeyCompression(bool b)
voidsetPalette(const QPalette & p, bool b)
voidsetPaletteBackgroundColor(const QColor & color)
voidsetPaletteBackgroundPixmap(const QPixmap & pixmap)
voidsetPaletteForegroundColor(const QColor & color)
voidsetSizePolicy(QSizePolicy::Policy hor, QSizePolicy::Policy ver, bool hfw)
QStyle *setStyle(const QString & style)
voidunsetFont()
voidunsetPalette()
QRectvisibleRect() const

Public Slots

voidsetShown(bool shown)

Static Public Members

QWidgetMapper *wmapper()

Member Type Documentation

enum QWidget::BackgroundOrigin

ConstantValue
QWidget::WidgetOrigin0
QWidget::ParentOrigin1
QWidget::WindowOrigin2
QWidget::AncestorOrigin3

Member Function Documentation

Qt::BackgroundMode QWidget::backgroundMode() const

Returns the color role used for painting the widget's background.

UseQPalette(backgroundRole(()) instead.

See alsosetBackgroundMode().

QString QWidget::caption() const

UsewindowTitle() instead.

See alsosetCaption().

QWidget * QWidget::childAt(int x,int y,bool includeThis) const

Use thechildAt() overload that doesn't have anincludeThis parameter.

For example, if you have code like

return widget->childAt(x, y, true);

you can rewrite it as

QWidget*child= widget->childAt(x, y,true);if (child)return child;if (widget->rect().contains(x, y))return widget;

QWidget * QWidget::childAt(constQPoint & p,bool includeThis) const

Use the single point argument overload instead.

bool QWidget::close(bool alsoDelete)

Closes the widget.

Use the no-argument overload instead.

QColorGroup QWidget::colorGroup() const

UseQColorGroup(palette()) instead.

void QWidget::constPolish() const

UseensurePolished() instead.

void QWidget::drawText(constQPoint & p, constQString & s)

Drawing may only take place in aQPaintEvent. OverloadpaintEvent() to do your drawing and callupdate() to schedule a replaint whenever necessary. See alsoQPainter.

void QWidget::drawText(int x,int y, constQString & s)

Drawing may only take place in aQPaintEvent. OverloadpaintEvent() to do your drawing and callupdate() to schedule a replaint whenever necessary. See alsoQPainter.

void QWidget::erase()

Drawing may only take place in aQPaintEvent. OverloadpaintEvent() to do your erasing and callupdate() to schedule a replaint whenever necessary. See alsoQPainter.

void QWidget::erase(int x,int y,int w,int h)

Drawing may only take place in aQPaintEvent. OverloadpaintEvent() to do your erasing and callupdate() to schedule a replaint whenever necessary. See alsoQPainter.

void QWidget::erase(constQRect & rect)

Drawing may only take place in aQPaintEvent. OverloadpaintEvent() to do your erasing and callupdate() to schedule a replaint whenever necessary. See alsoQPainter.

void QWidget::erase(constQRegion & rgn)

This is an overloaded function.

Clear the given region,rgn.

Drawing may only take place in aQPaintEvent. OverloadpaintEvent() to do your erasing and callupdate() to schedule a replaint whenever necessary. See alsoQPainter.

bool QWidget::hasMouse() const

UsetestAttribute(Qt::WA_UnderMouse) instead.

constQPixmap * QWidget::icon() const

Return's the widget's icon.

UsewindowIcon() instead.

See alsosetIcon().

QString QWidget::iconText() const

UsewindowIconText() instead.

See alsosetIconText().

void QWidget::iconify()

UseshowMinimized() instead.

bool QWidget::isDesktop() const

UsewindowType() ==Qt::Desktop instead.

bool QWidget::isDialog() const

UsewindowType() ==Qt::Dialog instead.

bool QWidget::isInputMethodEnabled() const

UsetestAttribute(Qt::WA_InputMethodEnabled) instead.

bool QWidget::isPopup() const

UsewindowType() ==Qt::Popup instead.

bool QWidget::isShown() const

Use !isHidden() instead (notice the exclamation mark), or useisVisible() to check whether the widget is visible.

bool QWidget::isUpdatesEnabled() const

Use theupdatesEnabled property instead.

bool QWidget::isVisibleToTLW() const

UseisVisible() instead.

bool QWidget::ownCursor() const

UsetestAttribute(Qt::WA_SetCursor) instead.

bool QWidget::ownFont() const

UsetestAttribute(Qt::WA_SetFont) instead.

bool QWidget::ownPalette() const

UsetestAttribute(Qt::WA_SetPalette) instead.

QWidget * QWidget::parentWidget(bool sameWindow) const

Use the no-argument overload instead.

void QWidget::polish()

UseensurePolished() instead.

void QWidget::recreate(QWidget * parent,Qt::WindowFlags f, constQPoint & p,bool showIt = false)

UsesetParent() to change the parent or the widget's widget flags; usemove() to move the widget, and useshow() to show the widget.

void QWidget::repaint(bool b)

The boolean parameterb is ignored. Use the no-argument overload instead.

void QWidget::repaint(int x,int y,int w,int h,bool b)

The boolean parameterb is ignored. Use the four-argument overload instead.

void QWidget::repaint(constQRect & r,bool b)

The boolean parameterb is ignored. Use the single rect-argument overload instead.

void QWidget::repaint(constQRegion & rgn,bool b)

The boolean parameterb is ignored. Use the single region-argument overload instead.

void QWidget::reparent(QWidget * parent,Qt::WindowFlags f, constQPoint & p,bool showIt = false)

UsesetParent() to change the parent or the widget's widget flags; usemove() to move the widget, and useshow() to show the widget.

void QWidget::reparent(QWidget * parent, constQPoint & p,bool showIt = false)

UsesetParent() to change the parent; usemove() to move the widget, and useshow() to show the widget.

void QWidget::setActiveWindow()

UseactivateWindow() instead.

See alsoisActiveWindow().

void QWidget::setBackgroundColor(constQColor & color)

Use the palette instead.

For example, if you have code like

widget->setBackgroundColor(color);

you can rewrite it as

QPalette palette;palette.setColor(widget->backgroundRole(), color);widget->setPalette(palette);

void QWidget::setBackgroundMode(Qt::BackgroundMode widgetBackground,Qt::BackgroundMode paletteBackground = Qt::PaletteBackground)

Sets the color role used for painting the widget's background to background modewidgetBackground. ThepaletteBackground mode parameter is ignored.

See alsobackgroundMode().

void QWidget::setBackgroundPixmap(constQPixmap & pixmap)

Use the palette instead.

For example, if you have code like

widget->setBackgroundPixmap(pixmap);

you can rewrite it as

QPalette palette;palette.setBrush(widget->backgroundRole(),QBrush(pixmap));widget->setPalette(palette);

void QWidget::setCaption(constQString & c)

UsesetWindowTitle() instead.

See alsocaption().

void QWidget::setEraseColor(constQColor & color)

Use the palette instead.

For example, if you have code like

widget->setEraseColor(color);

you can rewrite it as

QPalette palette;palette.setColor(widget->backgroundRole(), color);widget->setPalette(palette);

void QWidget::setErasePixmap(constQPixmap & pixmap)

Use the palette instead.

For example, if you have code like

widget->setErasePixmap(pixmap);

you can rewrite it as

QPalette palette;palette.setBrush(widget->backgroundRole(),QBrush(pixmap));widget->setPalette(palette);

void QWidget::setFont(constQFont & f,bool b)

Use the single-argument overload instead.

void QWidget::setIcon(constQPixmap & i)

UsesetWindowIcon() instead.

See alsoicon().

void QWidget::setIconText(constQString & it)

UsesetWindowIconText() instead.

See alsoiconText().

void QWidget::setInputMethodEnabled(bool enabled)

UsesetAttribute(Qt::WA_InputMethodEnabled,enabled) instead.

See alsoisInputMethodEnabled().

void QWidget::setKeyCompression(bool b)

UsesetAttribute(Qt::WA_KeyCompression, b) instead.

void QWidget::setPalette(constQPalette & p,bool b)

Use the single-argument overload instead.

void QWidget::setPaletteBackgroundColor(constQColor & color)

Use the palette directly.

For example, if you have code like

widget->setPaletteBackgroundColor(color);

you can rewrite it as

QPalette palette;palette.setColor(widget->backgroundRole(), color);widget->setPalette(palette);

void QWidget::setPaletteBackgroundPixmap(constQPixmap & pixmap)

Use the palette directly.

For example, if you have code like

widget->setPaletteBackgroundPixmap(pixmap);

you can rewrite it as

QPalette palette;palette.setBrush(widget->backgroundRole(),QBrush(pixmap));widget->setPalette(palette);

void QWidget::setPaletteForegroundColor(constQColor & color)

Use the palette directly.

For example, if you have code like

widget->setPaletteForegroundColor(color);

you can rewrite it as

QPalette palette;palette.setColor(widget->foregroundRole(), color);widget->setPalette(palette);

[slot]void QWidget::setShown(bool shown)

UsesetVisible(shown) instead.

See alsoisShown().

void QWidget::setSizePolicy(QSizePolicy::Policy hor,QSizePolicy::Policy ver,bool hfw)

Use thesizePolicy property andheightForWidth() function instead.

QStyle * QWidget::setStyle(constQString & style)

This is an overloaded function.

Sets the widget's GUI style tostyle using theQStyleFactory.

void QWidget::unsetFont()

UsesetFont(QFont()) instead.

void QWidget::unsetPalette()

UsesetPalette(QPalette()) instead.

QRect QWidget::visibleRect() const

UsevisibleRegion() instead.

[static]QWidgetMapper * QWidget::wmapper()

The widget mapper is no longer part of the public API.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp