mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
build fix for the case when QT_NO_STYLE_STYLESHEET is defined
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e6c7cf9300
commit
106c44d412
5 changed files with 33 additions and 6 deletions
|
@ -132,10 +132,14 @@ void tst_QAbstractSpinBox::task183108_clear()
|
|||
|
||||
void tst_QAbstractSpinBox::task228728_cssselector()
|
||||
{
|
||||
#ifndef QT_NO_STYLE_STYLESHEET
|
||||
//QAbstractSpinBox does some call to stylehint into his constructor.
|
||||
//so while the stylesheet want to access property, it should not crash
|
||||
qApp->setStyleSheet("[alignment=\"1\"], [text=\"foo\"] { color:black; }" );
|
||||
QSpinBox box;
|
||||
#else // QT_NO_STYLE_STYLESHEET
|
||||
QSKIP("Katie compiled without stylesheet support (QT_NO_STYLE_STYLESHEET)", SkipAll);
|
||||
#endif // QT_NO_STYLE_STYLESHEET
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QAbstractSpinBox)
|
||||
|
|
|
@ -1429,7 +1429,7 @@ void tst_QMainWindow::restoreStateDockWidgetBug()
|
|||
{
|
||||
QByteArray state;
|
||||
|
||||
//save state
|
||||
// save state
|
||||
{
|
||||
QMainWindow mw1;
|
||||
QDockWidget *dw1 = new QDockWidget();
|
||||
|
@ -1444,14 +1444,16 @@ void tst_QMainWindow::restoreStateDockWidgetBug()
|
|||
state = mw1.saveState();
|
||||
}
|
||||
|
||||
//restore state
|
||||
// restore state
|
||||
QMainWindow mw2;
|
||||
QDockWidget *dw2 = new QDockWidget();
|
||||
dw2->setObjectName("Left DockWidget");
|
||||
mw2.addDockWidget(Qt::LeftDockWidgetArea, dw2);
|
||||
mw2.setCentralWidget(new QTextEdit());
|
||||
mw2.restoreState(state);
|
||||
#ifndef QT_NO_STYLE_STYLESHEET
|
||||
mw2.setStyleSheet("color:red");
|
||||
#endif // QT_NO_STYLE_STYLESHEET
|
||||
mw2.show();
|
||||
QApplication::processEvents();
|
||||
|
||||
|
@ -1936,7 +1938,7 @@ void tst_QMainWindow::QTBUG2774_stylechange()
|
|||
QVERIFY( mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height())));
|
||||
QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() + 30)));
|
||||
|
||||
|
||||
#ifndef QT_NO_STYLE_STYLESHEET
|
||||
{
|
||||
QTest::qWait(1000);
|
||||
mw.setStyleSheet("QMainWindow::separator { width: 50px; height:50px; }");
|
||||
|
@ -1954,6 +1956,7 @@ void tst_QMainWindow::QTBUG2774_stylechange()
|
|||
QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height())));
|
||||
QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() + 1)));
|
||||
}
|
||||
#endif // QT_NO_STYLE_STYLESHEET
|
||||
}
|
||||
|
||||
void tst_QMainWindow::QTBUG21378_animationFinished()
|
||||
|
|
|
@ -568,10 +568,14 @@ void tst_QMenu::layoutDirection()
|
|||
|
||||
void tst_QMenu::task208001_stylesheet()
|
||||
{
|
||||
//test if it crash
|
||||
#ifndef QT_NO_STYLE_STYLESHEET
|
||||
// test if it crash
|
||||
QMainWindow main;
|
||||
main.setStyleSheet("QMenu [title =\"File\"] { color: red;}");
|
||||
main.menuBar()->addMenu("File");
|
||||
#else // QT_NO_STYLE_STYLESHEET
|
||||
QSKIP("Katie compiled without stylesheet support (QT_NO_STYLE_STYLESHEET)", SkipAll);
|
||||
#endif // QT_NO_STYLE_STYLESHEET
|
||||
}
|
||||
|
||||
void tst_QMenu::activeSubMenuPosition()
|
||||
|
|
|
@ -27,8 +27,10 @@
|
|||
|
||||
#include <qstylesheetstyle_p.h>
|
||||
|
||||
//TESTED_CLASS=
|
||||
//TESTED_FILES=
|
||||
// TESTED_CLASS=
|
||||
// TESTED_FILES=
|
||||
|
||||
#ifndef QT_NO_STYLE_STYLESHEET
|
||||
|
||||
class tst_QStyleSheetStyle : public QObject
|
||||
{
|
||||
|
@ -1625,3 +1627,9 @@ void tst_QStyleSheetStyle::QTBUG15910_crashNullWidget()
|
|||
QTEST_MAIN(tst_QStyleSheetStyle)
|
||||
|
||||
#include "moc_tst_qstylesheetstyle.cpp"
|
||||
|
||||
#else // QT_NO_STYLE_STYLESHEET
|
||||
|
||||
QTEST_NOOP_MAIN
|
||||
|
||||
#endif // QT_NO_STYLE_STYLESHEET
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <QtGui>
|
||||
#include <qtest.h>
|
||||
|
||||
#ifndef QT_NO_STYLE_STYLESHEET
|
||||
|
||||
class tst_qstylesheetstyle : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -172,3 +174,9 @@ void tst_qstylesheetstyle::grid()
|
|||
QTEST_MAIN(tst_qstylesheetstyle)
|
||||
|
||||
#include "moc_main.cpp"
|
||||
|
||||
#else // QT_NO_STYLE_STYLESHEET
|
||||
|
||||
QTEST_NOOP_MAIN
|
||||
|
||||
#endif // QT_NO_STYLE_STYLESHEET
|
||||
|
|
Loading…
Add table
Reference in a new issue