Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Design: relations of classes

$
0
0
Hi. I’ve got two classes – MainWindow and Updater (inherited from QObject). Option 1: MainWindow calls Updater::checkForUpdates(); Updater emits signal if updates are available; MainWindow catches signal and shows corresponding QMessageBox. OR option 2: MainWindow calls Updater::checkForUpdates(); Updater shows QMessageBox from itself (without a parent, as a consequence). The first option allows to easily set MainWindow as a QMessageBox parent. But the second one is more logical as an object-oriented design abstraction. The overall question: which option is better?

Viewing all articles
Browse latest Browse all 13965

Trending Articles