QIStatusBar.cpp revision a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fc
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * VBox frontends: Qt GUI ("VirtualBox"):
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * innotek Qt extensions: QIStatusBar class implementation
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * Copyright (C) 2006-2007 innotek GmbH
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * This file is part of VirtualBox Open Source Edition (OSE), as
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * available from http://www.virtualbox.org. This file is free software;
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * you can redistribute it and/or modify it under the terms of the GNU
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * General Public License (GPL) as published by the Free Software
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * Foundation, in version 2 as it comes in the "COPYING" file of the
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga/** @clas QIStatusLine
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * The QIStatusBar class is a replacement of QStatusBar that reimplements
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * QStatusBar::paintEvent() to disable drawing of those sunken borders
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * around every widget on the status bar.
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznagaQIStatusBar::QIStatusBar (QWidget *parent, const char *name) :
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga * Reimplemented to disable drawing of sunken borders around statusbar's
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga // this will work provided that QStatusBar::setSizeGripEnabled() names
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga // its resizer child as specified (at least Qt 3.3.x does this).
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga QSizeGrip *resizer = (QSizeGrip *) child ("QStatusBar::resizer", "QSizeGrip");
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi int psx = (resizer && resizer->isVisible()) ? resizer->x() : width() - 12;
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga p.drawText (6, 0, psx, height(), AlignVCenter | SingleLine, message);