void taskQTBUG_27420_takeAtShouldUnparentLayout();
};
+#ifndef QT_NO_STYLE_WINDOWS
class CustomLayoutStyle : public QWindowsStyle
{
Q_OBJECT
}
return QWindowsStyle::pixelMetric(metric, option, widget);
}
-
+#endif // QT_NO_STYLE_WINDOWS
tst_QBoxLayout::tst_QBoxLayout()
{
void tst_QBoxLayout::setStyleShouldChangeSpacing()
{
-
+#ifndef QT_NO_STYLE_WINDOWS
QWidget *window = new QWidget;
QHBoxLayout *hbox = new QHBoxLayout(window);
QPushButton *pb1 = new QPushButton(tr("The spacing between this"));
delete window;
delete style1;
delete style2;
+ delete style;
+#else // QT_NO_STYLE_WINDOWS
+ QSKIP("Katie compiled without windows style support (QT_NO_STYLE_WINDOWS)", SkipAll);
+#endif // QT_NO_STYLE_WINDOWS
}
void tst_QBoxLayout::taskQTBUG_7103_minMaxWidthNotRespected()
{
- QLabel *label = new QLabel("Qt uses standard C++, but makes extensive use of the C pre-processor to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on all major platforms, and has extensive internationalization support. Non-GUI features include SQL database access, XML parsing, thread management, network support and a unified cross-platform API for file handling.");
+ QLabel *label = new QLabel("Katie uses standard C++, but makes extensive use of the C pre-processor to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on all major platforms, and has extensive internationalization support. Non-GUI features include SQL database access, XML parsing, thread management, network support and a unified cross-platform API for file handling.");
label->setWordWrap(true);
label->setFixedWidth(200);
#include <qwidget.h>
#include <qwindowsstyle.h>
#include <qsizepolicy.h>
-#include <QtGui>
-#include <QtGui/QWindowsStyle>
#include <QStyleFactory>
#include <QSharedPointer>
#include <qformlayout.h>
+#include <QLineEdit>
+#include <QLabel>
+#include <QBitArray>
+#include <QPushButton>
//TESTED_CLASS=
//TESTED_FILES=
delete w;
}
+#ifndef QT_NO_STYLE_WINDOWS
class CustomLayoutStyle : public QWindowsStyle
{
Q_OBJECT
}
return QWindowsStyle::pixelMetric(metric, option, widget);
}
+#endif // QT_NO_STYLE_WINDOWS
void tst_QFormLayout::spacing()
{
+#ifndef QT_NO_STYLE_WINDOWS
//TODO: confirm spacing behavior
QWidget *w = new QWidget;
CustomLayoutStyle *style = new CustomLayoutStyle;
delete w;
delete style;
+#else // QT_NO_STYLE_WINDOWS
+ QSKIP("Katie compiled without windows style support (QT_NO_STYLE_WINDOWS)", SkipAll);
+#endif // QT_NO_STYLE_WINDOWS
}
void tst_QFormLayout::contentsRect()
void tst_QFormLayout::setFormStyle()
{
+#ifndef QT_NO_STYLE_WINDOWS
QWidget widget;
QFormLayout layout;
widget.setLayout(&layout);
QVERIFY(layout.formAlignment() == (Qt::AlignLeft | Qt::AlignTop));
QVERIFY(layout.fieldGrowthPolicy() == QFormLayout::AllNonFixedFieldsGrow);
QVERIFY(layout.rowWrapPolicy() == QFormLayout::WrapLongRows);
+#else // QT_NO_STYLE_WINDOWS
+ QSKIP("Katie compiled without windows style support (QT_NO_STYLE_WINDOWS)", SkipAll);
+#endif // QT_NO_STYLE_WINDOWS
}
void tst_QFormLayout::setFieldGrowthPolicy()
void tst_QStyle::testProxyStyle()
{
-#ifndef QT_NO_STYLE_PROXY
+#if !defined(QT_NO_STYLE_PROXY) && !defined(QT_NO_STYLE_WINDOWS)
QProxyStyle *proxyStyle = new QProxyStyle();
QVERIFY(proxyStyle->baseStyle());
QStyle *style = new QWindowsStyle;
QVERIFY(!customStyle.parent());
QVERIFY(edit.style()->pixelMetric(QStyle::PM_ButtonIconSize) == 13);
#else // QT_NO_STYLE_PROXY
- QSKIP("Katie compiled without style proxy support (QT_NO_STYLE_PROXY)", SkipAll);
+ QSKIP("Katie compiled without style proxy or windows style support (QT_NO_STYLE_PROXY or QT_NO_STYLE_WINDOWS)", SkipAll);
#endif // QT_NO_STYLE_PROXY
}
void tst_QStyle::testWindowsStyle()
{
+#ifndef QT_NO_STYLE_WINDOWS
QWindowsStyle wstyle;
testAllFunctions(&wstyle);
lineUpLayoutTest(&wstyle);
QPixmap surface(QSize(200, 200));
QPainter painter(&surface);
wstyle.drawControl(QStyle::CE_ProgressBar, &pb, &painter, 0);
+#else // QT_NO_STYLE_WINDOWS
+ QSKIP("Katie compiled without windows style support (QT_NO_STYLE_WINDOWS)", SkipAll);
+#endif // QT_NO_STYLE_WINDOWS
}
void writeImage(const QString &fileName, QImage image)
style()->drawItemPixmap(&p, rect(), Qt::AlignCenter, big);
}
-
+#ifndef QT_NO_STYLE_WINDOWS
class Qt42Style : public QWindowsStyle
{
Q_OBJECT
}
return QWindowsStyle::pixelMetric(metric, option, widget);
}
-
+#endif // QT_NO_STYLE_WINDOWS
void tst_QStyle::pixelMetric()
{
+#ifndef QT_NO_STYLE_WINDOWS
Qt42Style *style = new Qt42Style();
QCOMPARE(style->pixelMetric(QStyle::PM_DefaultTopLevelMargin), 10);
QCOMPARE(style->pixelMetric(QStyle::PM_DefaultChildMargin), 5);
QCOMPARE(style->pixelMetric(QStyle::PM_DefaultLayoutSpacing), -1);
delete style;
+#else // QT_NO_STYLE_WINDOWS
+ QSKIP("Katie compiled without windows style support (QT_NO_STYLE_WINDOWS)", SkipAll);
+#endif // QT_NO_STYLE_WINDOWS
}
void tst_QStyle::lineUpLayoutTest(QStyle *style)