~neon/libkdegames/master

« back to all changes in this revision

Viewing changes to kgdifficulty.cpp

  • Committer: Laurent Montel
  • Date: 2019-01-07 12:36:24 UTC
  • Revision ID: git-v1:3f7bd1bfa83e909234b1ceaefd9a2b433d2841cb
remove some clazy warning

Show diffs side-by-side

added added

removed removed

Lines of Context:
383
383
        KgDifficultyGUI::Selector* selector = new KgDifficultyGUI::Selector(difficulty, window);
384
384
        selector->setToolTip(i18nc("Game difficulty level", "Difficulty"));
385
385
        QObject::connect(selector, SIGNAL(activated(int)), selector, SLOT(slotActivated(int)));
386
 
        QObject::connect(difficulty, SIGNAL(editableChanged(bool)), selector, SLOT(setEnabled(bool)));
387
 
        QObject::connect(difficulty, SIGNAL(selectedLevelChanged(const KgDifficultyLevel*)),
388
 
                selector, SLOT(slotSelected(const KgDifficultyLevel*)));
389
 
        QObject::connect(selector, SIGNAL(signalSelected(int)), selector, SLOT(setCurrentIndex(int)));
 
386
        QObject::connect(difficulty, &KgDifficulty::editableChanged, selector, &QWidget::setEnabled);
 
387
        QObject::connect(difficulty, &KgDifficulty::selectedLevelChanged,
 
388
                selector, &Selector::slotSelected);
 
389
        QObject::connect(selector, &Selector::signalSelected, selector, &QComboBox::setCurrentIndex);
390
390
 
391
391
        //create menu action
392
392
        const QIcon icon = QIcon::fromTheme(QStringLiteral("games-difficult"));
394
394
        menu->setToolTip(i18n("Set the difficulty level"));
395
395
        menu->setWhatsThis(i18n("Set the difficulty level of the game."));
396
396
        QObject::connect(menu, SIGNAL(triggered(int)), selector, SLOT(slotActivated(int)));
397
 
        QObject::connect(difficulty, SIGNAL(editableChanged(bool)), menu, SLOT(setEnabled(bool)));
398
 
        QObject::connect(selector, SIGNAL(signalSelected(int)), menu, SLOT(setCurrentItem(int)));
 
397
        QObject::connect(difficulty, &KgDifficulty::editableChanged, menu, &QAction::setEnabled);
 
398
        QObject::connect(selector, &Selector::signalSelected, menu, &KSelectAction::setCurrentItem);
399
399
 
400
400
        //fill menu and selector
401
401
        foreach (const KgDifficultyLevel* level, difficulty->levels())