Changeset View
Changeset View
Standalone View
Standalone View
src/kmahjongg.cpp
Context not available. | |||||
169 | actionCollection()->setDefaultShortcut(anglecw, Qt::Key_G); | 169 | actionCollection()->setDefaultShortcut(anglecw, Qt::Key_G); | ||
---|---|---|---|---|---|
170 | connect(anglecw, &QAction::triggered, m_gameView, &GameView::angleSwitchCW); | 170 | connect(anglecw, &QAction::triggered, m_gameView, &GameView::angleSwitchCW); | ||
171 | 171 | | |||
172 | m_fullscreenAction = KStandardAction::fullScreen( | ||||
mlaurent: Please use new connect api here. | |||||
173 | this, &KMahjongg::toggleFullscreen, this, actionCollection() | ||||
use KStandardAction::fullScreen ? https://api.kde.org/frameworks/kconfigwidgets/html/namespaceKStandardAction.html#a0e30d17570d5b886e97b1f2cf34ef900 that way you don't have to set the text (which is wrong) nor the icon yourself aacid: use KStandardAction::fullScreen ? https://api.kde. | |||||
174 | ); | ||||
175 | | ||||
172 | m_demoAction = KStandardGameAction::demo(this, SLOT(demoMode()), actionCollection()); | 176 | m_demoAction = KStandardGameAction::demo(this, SLOT(demoMode()), actionCollection()); | ||
173 | 177 | | |||
174 | KStandardGameAction::highscores(this, SLOT(showHighscores()), actionCollection()); | 178 | KStandardGameAction::highscores(this, SLOT(showHighscores()), actionCollection()); | ||
Context not available. | |||||
188 | setupGUI(qApp->desktop()->availableGeometry().size() * 0.7); | 192 | setupGUI(qApp->desktop()->availableGeometry().size() * 0.7); | ||
189 | } | 193 | } | ||
190 | 194 | | |||
195 | void KMahjongg::toggleFullscreen(bool fullscreen) | ||||
Signal emitted is a clicked(bool) > change it to toggleFullscreen(bool fullScreen)> not necessary to use m_fullscreenAction->isChecked()mlaurent: Signal emitted is a clicked(bool)
=> change it to toggleFullscreen(bool fullScreen)
=> not… | |||||
196 | { | ||||
197 | if (fullscreen) { | ||||
198 | setWindowState(Qt::WindowState::WindowFullScreen); | ||||
199 | } else { | ||||
200 | setWindowState(Qt::WindowState::WindowNoState); | ||||
201 | } | ||||
202 | } | ||||
203 | | ||||
191 | void KMahjongg::setupStatusBar() | 204 | void KMahjongg::setupStatusBar() | ||
192 | { | 205 | { | ||
193 | m_gameTimerLabel = new QLabel(i18n("Time: 0:00:00"), statusBar()); | 206 | m_gameTimerLabel = new QLabel(i18n("Time: 0:00:00"), statusBar()); | ||
Context not available. |
Please use new connect api here.