Code changes in Qt 4 and Qt 5
-
Hi all,
Here is the program from the book "C++-GUI-Programming-with-Qt-4-2nd Edition".
The book is of Qt 4 and I used it on Qt Creator 4.3.0. I started
learning Qt using that book.
Anyway, would you please take a look at the code to see what part can be updated using Qt 5?The second case: What I've learnt by reading the first 4 chapters has been laying the widgets out and putting them on the screen for output by the setLayout statement. But here and don't see any layout! I think it's done by:
MainWindow::MainWindow() { spreadsheet = new Spreadsheet; setCentralWidget(spreadsheet); createActions(); createMenus(); createContextMenu(); createToolBars(); createStatusBar(); ... }Right, please?
-
Hi all,
Here is the program from the book "C++-GUI-Programming-with-Qt-4-2nd Edition".
The book is of Qt 4 and I used it on Qt Creator 4.3.0. I started
learning Qt using that book.
Anyway, would you please take a look at the code to see what part can be updated using Qt 5?The second case: What I've learnt by reading the first 4 chapters has been laying the widgets out and putting them on the screen for output by the setLayout statement. But here and don't see any layout! I think it's done by:
MainWindow::MainWindow() { spreadsheet = new Spreadsheet; setCentralWidget(spreadsheet); createActions(); createMenus(); createContextMenu(); createToolBars(); createStatusBar(); ... }Right, please?
-
Hi,
QMainWindow already has a layout which handles QMenuBar, QToolBars, QDockWidgets etc. The call to setCentralWidget is what puts spreadsheet inside the QMainWindow layout.
-
Hi,
QMainWindow already has a layout which handles QMenuBar, QToolBars, QDockWidgets etc. The call to setCentralWidget is what puts spreadsheet inside the QMainWindow layout.
-
The Qt 5 documentation has a porting guide. You can check it and you'll see there's not much that needs to be done.
What can be of interest is learning at least C++11 features since it's now a requirement to build Qt. And nothing forbids you to go on with C++14/17.