QWidget

Z DooBLER wiki

Spis treści


Wstęp

Klasa QWidget jest podstawową klasą wszystkich obiektów interfejsu użytkownika. Więcej...
The QWidget class is the base class of all user interface objects.

#include <QWidget>

Dziedziczy z
QObject, QPaintDevice.

Jest dziedziczony przez
Phonon::EffectWidget, Phonon::SeekSlider, Phonon::VideoPlayer, Phonon::VideoWidget, Phonon::VolumeSlider, Q3ComboBox, Q3DataBrowser, Q3DataView, Q3DateTimeEdit, Q3DateTimeEditBase, Q3DockArea, Q3Header, Q3MainWindow, QAbstractButton, QAbstractSlider, QAbstractSpinBox, QAxWidget, QCalendarWidget, QComboBox, QDesignerActionEditorInterface, QDesignerFormWindowInterface, QDesignerObjectInspectorInterface, QDesignerPropertyEditorInterface, QDesignerWidgetBoxInterface, QDesktopWidget, QDialog, QDialogButtonBox, QDockWidget, QFocusFrame, QFrame, QGLWidget, QGroupBox, QHelpSearchQueryWidget, QHelpSearchResultWidget, QLineEdit, QMainWindow, QMdiSubWindow, QMenu, QMenuBar, QPrintPreviewWidget, QProgressBar, QRubberBand, QSizeGrip, QSplashScreen, QSplitterHandle, QStatusBar, QSvgWidget, QTabBar, QTabWidget, QToolBar, QWebView, QWizardPage, QWorkspace, QWSEmbedWidget, QX11EmbedContainer, QX11EmbedWidget.

Publiczne typy

  • enum RenderFlag { DrawWindowBackground, DrawChildren, IgnoreMask }
  • flags RenderFlags

Właściwości

  • acceptDrops : bool
  • accessibleDescription : QString
  • accessibleName : QString
  • autoFillBackground : bool
  • baseSize : QSize
  • childrenRect : const QRect
  • childrenRegion : const QRegion
  • contextMenuPolicy : Qt::ContextMenuPolicy
  • cursor : QCursor
  • enabled : bool
  • focus : const bool
  • focusPolicy : Qt::FocusPolicy
  • font : QFont
  • frameGeometry : const QRect
  • frameSize : const QSize
  • fullScreen : const bool
  • geometry : QRect
  • height : const int
  • isActiveWindow : const bool
  • layoutDirection : Qt::LayoutDirection
  • locale : QLocale
  • maximized : const bool
  • maximumHeight : int
  • maximumSize : QSize
  • maximumWidth : int
  • minimized : const bool
  • minimumHeight : int
  • minimumSize : QSize
  • minimumSizeHint : const QSize
  • minimumWidth : int
  • modal : const bool
  • mouseTracking : bool
  • normalGeometry : const QRect
  • palette : QPalette
  • pos : QPoint
  • rect : const QRect
  • size : QSize
  • sizeHint : const QSize
  • sizeIncrement : QSize
  • sizePolicy : QSizePolicy
  • statusTip : QString
  • styleSheet : QString
  • toolTip : QString
  • updatesEnabled : bool
  • visible : bool
  • whatsThis : QString
  • width : const int
  • windowFilePath : QString
  • windowFlags : Qt::WindowFlags
  • windowIcon : QIcon
  • windowIconText : QString
  • windowModality : Qt::WindowModality
  • windowModified : bool
  • windowOpacity : double
  • windowTitle : QString
  • x : const int
  • y : const int
  • 1 właściwość jest dziedziczona z QObject

Publiczne funkcje

  • QWidget ( QWidget * parent = 0, Qt::WindowFlags f = 0 )
  • ~QWidget ()
  • bool acceptDrops () const
  • QString accessibleDescription () const
  • QString accessibleName () const
  • QList<QAction *> actions () const
  • void activateWindow ()
  • void addAction ( QAction * action )
  • void addActions ( QList<QAction *> actions )
  • void adjustSize ()
  • bool autoFillBackground () const
  • QPalette::ColorRole backgroundRole () const
  • QSize baseSize () const
  • QWidget * childAt ( int x, int y ) const
  • QWidget * childAt ( const QPoint & p ) const
  • QRect childrenRect () const
  • QRegion childrenRegion () const
  • void clearFocus ()
  • void clearMask ()
  • QRect contentsRect () const
  • Qt::ContextMenuPolicy contextMenuPolicy () const
  • QCursor cursor () const
  • WId effectiveWinId () const
  • void ensurePolished () const
  • Qt::FocusPolicy focusPolicy () const
  • QWidget * focusProxy () const
  • QWidget * focusWidget () const
  • const QFont & font () const
  • QFontInfo fontInfo () const
  • QFontMetrics fontMetrics () const
  • QPalette::ColorRole foregroundRole () const
  • QRect frameGeometry () const
  • QSize frameSize () const
  • const QRect & geometry () const
  • void getContentsMargins ( int * left, int * top, int * right, int * bottom ) const
  • virtual HDC getDC () const
  • void grabKeyboard ()
  • void grabMouse ()
  • void grabMouse ( const QCursor & cursor )
  • int grabShortcut ( const QKeySequence & key, Qt::ShortcutContext context = Qt::WindowShortcut )
  • bool hasEditFocus () const
  • bool hasFocus () const
  • bool hasMouseTracking () const
  • int height () const
  • virtual int heightForWidth ( int w ) const
  • QInputContext * inputContext ()
  • virtual QVariant inputMethodQuery ( Qt::InputMethodQuery query ) const
  • void insertAction ( QAction * before, QAction * action )
  • void insertActions ( QAction * before, QList<QAction *> actions )
  • bool isActiveWindow () const
  • bool isAncestorOf ( const QWidget * child ) const
  • bool isEnabled () const
  • bool isEnabledTo ( QWidget * ancestor ) const
  • bool isFullScreen () const
  • bool isHidden () const
  • bool isMaximized () const
  • bool isMinimized () const
  • bool isModal () const
  • bool isVisible () const
  • bool isVisibleTo ( QWidget * ancestor ) const
  • bool isWindow () const
  • bool isWindowModified () const
  • QLayout * layout () const
  • Qt::LayoutDirection layoutDirection () const
  • QLocale locale () const
  • Qt::HANDLE macCGHandle () const
  • Qt::HANDLE macQDHandle () const
  • QPoint mapFrom ( QWidget * parent, const QPoint & pos ) const
  • QPoint mapFromGlobal ( const QPoint & pos ) const
  • QPoint mapFromParent ( const QPoint & pos ) const
  • QPoint mapTo ( QWidget * parent, const QPoint & pos ) const
  • QPoint mapToGlobal ( const QPoint & pos ) const
  • QPoint mapToParent ( const QPoint & pos ) const
  • QRegion mask () const
  • int maximumHeight () const
  • QSize maximumSize () const
  • int maximumWidth () const
  • int minimumHeight () const
  • QSize minimumSize () const
  • virtual QSize minimumSizeHint () const
  • int minimumWidth () const
  • void move ( const QPoint & )
  • void move ( int x, int y )
  • QWidget * nativeParentWidget () const
  • QWidget * nextInFocusChain () const
  • QRect normalGeometry () const
  • void overrideWindowFlags ( Qt::WindowFlags flags )
  • virtual QPaintEngine * paintEngine () const
  • const QPalette & palette () const
  • QWidget * parentWidget () const
  • QPoint pos () const
  • QRect rect () const
  • virtual void releaseDC ( HDC hdc ) const
  • void releaseKeyboard ()
  • void releaseMouse ()
  • void releaseShortcut ( int id )
  • void removeAction ( QAction * action )
  • void render ( QPaintDevice * target, const QPoint & targetOffset = QPoint(), const QRegion & sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags( DrawWindowBackground | DrawChildren ) )
  • void render ( QPainter * painter, const QPoint & targetOffset = QPoint(), const QRegion & sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags( DrawWindowBackground | DrawChildren ) )
  • void repaint ( int x, int y, int w, int h )
  • void repaint ( const QRect & r )
  • void repaint ( const QRegion & rgn )
  • void resize ( const QSize & )
  • void resize ( int w, int h )
  • bool restoreGeometry ( const QByteArray & geometry )
  • QByteArray saveGeometry () const
  • void scroll ( int dx, int dy )
  • void scroll ( int dx, int dy, const QRect & r )
  • void setAcceptDrops ( bool on )
  • void setAccessibleDescription ( const QString & description )
  • void setAccessibleName ( const QString & name )
  • void setAttribute ( Qt::WidgetAttribute attribute, bool on = true )
  • void setAutoFillBackground ( bool enabled )
  • void setBackgroundRole ( QPalette::ColorRole role )
  • void setBaseSize ( const QSize & )
  • void setBaseSize ( int basew, int baseh )
  • void setContentsMargins ( int left, int top, int right, int bottom )
  • void setContextMenuPolicy ( Qt::ContextMenuPolicy policy )
  • void setCursor ( const QCursor & )
  • void setEditFocus ( bool enable )
  • void setFixedHeight ( int h )
  • void setFixedSize ( const QSize & s )
  • void setFixedSize ( int w, int h )
  • void setFixedWidth ( int w )
  • void setFocus ( Qt::FocusReason reason )
  • void setFocusPolicy ( Qt::FocusPolicy policy )
  • void setFocusProxy ( QWidget * w )
  • void setFont ( const QFont & )
  • void setForegroundRole ( QPalette::ColorRole role )
  • void setGeometry ( const QRect & )
  • void setGeometry ( int x, int y, int w, int h )
  • void setInputContext ( QInputContext * context )
  • void setLayout ( QLayout * layout )
  • void setLayoutDirection ( Qt::LayoutDirection direction )
  • void setLocale ( const QLocale & locale )
  • void setMask ( const QBitmap & bitmap )
  • void setMask ( const QRegion & region )
  • void setMaximumHeight ( int maxh )
  • void setMaximumSize ( const QSize & )
  • void setMaximumSize ( int maxw, int maxh )
  • void setMaximumWidth ( int maxw )
  • void setMinimumHeight ( int minh )
  • void setMinimumSize ( const QSize & )
  • void setMinimumSize ( int minw, int minh )
  • void setMinimumWidth ( int minw )
  • void setMouseTracking ( bool enable )
  • void setPalette ( const QPalette & )
  • void setParent ( QWidget * parent )
  • void setParent ( QWidget * parent, Qt::WindowFlags f )
  • void setShortcutAutoRepeat ( int id, bool enable = true )
  • void setShortcutEnabled ( int id, bool enable = true )
  • void setSizeIncrement ( const QSize & )
  • void setSizeIncrement ( int w, int h )
  • void setSizePolicy ( QSizePolicy )
  • void setSizePolicy ( QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical )
  • void setStatusTip ( const QString & )
  • void setStyle ( QStyle * style )
  • void setToolTip ( const QString & )
  • void setUpdatesEnabled ( bool enable )
  • void setWhatsThis ( const QString & )
  • void setWindowFilePath ( const QString & filePath )
  • void setWindowFlags ( Qt::WindowFlags type )
  • void setWindowIcon ( const QIcon & icon )
  • void setWindowIconText ( const QString & )
  • void setWindowModality ( Qt::WindowModality windowModality )
  • void setWindowOpacity ( qreal level )
  • void setWindowRole ( const QString & role )
  • void setWindowState ( Qt::WindowStates windowState )
  • void setWindowSurface ( QWindowSurface * surface ) (preliminary)
  • QSize size () const
  • virtual QSize sizeHint () const
  • QSize sizeIncrement () const
  • QSizePolicy sizePolicy () const
  • void stackUnder ( QWidget * w )
  • QString statusTip () const
  • QStyle * style () const
  • QString styleSheet () const
  • bool testAttribute ( Qt::WidgetAttribute attribute ) const
  • QString toolTip () const
  • bool underMouse () const
  • void unsetCursor ()
  • void unsetLayoutDirection ()
  • void unsetLocale ()
  • void update ( int x, int y, int w, int h )
  • void update ( const QRect & r )
  • void update ( const QRegion & rgn )
  • void updateGeometry ()
  • bool updatesEnabled () const
  • QRegion visibleRegion () const
  • QString whatsThis () const
  • int width () const
  • WId winId () const
  • QWidget * window () const
  • QString windowFilePath () const
  • Qt::WindowFlags windowFlags () const
  • QIcon windowIcon () const
  • QString windowIconText () const
  • Qt::WindowModality windowModality () const
  • qreal windowOpacity () const
  • QString windowRole () const
  • Qt::WindowStates windowState () const
  • QWindowSurface * windowSurface () const (preliminary)
  • QString windowTitle () const
  • Qt::WindowType windowType () const
  • int x () const
  • const QX11Info & x11Info () const
  • Qt::HANDLE x11PictureHandle () const
  • int y () const


  • 29 publicznych funkcji jest dziedziczonych z QObject
  • 12 publicznych funkcji jest dziedziczonych z QPaintDevice

Opis szczegółowy

Opis funkcji

QWidget::setLayout

void QWidget::setLayout ( QLayout * layout )

Sets the layout manager for this widget to layout.

If there already is a layout manager installed on this widget, QWidget won't let you install another. You must first delete the existing layout manager (returned by layout()) before you can call setLayout() with the new layout.

Przykład:

  1. QVBoxLayout *layout = new QVBoxLayout;
  2. layout->addWidget(lcd);
  3. layout->addWidget(slider);
  4. setLayout(layout);

An alternative to calling this function is to pass this widget to the layout's constructor.

The QWidget will take ownership of layout.

See also layout() and Layout Classes.




inne



Ten artykuł jest tylko zalążkiem.
Możesz pomóc poprzez rozszeszenie tego artykułu.

Tłumaczenie na podstawie oryginalnej dokumentacji ze strony http://doc.trolltech.com
Tekst oryginału http://doc.trolltech.com/4.4/qwidget.html

Osobiste
Kategorie główne
Reklamy
Zaprzyjaźnione strony