View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Ashley Winters > Qt-0.03 > QWidget



Annotate this POD


New  4
Open  0
View/Report Bugs
Module Version: 0.03   Source  


QWidget - Interface to the Qt QWidget class


use QWidget;

Inherits QObject and QPaintDevice.

Requires QEvent, QFont, QPixmap, QPoint, QRect, and QSize.

Member functions

new, adjustSize, backgroundColor, backgroundPixmap, caption, childrenRect, clearFocus, close, drawText, erase, focusPolicy, font, foregroundColor, frameGeometry, geometry, grabKeyboard, grabMouse, hasFocus, hasMouseTracking, height, hide, icon, iconText, iconify, isActiveWindow, isDesktop, isEnabled, isFocusEnabled, isModal, isPopup, isTopLevel, isUpdatesEnabled, isVisible, keyboardGrabber, lower, mapFromGlobal, mapFromParent, mapToGlobal, mapToParent, maximumSize, minimumSize, mouseGrabber, move, pos, raise, recreate, rect, releaseKeyboard, releaseMouse, repaint, resize, scroll, setActiveWindow, setBackgroundColor, setBackgroundPixmap, setCaption, setEnabled, setFixedSize, setFocus, setFocusPolicy, setFont, setGeometry, setIcon, setIconText, setMaximumSize, setMinimumSize, setMouseTracking, setSizeIncrement, setStyle, setUpdatesEnabled, show, size, sizeHint, sizeIncrement, style, topLevelWidget, update, width, winId, x, y

Virtual functions

mouseMoveEvent, mousePressEvent, mouseReleaseEvent, paintEvent, resizeEvent


Every function made available to Perl is meant to be interfaced identically to C++ Qt.


The %FocusPolicy and %WFlags hashes are exported into the user's namespace.

%FocusPolicy contains all of the constants in QWidget that end in Focus. That trailing Focus is removed from the end of the keys for brevity.

The %WFlags hash is much more involved. It contains all of the WState_*, WType_*, and WStyle_* flags, as well as quite a few others that begin with W. You can get a full list of them from qwindefs.h.

But you won't find these constants exactly as they're spelled out in there. I've stripped all the leading W's, for example. And all of the constants which have an underscore in them have been split up into two components based on the underscore. I think a few examples are in order.

    Was: WStyle_NormalBorder
    Now: $WFlags{Style}{NormalBorder}
    Was: WState_TrackMouse
    Now: $WFlags{State}{TrackMouse}
    Was: WPaintDesktop
    Now: $WFlags{PaintDesktop}

You can hopefully figure out the rest yourself.




Ashley Winters <>

syntax highlighting: