mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-02 23:35:28 +08:00
6.5.3 clean
This commit is contained in:
@ -565,9 +565,9 @@ void tst_QWizard::addPage()
|
||||
|
||||
#define CHECK_VISITED(wizard, list) \
|
||||
do { \
|
||||
QList<int> myList = list; \
|
||||
const QList<int> myList = list; \
|
||||
QCOMPARE((wizard).visitedIds(), myList); \
|
||||
Q_FOREACH(int id, myList) \
|
||||
for (int id : myList) \
|
||||
QVERIFY((wizard).hasVisitedPage(id)); \
|
||||
} while (0)
|
||||
|
||||
@ -1642,7 +1642,7 @@ class OptionInfo
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
QMap<QWizard::WizardOption, QSharedPointer<Operation> > operations_;
|
||||
foreach (QWizard::WizardOption option, tags.keys())
|
||||
for (const auto &[option, _] : std::as_const(tags).asKeyValueRange())
|
||||
operations_[option] = SetOption::create(option, i == 1);
|
||||
operations << operations_;
|
||||
}
|
||||
@ -1785,7 +1785,7 @@ public:
|
||||
|
||||
~TestWizard()
|
||||
{
|
||||
foreach (int id, pageIds) {
|
||||
for (int id : std::as_const(pageIds)) {
|
||||
QWizardPage *page_to_delete = page(id);
|
||||
removePage(id);
|
||||
delete page_to_delete;
|
||||
@ -1794,7 +1794,7 @@ public:
|
||||
|
||||
void applyOperations(const QList<QSharedPointer<Operation>> &operations)
|
||||
{
|
||||
foreach (const QSharedPointer<Operation> &op, operations) {
|
||||
for (const QSharedPointer<Operation> &op : operations) {
|
||||
if (op) {
|
||||
op->apply(this);
|
||||
opsDescr += QLatin1Char('(') + op->describe() + QLatin1String(") ");
|
||||
@ -1814,8 +1814,16 @@ public:
|
||||
class CombinationsTestData
|
||||
{
|
||||
TestGroup testGroup;
|
||||
QList<QSharedPointer<Operation>> pageOps;
|
||||
QList<QSharedPointer<Operation>> styleOps;
|
||||
const QSharedPointer<Operation> pageOps[3] = {
|
||||
SetPage::create(0),
|
||||
SetPage::create(1),
|
||||
SetPage::create(2),
|
||||
};
|
||||
const QSharedPointer<Operation> styleOps[3] = {
|
||||
SetStyle::create(QWizard::ClassicStyle),
|
||||
SetStyle::create(QWizard::ModernStyle),
|
||||
SetStyle::create(QWizard::MacStyle),
|
||||
};
|
||||
QMap<bool, QList<QSharedPointer<Operation>>> setAllOptions;
|
||||
|
||||
public:
|
||||
@ -1824,15 +1832,13 @@ public:
|
||||
QTest::addColumn<bool>("ref");
|
||||
QTest::addColumn<bool>("testEquality");
|
||||
QTest::addColumn<QList<QSharedPointer<Operation>>>("operations");
|
||||
pageOps << SetPage::create(0) << SetPage::create(1) << SetPage::create(2);
|
||||
styleOps << SetStyle::create(QWizard::ClassicStyle) << SetStyle::create(QWizard::ModernStyle)
|
||||
<< SetStyle::create(QWizard::MacStyle);
|
||||
#define SETPAGE(page) pageOps.at(page)
|
||||
#define SETSTYLE(style) styleOps.at(style)
|
||||
#define SETPAGE(page) pageOps[page]
|
||||
#define SETSTYLE(style) styleOps[style]
|
||||
#define OPT(option, on) OptionInfo::instance().operation(option, on)
|
||||
#define CLROPT(option) OPT(option, false)
|
||||
#define SETOPT(option) OPT(option, true)
|
||||
foreach (QWizard::WizardOption option, OptionInfo::instance().options()) {
|
||||
const auto options = OptionInfo::instance().options();
|
||||
for (QWizard::WizardOption option : options) {
|
||||
setAllOptions[false] << CLROPT(option);
|
||||
setAllOptions[true] << SETOPT(option);
|
||||
}
|
||||
@ -1906,7 +1912,7 @@ public:
|
||||
testGroup.createTestRows();
|
||||
}
|
||||
|
||||
foreach (const QSharedPointer<Operation> &pageOp, pageOps) {
|
||||
for (const QSharedPointer<Operation> &pageOp : pageOps) {
|
||||
testGroup.reset("testAll 4.1");
|
||||
testGroup.add() << pageOp;
|
||||
testGroup.add() << pageOp << pageOp;
|
||||
@ -1919,7 +1925,8 @@ public:
|
||||
testGroup.add() << pageOp << optionOps;
|
||||
testGroup.createTestRows();
|
||||
|
||||
foreach (QWizard::WizardOption option, OptionInfo::instance().options()) {
|
||||
const auto options = OptionInfo::instance().options();
|
||||
for (QWizard::WizardOption option : options) {
|
||||
QSharedPointer<Operation> optionOp = OPT(option, i == 1);
|
||||
testGroup.reset("testAll 4.3");
|
||||
testGroup.add() << optionOp << pageOp;
|
||||
@ -1929,7 +1936,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const QSharedPointer<Operation> &styleOp, styleOps) {
|
||||
for (const QSharedPointer<Operation> &styleOp : styleOps) {
|
||||
testGroup.reset("testAll 5.1");
|
||||
testGroup.add() << styleOp;
|
||||
testGroup.add() << styleOp << styleOp;
|
||||
@ -1942,7 +1949,8 @@ public:
|
||||
testGroup.add() << styleOp << optionOps;
|
||||
testGroup.createTestRows();
|
||||
|
||||
foreach (QWizard::WizardOption option, OptionInfo::instance().options()) {
|
||||
const auto options = OptionInfo::instance().options();
|
||||
for (QWizard::WizardOption option : options) {
|
||||
QSharedPointer<Operation> optionOp = OPT(option, i == 1);
|
||||
testGroup.reset("testAll 5.3");
|
||||
testGroup.add() << optionOp << styleOp;
|
||||
@ -1952,8 +1960,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const QSharedPointer<Operation> &pageOp, pageOps) {
|
||||
foreach (const QSharedPointer<Operation> &styleOp, styleOps) {
|
||||
for (const QSharedPointer<Operation> &pageOp : pageOps) {
|
||||
for (const QSharedPointer<Operation> &styleOp : styleOps) {
|
||||
|
||||
testGroup.reset("testAll 6.1");
|
||||
testGroup.add() << pageOp;
|
||||
@ -1981,7 +1989,8 @@ public:
|
||||
testGroup.add() << styleOp << pageOp << optionOps;
|
||||
testGroup.createTestRows();
|
||||
|
||||
foreach (QWizard::WizardOption option, OptionInfo::instance().options()) {
|
||||
const auto options = OptionInfo::instance().options();
|
||||
for (QWizard::WizardOption option : options) {
|
||||
QSharedPointer<Operation> optionOp = OPT(option, i == 1);
|
||||
testGroup.reset("testAll 6.5");
|
||||
testGroup.add() << optionOp << pageOp << styleOp;
|
||||
@ -2044,7 +2053,7 @@ void tst_QWizard::combinations()
|
||||
{
|
||||
QFETCH(bool, ref);
|
||||
QFETCH(bool, testEquality);
|
||||
QFETCH(QList<QSharedPointer<Operation>>, operations);
|
||||
QFETCH(const QList<QSharedPointer<Operation>>, operations);
|
||||
|
||||
TestWizard wizard;
|
||||
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||
@ -2113,7 +2122,7 @@ public:
|
||||
QList<WizardPage *> shown() const
|
||||
{
|
||||
QList<WizardPage *> result;
|
||||
foreach (WizardPage *page, pages)
|
||||
for (WizardPage *page : pages)
|
||||
if (page->shown())
|
||||
result << page;
|
||||
return result;
|
||||
@ -2565,7 +2574,8 @@ void tst_QWizard::task161658_alignments()
|
||||
wizard.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&wizard));
|
||||
|
||||
foreach (QLabel *subtitleLabel, wizard.findChildren<QLabel *>()) {
|
||||
const auto subtitleLabels = wizard.findChildren<QLabel *>();
|
||||
for (QLabel *subtitleLabel : subtitleLabels) {
|
||||
if (subtitleLabel->text().startsWith("SUBTITLE#")) {
|
||||
QCOMPARE(lineEdit1.mapToGlobal(lineEdit1.contentsRect().bottomRight()).x(),
|
||||
subtitleLabel->mapToGlobal(subtitleLabel->contentsRect().bottomRight()).x());
|
||||
|
Reference in New Issue
Block a user