45 void compressLayoutRequest();
46 void automaticReparenting();
47 void verifyActivate();
48 void sizeHintOfHiddenLayout();
51 void alternativeLayoutItems();
63 void tst_QGraphicsLayout::sizeHints()
98 ++(m_eventCount[int(
e->type())]);
107 m_eventCount.
clear();
111 m_eventCount.
clear();
131 void tst_QGraphicsLayout::compressLayoutRequest()
141 for (
int i = 0;
i < 4; ++
i) {
150 void tst_QGraphicsLayout::automaticReparenting()
173 #if !defined(Q_OS_MAC) && defined(QT_DEBUG)
175 " in wrong parent; moved to correct parent");
258 void tst_QGraphicsLayout::verifyActivate()
271 window->setVisible(
false);
280 void tst_QGraphicsLayout::sizeHintOfHiddenLayout()
291 w->setMaximumSize(50, 50);
295 for (
int pass = 0; pass < 3; ++pass) {
299 window->setVisible(pass % 2);
313 if (
item->isLayout()) {
319 clearAllCounters(wid);
335 void tst_QGraphicsLayout::invalidate()
387 e->callUpdateGeometry();
414 f->callUpdateGeometry();
445 f->setPreferredSize(
QSizeF(60,50));
473 QVERIFY(
e->size().width() <
f->size().width());
474 QVERIFY(
g->size().width() <
f->size().width());
483 f->setMinimumSize(
QSizeF(200,50));
524 QVERIFY(
e->size().width() <
f->size().width());
525 QVERIFY(
g->size().width() <
f->size().width());
535 e->callUpdateGeometry();
536 g->callUpdateGeometry();
604 void tst_QGraphicsLayout::constructors()
608 for (
int pass = 0; pass < 5; ++pass) {
698 for (
int i = 0;
i < fromGeoms.
count(); ++
i) {
715 void tst_QGraphicsLayout::alternativeLayoutItems()
740 window->setGeometry(0, 0, 99, 99);
741 view.setSceneRect(
QRectF(-10, -10, 110, 110));
742 view.resize(150, 150);
762 m_destructedSet = destructedSet;
769 m_destructedSet->
insert(
this);
794 m_destructedSet = destructedSet;
809 m_destructedSet->
insert(
this);
831 if (actual != expected) {
832 qDebug() <<
"actual:" << actual <<
"expected:" << expected;
876 item->setParentLayoutItem(
this);
895 while (parentItem && parentItem->
isLayout()) {
913 void tst_QGraphicsLayout::ownership()
927 destructedSet.
clear();
931 expected << li1 << li2 << li3;
932 QVERIFY(compareSets(destructedSet, expected));
948 destructedSet.
clear();
975 view.resize(500, 200);
978 for (
int i = li2->
count();
i > 0; --
i) {
983 for (
int i = lay->
count();
i > 0; --
i) {
1005 #include "tst_qgraphicslayout.moc"
small capitals from c petite p scientific i
[1]
void setGeometry(const QRectF &geom) override
AnimatedLayout(QGraphicsWidget *widget)
void setGeometry(const QRectF &geom) override
AnimatedLayoutItem(QGraphicsRectItem *item)
QGraphicsRectItem * rectItem()
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const override
QGraphicsLayoutItem * itemAt(int index) const override
CustomLayout(QGraphicsLayoutItem *parent)
QSizeF sizeHint(Qt::SizeHint, const QSizeF &) const override
QList< QGraphicsLayoutItem * > items
int count() const override
void insertItem(int index, QGraphicsLayoutItem *item)
void removeAt(int index) override
void updateParentWidget(QGraphicsWidget *item)
void addItem(QGraphicsLayoutItem *item)
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const override
CustomLayoutItem(QSet< QGraphicsLayoutItem * > *destructedSet)
void removeAt(int index) override
void setGeometry(const QRectF &rect) override
Layout(QGraphicsLayoutItem *parentItem=0)
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const override
QGraphicsLayoutItem * itemAt(int index) const override
int count() const override
int count() const override
void addItem(QLayoutItem *) override
QLayoutItem * itemAt(int) const override
static void processEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
static void sendPostedEvents(QObject *receiver=nullptr, int event_type=0)
The QEvent class is the base class of all event classes. Event objects contain event parameters.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
void setData(int key, const QVariant &value)
void setParentItem(QGraphicsItem *parent)
QGraphicsItem * parentItem() const
The QGraphicsLayout class provides the base class for all layouts in Graphics View.
virtual void updateGeometry() override
static void setInstantInvalidatePropagation(bool enable)
void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const override
void setContentsMargins(qreal left, qreal top, qreal right, qreal bottom)
The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts.
void setGraphicsItem(QGraphicsItem *item)
QGraphicsItem * graphicsItem() const
QSizeF effectiveSizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
void setMaximumSize(const QSizeF &size)
void setOwnedByLayout(bool ownedByLayout)
void setPreferredSize(const QSizeF &size)
QGraphicsLayoutItem * parentLayoutItem() const
void setMinimumSize(const QSizeF &size)
virtual void setGeometry(const QRectF &rect)
The QGraphicsLinearLayout class provides a horizontal or vertical layout for managing widgets in Grap...
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const override
void setOrientation(Qt::Orientation orientation)
void setSpacing(qreal spacing)
void setGeometry(const QRectF &rect) override
void invalidate() override
void addItem(QGraphicsLayoutItem *item)
QGraphicsLayoutItem * itemAt(int index) const override
int count() const override
QGraphicsObject * parent
the parent of the item
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
void addItem(QGraphicsItem *item)
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
void removeAt(qsizetype i)
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
qsizetype count() const noexcept
void append(parameter_type t)
T value(const Key &key, const T &defaultValue=T()) const
The QObject class is the base class of all Qt objects.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
The QPainter class performs low-level painting on widgets and other paint devices.
void drawRect(const QRectF &rect)
void drawLine(const QLineF &line)
The QRectF class defines a finite rectangle in the plane using floating point precision.
constexpr QPointF topLeft() const noexcept
constexpr QSizeF size() const noexcept
The QRect class defines a rectangle in the plane using integer precision.
constexpr QRect adjusted(int x1, int y1, int x2, int y2) const noexcept
iterator insert(const T &value)
The QSizeF class defines the size of a two-dimensional object using floating point precision.
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
The QTimeLine class provides a timeline for controlling animations.
TestLayout(QGraphicsLayoutItem *parent=nullptr)
void setGeometry(const QRectF &rect) override
QMap< FunctionType, int > functionCount
void invalidate() override
virtual ~tst_QGraphicsLayout()
qDeleteAll(list.begin(), list.end())
Q_GUI_EXPORT bool qWaitForWindowExposed(QWindow *window, int timeout=5000)
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message)
EGLOutputLayerEXT EGLint EGLAttrib value
QT_END_INCLUDE_NAMESPACE typedef double qreal
GLboolean GLboolean GLboolean b
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLdouble GLdouble GLdouble GLdouble top
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble GLdouble w2
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble w1
#define QTEST_MAIN(TestObject)
#define QTRY_COMPARE(expr, expected)
#define QVERIFY(statement)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent