Qt 4.8
Public Functions | Private Slots | Properties | List of all members
QPageSetupWidget Class Reference

#include <qpagesetupdialog_unix_p.h>

Inheritance diagram for QPageSetupWidget:
QWidget QObject QPaintDevice

Public Functions

 QPageSetupWidget (QWidget *parent=0)
 
 QPageSetupWidget (QPrinter *printer, QWidget *parent=0)
 
void selectPdfPsPrinter (const QPrinter *p)
 
void selectPrinter (QCUPSSupport *m_cups)
 
void setPrinter (QPrinter *printer)
 
void setupPrinter () const
 copy information from the widget and apply that to the printer. More...
 
- Public Functions inherited from QWidget
bool acceptDrops () const
 
QString accessibleDescription () const
 
QString accessibleName () const
 
QList< QAction * > actions () const
 Returns the (possibly empty) list of this widget's actions. More...
 
void activateWindow ()
 Sets the top-level widget containing this widget to be the active window. More...
 
void addAction (QAction *action)
 Appends the action action to this widget's list of actions. More...
 
void addActions (QList< QAction *> actions)
 Appends the actions actions to this widget's list of actions. More...
 
void adjustSize ()
 Adjusts the size of the widget to fit its contents. More...
 
bool autoFillBackground () const
 
QPalette::ColorRole backgroundRole () const
 Returns the background role of the widget. More...
 
QSize baseSize () const
 
QWidgetchildAt (int x, int y) const
 Returns the visible child widget at the position ({x}, {y}) in the widget's coordinate system. More...
 
QWidgetchildAt (const QPoint &p) const
 Returns the visible child widget at point p in the widget's own coordinate system. More...
 
QRect childrenRect () const
 
QRegion childrenRegion () const
 
void clearFocus ()
 Takes keyboard input focus from the widget. More...
 
void clearMask ()
 Removes any mask set by setMask(). More...
 
QMargins contentsMargins () const
 The contentsMargins function returns the widget's contents margins. More...
 
QRect contentsRect () const
 Returns the area inside the widget's margins. More...
 
Qt::ContextMenuPolicy contextMenuPolicy () const
 
void createWinId ()
 
QCursor cursor () const
 
int devType () const
 
WId effectiveWinId () const
 Returns the effective window system identifier of the widget, i. More...
 
void ensurePolished () const
 Ensures that the widget has been polished by QStyle (i.e., has a proper font and palette). More...
 
Qt::FocusPolicy focusPolicy () const
 
QWidgetfocusProxy () const
 Returns the focus proxy, or 0 if there is no focus proxy. More...
 
QWidgetfocusWidget () const
 Returns the last child of this widget that setFocus had been called on. More...
 
const QFontfont () const
 
QFontInfo fontInfo () const
 Returns the font info for the widget's current font. More...
 
QFontMetrics fontMetrics () const
 Returns the font metrics for the widget's current font. More...
 
QPalette::ColorRole foregroundRole () const
 Returns the foreground role. More...
 
QRect frameGeometry () const
 
QSize frameSize () const
 
const QRectgeometry () const
 
void getContentsMargins (int *left, int *top, int *right, int *bottom) const
 Returns the widget's contents margins for left, top, right, and bottom. More...
 
HDC getDC () const
 Returns the window system handle of the widget, for low-level access. More...
 
void grabGesture (Qt::GestureType type, Qt::GestureFlags flags=Qt::GestureFlags())
 Subscribes the widget to a given gesture with specific flags. More...
 
void grabKeyboard ()
 Grabs the keyboard input. More...
 
void grabMouse ()
 Grabs the mouse input. More...
 
void grabMouse (const QCursor &)
 
int grabShortcut (const QKeySequence &key, Qt::ShortcutContext context=Qt::WindowShortcut)
 Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. More...
 
QGraphicsEffectgraphicsEffect () const
 The graphicsEffect function returns a pointer to the widget's graphics effect. More...
 
QGraphicsProxyWidgetgraphicsProxyWidget () const
 Returns the proxy widget for the corresponding embedded widget in a graphics view; otherwise returns 0. More...
 
bool hasFocus () const
 
bool hasMouseTracking () const
 
int height () const
 
virtual int heightForWidth (int) const
 Returns the preferred height for this widget, given the width w. More...
 
QInputContextinputContext ()
 This function returns the QInputContext for this widget. More...
 
Qt::InputMethodHints inputMethodHints () const
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery) const
 This method is only relevant for input widgets. More...
 
void insertAction (QAction *before, QAction *action)
 Inserts the action action to this widget's list of actions, before the action before. More...
 
void insertActions (QAction *before, QList< QAction *> actions)
 Inserts the actions actions to this widget's list of actions, before the action before. More...
 
WId internalWinId () const
 Returns the window system identifier of the widget, or 0 if the widget is not created yet. More...
 
bool isActiveWindow () const
 
bool isAncestorOf (const QWidget *child) const
 Returns true if this widget is a parent, (or grandparent and so on to any level), of the given child, and both widgets are within the same window; otherwise returns false. More...
 
bool isEnabled () const
 
bool isEnabledTo (QWidget *) const
 Returns true if this widget would become enabled if ancestor is enabled; otherwise returns false. More...
 
bool isEnabledToTLW () const
 This function is deprecated. More...
 
bool isFullScreen () const
 
bool isHidden () const
 Returns true if the widget is hidden, otherwise returns false. More...
 
bool isLeftToRight () const
 
bool isMaximized () const
 
bool isMinimized () const
 
bool isModal () const
 
bool isRightToLeft () const
 
bool isTopLevel () const
 Use isWindow() instead. More...
 
bool isVisible () const
 
bool isVisibleTo (QWidget *) const
 Returns true if this widget would become visible if ancestor is shown; otherwise returns false. More...
 
bool isWindow () const
 Returns true if the widget is an independent window, otherwise returns false. More...
 
bool isWindowModified () const
 
QLayoutlayout () const
 Returns the layout manager that is installed on this widget, or 0 if no layout manager is installed. More...
 
Qt::LayoutDirection layoutDirection () const
 
QLocale locale () const
 
Qt::HANDLE macCGHandle () const
 Returns the CoreGraphics handle of the widget. More...
 
Qt::HANDLE macQDHandle () const
 Returns the QuickDraw handle of the widget. More...
 
QPoint mapFrom (QWidget *, const QPoint &) const
 Translates the widget coordinate pos from the coordinate system of parent to this widget's coordinate system. More...
 
QPoint mapFromGlobal (const QPoint &) const
 Translates the global screen coordinate pos to widget coordinates. More...
 
QPoint mapFromParent (const QPoint &) const
 Translates the parent widget coordinate pos to widget coordinates. More...
 
QPoint mapTo (QWidget *, const QPoint &) const
 Translates the widget coordinate pos to the coordinate system of parent. More...
 
QPoint mapToGlobal (const QPoint &) const
 Translates the widget coordinate pos to global screen coordinates. More...
 
QPoint mapToParent (const QPoint &) const
 Translates the widget coordinate pos to a coordinate in the parent widget. More...
 
QRegion mask () const
 Returns the mask currently set on a widget. More...
 
int maximumHeight () const
 
QSize maximumSize () const
 
int maximumWidth () const
 
int minimumHeight () const
 
QSize minimumSize () const
 
virtual QSize minimumSizeHint () const
 
int minimumWidth () const
 
void move (int x, int y)
 This corresponds to move(QPoint(x, y)). More...
 
void move (const QPoint &)
 
QWidgetnativeParentWidget () const
 Returns the native parent for this widget, i. More...
 
QWidgetnextInFocusChain () const
 Returns the next widget in this widget's focus chain. More...
 
QRect normalGeometry () const
 
void overrideWindowFlags (Qt::WindowFlags type)
 Sets the window flags for the widget to flags, without telling the window system. More...
 
void overrideWindowState (Qt::WindowStates state)
 
QPaintEnginepaintEngine () const
 Returns the widget's paint engine. More...
 
const QPalettepalette () const
 
QWidgetparentWidget () const
 Returns the parent of this widget, or 0 if it does not have any parent widget. More...
 
QPoint pos () const
 
QWidgetpreviousInFocusChain () const
 The previousInFocusChain function returns the previous widget in this widget's focus chain. More...
 
 QWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructs a widget which is a child of parent, with widget flags set to f. More...
 
QRect rect () const
 
void releaseDC (HDC) const
 Releases the HDC hdc acquired by a previous call to getDC(). More...
 
void releaseKeyboard ()
 Releases the keyboard grab. More...
 
void releaseMouse ()
 Releases the mouse grab. More...
 
void releaseShortcut (int id)
 Removes the shortcut with the given id from Qt's shortcut system. More...
 
void removeAction (QAction *action)
 Removes the action action from this widget's list of actions. More...
 
void render (QPaintDevice *target, const QPoint &targetOffset=QPoint(), const QRegion &sourceRegion=QRegion(), RenderFlags renderFlags=RenderFlags(DrawWindowBackground|DrawChildren))
 Renders the sourceRegion of this widget into the target using renderFlags to determine how to render. More...
 
void render (QPainter *painter, const QPoint &targetOffset=QPoint(), const QRegion &sourceRegion=QRegion(), RenderFlags renderFlags=RenderFlags(DrawWindowBackground|DrawChildren))
 Renders the widget into the painter's QPainter::device(). More...
 
void repaint (int x, int y, int w, int h)
 This version repaints a rectangle (x, y, w, h) inside the widget. More...
 
void repaint (const QRect &)
 This version repaints a rectangle rect inside the widget. More...
 
void repaint (const QRegion &)
 This version repaints a region rgn inside the widget. More...
 
void resize (int w, int h)
 This corresponds to resize(QSize(w, h)). More...
 
void resize (const QSize &)
 
bool restoreGeometry (const QByteArray &geometry)
 Restores the geometry and state top-level widgets stored in the byte array geometry. More...
 
QByteArray saveGeometry () const
 Saves the current geometry and state for top-level widgets. More...
 
void scroll (int dx, int dy)
 Scrolls the widget including its children dx pixels to the right and dy downward. More...
 
void scroll (int dx, int dy, const QRect &)
 This version only scrolls r and does not move the children of the widget. More...
 
void setAcceptDrops (bool on)
 
void setAccessibleDescription (const QString &description)
 
void setAccessibleName (const QString &name)
 
void setAttribute (Qt::WidgetAttribute, bool on=true)
 Sets the attribute attribute on this widget if on is true; otherwise clears the attribute. More...
 
void setAutoFillBackground (bool enabled)
 
void setBackgroundRole (QPalette::ColorRole)
 Sets the background role of the widget to role. More...
 
void setBaseSize (const QSize &)
 
void setBaseSize (int basew, int baseh)
 This corresponds to setBaseSize(QSize(basew, baseh)). More...
 
void setContentsMargins (int left, int top, int right, int bottom)
 Sets the margins around the contents of the widget to have the sizes left, top, right, and bottom. More...
 
void setContentsMargins (const QMargins &margins)
 The setContentsMargins function sets the margins around the widget's contents. More...
 
void setContextMenuPolicy (Qt::ContextMenuPolicy policy)
 
void setCursor (const QCursor &)
 
void setFixedHeight (int h)
 Sets both the minimum and maximum heights of the widget to h without changing the widths. More...
 
void setFixedSize (const QSize &)
 Sets both the minimum and maximum sizes of the widget to s, thereby preventing it from ever growing or shrinking. More...
 
void setFixedSize (int w, int h)
 Sets the width of the widget to w and the height to h. More...
 
void setFixedWidth (int w)
 Sets both the minimum and maximum width of the widget to w without changing the heights. More...
 
void setFocus (Qt::FocusReason reason)
 Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its parents is the active window. More...
 
void setFocusPolicy (Qt::FocusPolicy policy)
 
void setFocusProxy (QWidget *)
 Sets the widget's focus proxy to widget w. More...
 
void setFont (const QFont &)
 Use the single-argument overload instead. More...
 
void setForegroundRole (QPalette::ColorRole)
 Sets the foreground role of the widget to role. More...
 
void setGeometry (int x, int y, int w, int h)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This corresponds to setGeometry(QRect(x, y, w, h)). More...
 
void setGeometry (const QRect &)
 
void setGraphicsEffect (QGraphicsEffect *effect)
 The setGraphicsEffect function is for setting the widget's graphics effect. More...
 
void setInputContext (QInputContext *)
 This function sets the input context context on this widget. More...
 
void setInputMethodHints (Qt::InputMethodHints hints)
 
void setLayout (QLayout *)
 Sets the layout manager for this widget to layout. More...
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
void setLocale (const QLocale &locale)
 
void setMask (const QBitmap &)
 Causes only the pixels of the widget for which bitmap has a corresponding 1 bit to be visible. More...
 
void setMask (const QRegion &)
 Causes only the parts of the widget which overlap region to be visible. More...
 
void setMaximumHeight (int maxh)
 
void setMaximumSize (const QSize &)
 
void setMaximumSize (int maxw, int maxh)
 This function corresponds to setMaximumSize(QSize(maxw, maxh)). More...
 
void setMaximumWidth (int maxw)
 
void setMinimumHeight (int minh)
 
void setMinimumSize (const QSize &)
 
void setMinimumSize (int minw, int minh)
 This function corresponds to setMinimumSize(QSize(minw, minh)). More...
 
void setMinimumWidth (int minw)
 
void setMouseTracking (bool enable)
 
void setPalette (const QPalette &)
 Use the single-argument overload instead. More...
 
void setParent (QWidget *parent)
 Sets the parent of the widget to parent, and resets the window flags. More...
 
void setParent (QWidget *parent, Qt::WindowFlags f)
 This function also takes widget flags, f as an argument. More...
 
void setShortcutAutoRepeat (int id, bool enable=true)
 If enable is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled. More...
 
void setShortcutEnabled (int id, bool enable=true)
 If enable is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled. More...
 
void setSizeIncrement (const QSize &)
 
void setSizeIncrement (int w, int h)
 Sets the x (width) size increment to w and the y (height) size increment to h. More...
 
void setSizePolicy (QSizePolicy)
 
void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
 Sets the size policy of the widget to horizontal and vertical, with standard stretch and no height-for-width. More...
 
void setStatusTip (const QString &)
 
void setStyle (QStyle *)
 Sets the widget's GUI style to style. More...
 
void setToolTip (const QString &)
 
void setUpdatesEnabled (bool enable)
 
void setupUi (QWidget *widget)
 Sets up the user interface for the specified widget. More...
 
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 &)
 Sets the window's role to role. More...
 
void setWindowState (Qt::WindowStates state)
 Sets the window state to windowState. More...
 
void setWindowSurface (QWindowSurface *surface)
 Sets the window surface to be the surface specified. More...
 
QSize size () const
 
virtual QSize sizeHint () const
 
QSize sizeIncrement () const
 
QSizePolicy sizePolicy () const
 
void stackUnder (QWidget *)
 Places the widget under w in the parent widget's stack. More...
 
QString statusTip () const
 
QStylestyle () const
 
QString styleSheet () const
 
bool testAttribute (Qt::WidgetAttribute) const
 Returns true if attribute attribute is set on this widget; otherwise returns false. More...
 
QString toolTip () const
 
QWidgettopLevelWidget () const
 
bool underMouse () const
 Returns true if the widget is under the mouse cursor; otherwise returns false. More...
 
void ungrabGesture (Qt::GestureType type)
 Unsubscribes the widget from a given gesture type. More...
 
void unsetCursor ()
 
void unsetLayoutDirection ()
 
void unsetLocale ()
 
void update (int x, int y, int w, int h)
 This version updates a rectangle (x, y, w, h) inside the widget. More...
 
void update (const QRect &)
 This version updates a rectangle rect inside the widget. More...
 
void update (const QRegion &)
 This version repaints a region rgn inside the widget. More...
 
void updateGeometry ()
 Notifies the layout system that this widget has changed and may need to change geometry. More...
 
bool updatesEnabled () const
 
QRegion visibleRegion () const
 Returns the unobscured region where paint events can occur. More...
 
QString whatsThis () const
 
int width () const
 
QWidgetwindow () const
 Returns the window for this widget, i.e. More...
 
QString windowFilePath () const
 
Qt::WindowFlags windowFlags () const
 Window flags are a combination of a type (e. More...
 
QIcon windowIcon () const
 
QString windowIconText () const
 
Qt::WindowModality windowModality () const
 
qreal windowOpacity () const
 
QString windowRole () const
 Returns the window's role, or an empty string. More...
 
Qt::WindowStates windowState () const
 Returns the current window state. More...
 
QWindowSurfacewindowSurface () const
 Returns the QWindowSurface this widget will be drawn into. More...
 
QString windowTitle () const
 
Qt::WindowType windowType () const
 Returns the window type of this widget. More...
 
WId winId () const
 Returns the window system identifier of the widget. More...
 
int x () const
 
const QX11Infox11Info () const
 Returns information about the configuration of the X display used to display the widget. More...
 
Qt::HANDLE x11PictureHandle () const
 Returns the X11 Picture handle of the widget for XRender support. More...
 
int y () const
 
 ~QWidget ()
 Destroys the widget. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 
- Public Functions inherited from QPaintDevice
int colorCount () const
 
int depth () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
QT_DEPRECATED int numColors () const
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
int width () const
 
int widthMM () const
 
virtual ~QPaintDevice ()
 

Private Slots

void _q_pageOrientationChanged ()
 
void _q_paperSizeChanged ()
 
void setBottomMargin (double newValue)
 
void setLeftMargin (double newValue)
 
void setRightMargin (double newValue)
 
void setTopMargin (double newValue)
 
void unitChanged (int item)
 

Properties

bool m_blockSignals
 
qreal m_bottomMargin
 
QCUPSSupportm_cups
 
qreal m_currentMultiplier
 
qreal m_leftMargin
 
QPagePreviewm_pagePreview
 
QSizeF m_paperSize
 
QPrinterm_printer
 
qreal m_rightMargin
 
qreal m_topMargin
 
Ui::QPageSetupWidget widget
 

Additional Inherited Members

- Public Types inherited from QWidget
enum  RenderFlag { DrawWindowBackground = 0x1, DrawChildren = 0x2, IgnoreMask = 0x4 }
 This enum describes how to render the widget when calling QWidget::render(). More...
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric {
  PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM,
  PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY,
  PdmPhysicalDpiX, PdmPhysicalDpiY
}
 
- Public Slots inherited from QWidget
bool close ()
 Closes this widget. More...
 
void hide ()
 Hides the widget. More...
 
void lower ()
 Lowers the widget to the bottom of the parent widget's stack. More...
 
void raise ()
 Raises this widget to the top of the parent widget's stack. More...
 
void repaint ()
 Repaints the widget directly by calling paintEvent() immediately, unless updates are disabled or the widget is hidden. More...
 
void setDisabled (bool)
 Disables widget input events if disable is true; otherwise enables input events. More...
 
void setEnabled (bool)
 
void setFocus ()
 Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its parents is the active window. More...
 
void setHidden (bool hidden)
 Convenience function, equivalent to setVisible(!hidden). More...
 
QT_MOC_COMPAT void setShown (bool shown)
 Use setVisible(shown) instead. More...
 
void setStyleSheet (const QString &styleSheet)
 
virtual void setVisible (bool visible)
 
void setWindowModified (bool)
 
void setWindowTitle (const QString &)
 
void show ()
 Shows the widget and its child widgets. More...
 
void showFullScreen ()
 Shows the widget in full-screen mode. More...
 
void showMaximized ()
 Shows the widget maximized. More...
 
void showMinimized ()
 Shows the widget minimized, as an icon. More...
 
void showNormal ()
 Restores the widget after it has been maximized or minimized. More...
 
void update ()
 Updates the widget unless updates are disabled or the widget is hidden. More...
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QWidget
void customContextMenuRequested (const QPoint &pos)
 This signal is emitted when the widget's contextMenuPolicy is Qt::CustomContextMenu, and the user has requested a context menu on the widget. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Functions inherited from QWidget
static QWidgetfind (WId)
 Returns a pointer to the widget with window identifer/handle id. More...
 
static QWidgetkeyboardGrabber ()
 Returns the widget that is currently grabbing the keyboard input. More...
 
static QWidgetmouseGrabber ()
 Returns the widget that is currently grabbing the mouse input. More...
 
static void setTabOrder (QWidget *, QWidget *)
 Puts the second widget after the first widget in the focus order. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Functions inherited from QPaintDevice
static QWSDisplayqwsDisplay ()
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Slots inherited from QWidget
void updateMicroFocus ()
 Updates the widget's micro focus. More...
 
- Protected Functions inherited from QWidget
virtual void actionEvent (QActionEvent *)
 This event handler is called with the given event whenever the widget's actions are changed. More...
 
virtual void changeEvent (QEvent *)
 This event handler can be reimplemented to handle state changes. More...
 
virtual void closeEvent (QCloseEvent *)
 This event handler is called with the given event when Qt receives a window close request for a top-level widget from the window system. More...
 
virtual void contextMenuEvent (QContextMenuEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive widget context menu events. More...
 
void create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
 Creates a new widget window if window is 0, otherwise sets the widget's window to window. More...
 
void destroy (bool destroyWindow=true, bool destroySubWindows=true)
 Frees up window system resources. More...
 
virtual void dragEnterEvent (QDragEnterEvent *)
 This event handler is called when a drag is in progress and the mouse enters this widget. More...
 
virtual void dragLeaveEvent (QDragLeaveEvent *)
 This event handler is called when a drag is in progress and the mouse leaves this widget. More...
 
virtual void dragMoveEvent (QDragMoveEvent *)
 This event handler is called if a drag is in progress, and when any of the following conditions occur: the cursor enters this widget, the cursor moves within this widget, or a modifier key is pressed on the keyboard while this widget has the focus. More...
 
virtual void dropEvent (QDropEvent *)
 This event handler is called when the drag is dropped on this widget. More...
 
virtual void enabledChange (bool)
 
virtual void enterEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive widget enter events which are passed in the event parameter. More...
 
bool event (QEvent *)
 This is the main event handler; it handles event event. More...
 
virtual void focusInEvent (QFocusEvent *)
 This event handler can be reimplemented in a subclass to receive keyboard focus events (focus received) for the widget. More...
 
bool focusNextChild ()
 Finds a new widget to give the keyboard focus to, as appropriate for Tab, and returns true if it can find a new widget, or false if it can't. More...
 
virtual bool focusNextPrevChild (bool next)
 Finds a new widget to give the keyboard focus to, as appropriate for Tab and Shift+Tab, and returns true if it can find a new widget, or false if it can't. More...
 
virtual void focusOutEvent (QFocusEvent *)
 This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) for the widget. More...
 
bool focusPreviousChild ()
 Finds a new widget to give the keyboard focus to, as appropriate for Shift+Tab, and returns true if it can find a new widget, or false if it can't. More...
 
virtual void fontChange (const QFont &)
 
virtual void hideEvent (QHideEvent *)
 This event handler can be reimplemented in a subclass to receive widget hide events. More...
 
virtual void inputMethodEvent (QInputMethodEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive Input Method composition events. More...
 
virtual void keyPressEvent (QKeyEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive key press events for the widget. More...
 
virtual void keyReleaseEvent (QKeyEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive key release events for the widget. More...
 
virtual void languageChange ()
 
virtual void leaveEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive widget leave events which are passed in the event parameter. More...
 
virtual bool macEvent (EventHandlerCallRef, EventRef)
 This special event handler can be reimplemented in a subclass to receive native Macintosh events. More...
 
int metric (PaintDeviceMetric) const
 Internal implementation of the virtual QPaintDevice::metric() function. More...
 
virtual void mouseDoubleClickEvent (QMouseEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive mouse double click events for the widget. More...
 
virtual void mouseMoveEvent (QMouseEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive mouse move events for the widget. More...
 
virtual void mousePressEvent (QMouseEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive mouse press events for the widget. More...
 
virtual void mouseReleaseEvent (QMouseEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive mouse release events for the widget. More...
 
virtual void moveEvent (QMoveEvent *)
 This event handler can be reimplemented in a subclass to receive widget move events which are passed in the event parameter. More...
 
virtual void paintEvent (QPaintEvent *)
 This event handler can be reimplemented in a subclass to receive paint events passed in event. More...
 
virtual void paletteChange (const QPalette &)
 
 QWidget (QWidgetPrivate &d, QWidget *parent, Qt::WindowFlags f)
 
virtual bool qwsEvent (QWSEvent *)
 This special event handler can be reimplemented in a subclass to receive native Qt for Embedded Linux events which are passed in the event parameter. More...
 
void resetInputContext ()
 This function can be called on the widget that currently has focus to reset the input method operating on it. More...
 
virtual void resizeEvent (QResizeEvent *)
 This event handler can be reimplemented in a subclass to receive widget resize events which are passed in the event parameter. More...
 
virtual void showEvent (QShowEvent *)
 This event handler can be reimplemented in a subclass to receive widget show events which are passed in the event parameter. More...
 
virtual void styleChange (QStyle &)
 
virtual void tabletEvent (QTabletEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive tablet events for the widget. More...
 
virtual void wheelEvent (QWheelEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive wheel events for the widget. More...
 
virtual void windowActivationChange (bool)
 
virtual bool winEvent (MSG *message, long *result)
 This special event handler can be reimplemented in a subclass to receive native Windows events which are passed in the message parameter. More...
 
virtual bool x11Event (XEvent *)
 This special event handler can be reimplemented in a subclass to receive native X11 events passed in the event parameter. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Functions inherited from QPaintDevice
 QPaintDevice ()
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Protected Variables inherited from QPaintDevice
ushort painters
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 68 of file qpagesetupdialog_unix_p.h.

Constructors and Destructors

◆ QPageSetupWidget() [1/2]

QPageSetupWidget::QPageSetupWidget ( QWidget parent = 0)

Definition at line 265 of file qpagesetupdialog_unix.cpp.

266  : QWidget(parent),
267  m_printer(0),
268  m_blockSignals(false),
269  m_cups(0)
270 {
271  widget.setupUi(this);
272 
274  ? QString::fromLatin1(" in")
275  : QString::fromLatin1(" mm");
276  widget.topMargin->setSuffix(suffix);
277  widget.bottomMargin->setSuffix(suffix);
278  widget.leftMargin->setSuffix(suffix);
279  widget.rightMargin->setSuffix(suffix);
280  widget.paperWidth->setSuffix(suffix);
281  widget.paperHeight->setSuffix(suffix);
282 
283  QVBoxLayout *lay = new QVBoxLayout(widget.preview);
284  widget.preview->setLayout(lay);
285  m_pagePreview = new QPagePreview(widget.preview);
286  lay->addWidget(m_pagePreview);
287 
289 
290 #ifdef PSD_ENABLE_PAPERSOURCE
291  for (int i=0; paperSourceNames[i]; ++i)
292  widget.paperSource->insertItem(paperSourceNames[i]);
293 #else
294  widget.paperSourceLabel->setVisible(false);
295  widget.paperSource->setVisible(false);
296 #endif
297 
298  widget.reverseLandscape->setVisible(false);
299  widget.reversePortrait->setVisible(false);
300 
301  populatePaperSizes(widget.paperSize);
302 
303  QStringList units;
304  units << tr("Centimeters (cm)") << tr("Millimeters (mm)") << tr("Inches (in)") << tr("Points (pt)");
305  widget.unit->addItems(units);
306  connect(widget.unit, SIGNAL(activated(int)), this, SLOT(unitChanged(int)));
307  widget.unit->setCurrentIndex((QLocale::system().measurementSystem() == QLocale::ImperialSystem) ? 2 : 1);
308 
309  connect(widget.paperSize, SIGNAL(currentIndexChanged(int)), this, SLOT(_q_paperSizeChanged()));
310  connect(widget.paperWidth, SIGNAL(valueChanged(double)), this, SLOT(_q_paperSizeChanged()));
311  connect(widget.paperHeight, SIGNAL(valueChanged(double)), this, SLOT(_q_paperSizeChanged()));
312 
313  connect(widget.leftMargin, SIGNAL(valueChanged(double)), this, SLOT(setLeftMargin(double)));
314  connect(widget.topMargin, SIGNAL(valueChanged(double)), this, SLOT(setTopMargin(double)));
315  connect(widget.rightMargin, SIGNAL(valueChanged(double)), this, SLOT(setRightMargin(double)));
316  connect(widget.bottomMargin, SIGNAL(valueChanged(double)), this, SLOT(setBottomMargin(double)));
317 
318  connect(widget.portrait, SIGNAL(clicked()), this, SLOT(_q_pageOrientationChanged()));
319  connect(widget.landscape, SIGNAL(clicked()), this, SLOT(_q_pageOrientationChanged()));
320 }
void setBottomMargin(double newValue)
void setTopMargin(double newValue)
Ui::QPageSetupWidget widget
#define SLOT(a)
Definition: qobjectdefs.h:226
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
void setLeftMargin(double newValue)
The QString class provides a Unicode character string.
Definition: qstring.h:83
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=0)
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment...
static QLocale system()
Returns a QLocale object initialized to the system locale.
Definition: qlocale.cpp:1917
#define SIGNAL(a)
Definition: qobjectdefs.h:227
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
QWidget(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a widget which is a child of parent, with widget flags set to f.
Definition: qwidget.cpp:1189
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
static void populatePaperSizes(QComboBox *cb)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
QByteArray suffix
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
Definition: qwidget.cpp:11087
QPagePreview * m_pagePreview
The QVBoxLayout class lines up widgets vertically.
Definition: qboxlayout.h:149
MeasurementSystem measurementSystem() const
Returns the measurement system for the locale.
Definition: qlocale.cpp:2265
void setRightMargin(double newValue)

◆ QPageSetupWidget() [2/2]

QPageSetupWidget::QPageSetupWidget ( QPrinter printer,
QWidget parent = 0 
)

Functions

◆ _q_pageOrientationChanged

void QPageSetupWidget::_q_pageOrientationChanged ( )
privateslot

Definition at line 506 of file qpagesetupdialog_unix.cpp.

Referenced by QPageSetupWidget().

507 {
508  if (QPrinter::PaperSize(widget.paperSize->currentIndex()) == QPrinter::Custom) {
509  double tmp = widget.paperWidth->value();
510  widget.paperWidth->setValue(widget.paperHeight->value());
511  widget.paperHeight->setValue(tmp);
512  }
514 }
Ui::QPageSetupWidget widget
PaperSize
This enum type specifies what paper size QPrinter should use.
Definition: qprinter.h:91

◆ _q_paperSizeChanged

void QPageSetupWidget::_q_paperSizeChanged ( )
privateslot

Definition at line 456 of file qpagesetupdialog_unix.cpp.

Referenced by _q_pageOrientationChanged(), QPageSetupWidget(), and setPrinter().

457 {
458  QVariant val = widget.paperSize->itemData(widget.paperSize->currentIndex());
459  int index = m_printer->pageSize();
460  if (val.type() == QVariant::Int) {
461  index = val.toInt();
462  }
463 
464  if (m_blockSignals) return;
465  m_blockSignals = true;
466 
468  QPrinter::Orientation orientation = widget.portrait->isChecked()
471 
472  bool custom = size == QPrinter::Custom;
473 
474 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
475  custom = custom ? !m_cups : custom;
476 #endif
477 
478  widget.paperWidth->setEnabled(custom);
479  widget.paperHeight->setEnabled(custom);
480  widget.widthLabel->setEnabled(custom);
481  widget.heightLabel->setEnabled(custom);
482  if (custom) {
483  m_paperSize.setWidth( widget.paperWidth->value() * m_currentMultiplier);
484  m_paperSize.setHeight( widget.paperHeight->value() * m_currentMultiplier);
486  } else {
488 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
489  if (m_cups) { // combobox is filled with cups based data
490  QByteArray cupsPageSize = widget.paperSize->itemData(widget.paperSize->currentIndex()).toByteArray();
491  m_paperSize = m_cups->paperRect(cupsPageSize).size();
492  if (orientation == QPrinter::Landscape)
494  }
495  else
496 #endif
497  m_paperSize = qt_printerPaperSize(orientation, size, QPrinter::Point, 1);
498 
499  m_pagePreview->setPaperSize(m_paperSize);
500  widget.paperWidth->setValue(m_paperSize.width() / m_currentMultiplier);
501  widget.paperHeight->setValue(m_paperSize.height() / m_currentMultiplier);
502  }
503  m_blockSignals = false;
504 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QSize size() const
Ui::QPageSetupWidget widget
qreal width() const
Returns the width.
Definition: qsize.h:284
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
qreal height() const
Returns the height.
Definition: qsize.h:287
Orientation
This enum type (not to be confused with Orientation) is used to specify each page&#39;s orientation...
Definition: qprinter.h:78
void setWidth(qreal w)
Sets the width to the given width.
Definition: qsize.h:290
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
PageSize pageSize() const
Returns the printer page size.
Definition: qprinter.cpp:1187
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
Definition: qvariant.cpp:2625
QRect paperRect(const char *choice) const
Definition: qcups.cpp:310
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
QSizeF qt_printerPaperSize(QPrinter::Orientation, QPrinter::PaperSize, QPrinter::Unit, int)
Definition: qprinter.cpp:145
Type type() const
Returns the storage type of the value stored in the variant.
Definition: qvariant.cpp:1901
PaperSize
This enum type specifies what paper size QPrinter should use.
Definition: qprinter.h:91
void setPaperSize(const QSizeF &size)
quint16 index
void setHeight(qreal h)
Sets the height to the given height.
Definition: qsize.h:293
QPagePreview * m_pagePreview

◆ selectPdfPsPrinter()

void QPageSetupWidget::selectPdfPsPrinter ( const QPrinter p)

Definition at line 440 of file qpagesetupdialog_unix.cpp.

Referenced by setPrinter().

441 {
442  m_cups = 0;
443  widget.paperSize->clear();
444  populatePaperSizes(widget.paperSize);
445  widget.paperSize->setCurrentIndex(widget.paperSize->findData(p->paperSize()));
446 
447  m_leftMargin = 90;
448  m_topMargin = 72;
449  m_bottomMargin = 72;
450  m_rightMargin = 90;
451  unitChanged(widget.unit->currentIndex());
453 }
Ui::QPageSetupWidget widget
void setMargins(qreal left, qreal top, qreal right, qreal bottom)
PaperSize paperSize() const
Returns the printer paper size.
Definition: qprinter.cpp:1140
static void populatePaperSizes(QComboBox *cb)
QPagePreview * m_pagePreview

◆ selectPrinter()

void QPageSetupWidget::selectPrinter ( QCUPSSupport m_cups)

Definition at line 389 of file qpagesetupdialog_unix.cpp.

390 {
391  m_cups = cups;
392  widget.paperSize->clear();
393 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
394  if (m_cups && QCUPSSupport::isAvailable()) {
395  const ppd_option_t* pageSizes = m_cups->pageSizes();
396  const int numChoices = pageSizes ? pageSizes->num_choices : 0;
397 
398  int cupsDefaultSize = 0;
399  QSize qtPreferredSize = m_printer->paperSize(QPrinter::Point).toSize();
400  bool preferredSizeMatched = false;
401  for (int i = 0; i < numChoices; ++i) {
402  widget.paperSize->addItem(QString::fromLocal8Bit(pageSizes->choices[i].text), QByteArray(pageSizes->choices[i].choice));
403  if (static_cast<int>(pageSizes->choices[i].marked) == 1)
404  cupsDefaultSize = i;
405  if (m_printer->d_func()->hasUserSetPageSize) {
406  QRect cupsPaperSize = m_cups->paperRect(pageSizes->choices[i].choice);
407  QSize diff = cupsPaperSize.size() - qtPreferredSize;
408  if (qAbs(diff.width()) < 5 && qAbs(diff.height()) < 5) {
409  widget.paperSize->setCurrentIndex(i);
410  preferredSizeMatched = true;
411  }
412  }
413  }
414  if (!preferredSizeMatched)
415  widget.paperSize->setCurrentIndex(cupsDefaultSize);
416  if (m_printer->d_func()->hasCustomPageMargins) {
418  } else {
419  QByteArray cupsPaperSizeChoice = widget.paperSize->itemData(widget.paperSize->currentIndex()).toByteArray();
420  QRect paper = m_cups->paperRect(cupsPaperSizeChoice);
421  QRect content = m_cups->pageRect(cupsPaperSizeChoice);
422 
423  m_leftMargin = content.x() - paper.x();
424  m_topMargin = content.y() - paper.y();
425  m_rightMargin = paper.right() - content.right();
426  m_bottomMargin = paper.bottom() - content.bottom();
427  }
428  }
429 #endif
430  if (widget.paperSize->count() == 0) {
431  populatePaperSizes(widget.paperSize);
432  widget.paperSize->setCurrentIndex(widget.paperSize->findData(
434  }
435 
436  unitChanged(widget.unit->currentIndex());
438 }
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
Definition: qstring.cpp:4245
Ui::QPageSetupWidget widget
void setMargins(qreal left, qreal top, qreal right, qreal bottom)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
QRect pageRect(const char *choice) const
Definition: qcups.cpp:321
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
static bool isAvailable()
Definition: qcups.cpp:216
static QLocale system()
Returns a QLocale object initialized to the system locale.
Definition: qlocale.cpp:1917
int width() const
Returns the width.
Definition: qsize.h:126
PaperSize paperSize() const
Returns the printer paper size.
Definition: qprinter.cpp:1140
const ppd_option_t * pageSizes() const
Definition: qcups.cpp:259
QRect paperRect(const char *choice) const
Definition: qcups.cpp:310
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
static Bigint * diff(Bigint *a, Bigint *b)
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
static void populatePaperSizes(QComboBox *cb)
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QPagePreview * m_pagePreview
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
MeasurementSystem measurementSystem() const
Returns the measurement system for the locale.
Definition: qlocale.cpp:2265
void getPageMargins(qreal *left, qreal *top, qreal *right, qreal *bottom, Unit unit) const
Returns the page margins for this printer in left, top, right, bottom.
Definition: qprinter.cpp:1853

◆ setBottomMargin

void QPageSetupWidget::setBottomMargin ( double  newValue)
privateslot

Definition at line 564 of file qpagesetupdialog_unix.cpp.

Referenced by QPageSetupWidget().

◆ setLeftMargin

void QPageSetupWidget::setLeftMargin ( double  newValue)
privateslot

Definition at line 571 of file qpagesetupdialog_unix.cpp.

Referenced by QPageSetupWidget().

◆ setPrinter()

void QPageSetupWidget::setPrinter ( QPrinter printer)

Definition at line 322 of file qpagesetupdialog_unix.cpp.

323 {
324  m_printer = printer;
325  m_blockSignals = true;
326  selectPdfPsPrinter(printer);
328  unitChanged(widget.unit->currentIndex());
331  widget.paperWidth->setValue(m_paperSize.width() / m_currentMultiplier);
332  widget.paperHeight->setValue(m_paperSize.height() / m_currentMultiplier);
333 
334  widget.landscape->setChecked(printer->orientation() == QPrinter::Landscape);
335 
336 #ifdef PSD_ENABLE_PAPERSOURCE
337  widget.paperSource->setCurrentItem(printer->paperSource());
338 #endif
340  m_blockSignals = false;
342 }
Ui::QPageSetupWidget widget
void setMargins(qreal left, qreal top, qreal right, qreal bottom)
qreal width() const
Returns the width.
Definition: qsize.h:284
qreal height() const
Returns the height.
Definition: qsize.h:287
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
PaperSize paperSize() const
Returns the printer paper size.
Definition: qprinter.cpp:1140
Orientation orientation() const
Returns the orientation setting.
Definition: qprinter.cpp:1098
PaperSource paperSource() const
Returns the printer&#39;s paper source.
Definition: qprinter.cpp:1604
void selectPdfPsPrinter(const QPrinter *p)
QPagePreview * m_pagePreview
void getPageMargins(qreal *left, qreal *top, qreal *right, qreal *bottom, Unit unit) const
Returns the page margins for this printer in left, top, right, bottom.
Definition: qprinter.cpp:1853

◆ setRightMargin

void QPageSetupWidget::setRightMargin ( double  newValue)
privateslot

Definition at line 578 of file qpagesetupdialog_unix.cpp.

Referenced by QPageSetupWidget().

◆ setTopMargin

void QPageSetupWidget::setTopMargin ( double  newValue)
privateslot

Definition at line 557 of file qpagesetupdialog_unix.cpp.

Referenced by QPageSetupWidget().

◆ setupPrinter()

void QPageSetupWidget::setupPrinter ( ) const

copy information from the widget and apply that to the printer.

Definition at line 345 of file qpagesetupdialog_unix.cpp.

346 {
347  QPrinter::Orientation orientation = widget.portrait->isChecked()
350  m_printer->setOrientation(orientation);
351  // paper format
352  QVariant val = widget.paperSize->itemData(widget.paperSize->currentIndex());
353  int ps = m_printer->pageSize();
354  if (val.type() == QVariant::Int) {
355  ps = val.toInt();
356  }
357 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
358  else if (m_cups && QCUPSSupport::isAvailable() && m_cups->currentPPD()) {
359  QByteArray cupsPageSize = val.toByteArray();
360  QPrintEngine *engine = m_printer->printEngine();
363 
364  QRect pageRect = m_cups->pageRect(cupsPageSize);
365  engine->setProperty(PPK_CupsPageRect, pageRect);
366 
367  QRect paperRect = m_cups->paperRect(cupsPageSize);
368  engine->setProperty(PPK_CupsPaperRect, paperRect);
369 
370  for(ps = 0; ps < QPrinter::NPaperSize; ++ps) {
372  if (size.width == paperRect.width() && size.height == paperRect.height())
373  break;
374  }
375  }
376 #endif
377  if (ps == QPrinter::Custom)
379  else
380  m_printer->setPaperSize(static_cast<QPrinter::PaperSize>(ps));
381 
382 #ifdef PSD_ENABLE_PAPERSOURCE
383  m_printer->setPaperSource((QPrinter::PaperSource)widget.paperSource->currentIndex());
384 #endif
386 
387 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
const ppd_file_t * currentPPD() const
Definition: qcups.cpp:173
PaperSize paperSize(QPrinter::PaperSize paperSize)
Definition: qpdf.cpp:905
QSize size() const
Ui::QPageSetupWidget widget
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void setPageMargins(qreal left, qreal top, qreal right, qreal bottom, Unit unit)
This function sets the left, top, right and bottom page margins for this printer. ...
Definition: qprinter.cpp:1831
Orientation
This enum type (not to be confused with Orientation) is used to specify each page&#39;s orientation...
Definition: qprinter.h:78
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
void setPaperSize(PaperSize)
Sets the printer paper size to newPaperSize if that size is supported.
Definition: qprinter.cpp:1163
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
QRect pageRect(const char *choice) const
Definition: qcups.cpp:321
static bool isAvailable()
Definition: qcups.cpp:216
void setPaperSource(PaperSource)
Sets the paper source setting to source.
Definition: qprinter.cpp:1593
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has type() ByteArray or String (converted using QS...
Definition: qvariant.cpp:2383
PageSize pageSize() const
Returns the printer page size.
Definition: qprinter.cpp:1187
void setOrientation(Orientation)
Sets the print orientation to orientation.
Definition: qprinter.cpp:1122
QPrintEngine * printEngine() const
Returns the print engine used by the printer.
Definition: qprinter.cpp:1896
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
Definition: qvariant.cpp:2625
The QPrintEngine class defines an interface for how QPrinter interacts with a given printing subsyste...
Definition: qprintengine.h:56
QRect paperRect(const char *choice) const
Definition: qcups.cpp:310
QStringList options() const
Definition: qcups.cpp:335
virtual void setProperty(PrintEnginePropertyKey key, const QVariant &value)=0
Sets the print engine&#39;s property specified by key to the given value.
#define PPK_CupsStringPageSize
Definition: qpdf_p.h:73
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
Type type() const
Returns the storage type of the value stored in the variant.
Definition: qvariant.cpp:1901
PaperSize
This enum type specifies what paper size QPrinter should use.
Definition: qprinter.h:91
static QSizeF sizeForOrientation(QPrinter::Orientation orientation, const QSizeF &size)
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
#define PPK_CupsPaperRect
Definition: qpdf_p.h:72
#define PPK_CupsPageRect
Definition: qpdf_p.h:71
#define PPK_CupsOptions
Definition: qpdf_p.h:70
PaperSource
This enum type specifies what paper source QPrinter is to use.
Definition: qprinter.h:103

◆ unitChanged

void QPageSetupWidget::unitChanged ( int  item)
privateslot

Definition at line 518 of file qpagesetupdialog_unix.cpp.

Referenced by QPageSetupWidget(), selectPdfPsPrinter(), selectPrinter(), and setPrinter().

519 {
520  QString suffix;
521  switch(item) {
522  case 0:
524  suffix = QString::fromLatin1(" cm");
525  break;
526  case 2:
528  suffix = QString::fromLatin1(" in");
529  break;
530  case 3:
532  suffix = QString::fromLatin1(" pt");
533  break;
534  case 1:
535  default:
537  suffix = QString::fromLatin1(" mm");
538  break;
539  }
540  const bool old = m_blockSignals;
541  m_blockSignals = true;
542  widget.topMargin->setSuffix(suffix);
543  widget.leftMargin->setSuffix(suffix);
544  widget.rightMargin->setSuffix(suffix);
545  widget.bottomMargin->setSuffix(suffix);
546  widget.paperWidth->setSuffix(suffix);
547  widget.paperHeight->setSuffix(suffix);
548  widget.topMargin->setValue(m_topMargin / m_currentMultiplier);
549  widget.leftMargin->setValue(m_leftMargin / m_currentMultiplier);
550  widget.rightMargin->setValue(m_rightMargin / m_currentMultiplier);
551  widget.bottomMargin->setValue(m_bottomMargin / m_currentMultiplier);
552  widget.paperWidth->setValue(m_paperSize.width() / m_currentMultiplier);
553  widget.paperHeight->setValue(m_paperSize.height() / m_currentMultiplier);
554  m_blockSignals = old;
555 }
Ui::QPageSetupWidget widget
qreal width() const
Returns the width.
Definition: qsize.h:284
qreal height() const
Returns the height.
Definition: qsize.h:287
double qt_multiplierForUnit(QPrinter::Unit unit, int resolution)
return the multiplier of converting from the unit value to postscript-points.
Definition: qprinter.cpp:123
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
QByteArray suffix

Properties

◆ m_blockSignals

bool QPageSetupWidget::m_blockSignals
private

◆ m_bottomMargin

qreal QPageSetupWidget::m_bottomMargin
private

◆ m_cups

QCUPSSupport* QPageSetupWidget::m_cups
private

◆ m_currentMultiplier

qreal QPageSetupWidget::m_currentMultiplier
private

◆ m_leftMargin

qreal QPageSetupWidget::m_leftMargin
private

◆ m_pagePreview

QPagePreview* QPageSetupWidget::m_pagePreview
private

◆ m_paperSize

QSizeF QPageSetupWidget::m_paperSize
private

◆ m_printer

QPrinter* QPageSetupWidget::m_printer
private

◆ m_rightMargin

qreal QPageSetupWidget::m_rightMargin
private

◆ m_topMargin

qreal QPageSetupWidget::m_topMargin
private

◆ widget

Ui::QPageSetupWidget QPageSetupWidget::widget
private

The documentation for this class was generated from the following files: