summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2010-06-05 00:06:15 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2010-06-05 00:06:44 +0200
commit51fa7df978d71a366c95c732d6a8c2576690d63a (patch)
treee112d17e004c95d77c02375f0fa4d575afcda297 /tests/auto
parent09c6a81109d3978c1583c556202c01c1e774f11f (diff)
Add convenience constructor to QTextOption::Tab
Merge-request: 1734 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qtextformat/tst_qtextformat.cpp5
-rw-r--r--tests/auto/qtextlayout/tst_qtextlayout.cpp9
-rw-r--r--tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp9
3 files changed, 5 insertions, 18 deletions
diff --git a/tests/auto/qtextformat/tst_qtextformat.cpp b/tests/auto/qtextformat/tst_qtextformat.cpp
index ee1f4b5877..9b71481709 100644
--- a/tests/auto/qtextformat/tst_qtextformat.cpp
+++ b/tests/auto/qtextformat/tst_qtextformat.cpp
@@ -308,10 +308,7 @@ void tst_QTextFormat::getSetTabs()
format.setTabPositions(tabs);
Comparator c2(tabs, format.tabPositions());
- QTextOption::Tab tab2;
- tab2.position = 3456;
- tab2.type = QTextOption::RightTab;
- tab2.delimiter = QChar('x');
+ QTextOption::Tab tab2(3456, QTextOption::RightTab, QChar('x'));
tabs.append(tab2);
format.setTabPositions(tabs);
Comparator c3(tabs, format.tabPositions());
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
index 1a5f493a01..a631f3d282 100644
--- a/tests/auto/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
@@ -980,9 +980,7 @@ void tst_QTextLayout::testCenteredTab()
// test if centering the tab works. We expect the center of 'Bar.' to be at the tab point.
QTextOption option = layout.textOption();
QList<QTextOption::Tab> tabs;
- QTextOption::Tab tab;
- tab.type = QTextOption::CenterTab;
- tab.position = 150;
+ QTextOption::Tab tab(150, QTextOption::CenterTab);
tabs.append(tab);
option.setTabs(tabs);
layout.setTextOption(option);
@@ -1002,10 +1000,7 @@ void tst_QTextLayout::testDelimiterTab()
// try the different delimiter characters to see if the alignment works there.
QTextOption option = layout.textOption();
QList<QTextOption::Tab> tabs;
- QTextOption::Tab tab;
- tab.type = QTextOption::DelimiterTab;
- tab.delimiter = QChar('.');
- tab.position = 100;
+ QTextOption::Tab tab(100, QTextOption::DelimiterTab, QChar('.'));
tabs.append(tab);
option.setTabs(tabs);
layout.setTextOption(option);
diff --git a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
index 64c42bbee3..a463d86031 100644
--- a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
+++ b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
@@ -198,14 +198,9 @@ void tst_QTextOdfWriter::testWriteStyle2()
{
QTextBlockFormat bf; // = cursor.blockFormat();
QList<QTextOption::Tab> tabs;
- QTextOption::Tab tab1;
- tab1.position = 40;
- tab1.type = QTextOption::RightTab;
+ QTextOption::Tab tab1(40, QTextOption::RightTab);
tabs << tab1;
- QTextOption::Tab tab2;
- tab2.position = 80;
- tab2.type = QTextOption::DelimiterTab;
- tab2.delimiter = 'o';
+ QTextOption::Tab tab2(80, QTextOption::DelimiterTab, 'o');
tabs << tab2;
bf.setTabPositions(tabs);