-
Notifications
You must be signed in to change notification settings - Fork 0
QtQuickNotes
- http://doc.qt.io/qt-5/qtwidgets-mainwindows-application-example.html
- http://doc.qt.io/qt-5/qtwidgets-tutorials-notepad-example.html
- http://doc.qt.io/qt-5/examples-widgets.html
- http://doc.qt.io/qt-5/mainwindow.html
- Go to https://www.qt.io/download
- Click on: 'Go open source'
- Click: 'Download the Qt Online Installer' (a fair bit down)
- click on 'Download'
- chmod +x ~/Downloads/qt-unified-linux-x64-4.3.0-1-online.run
- ~/Downloads/qt-unified-linux-x64-4.3.0-1-online.run
Source: https://forum.qt.io/topic/47930/main-window-class-vs-widget-class/4 When working with widgets the practical choice is between QMainWindow, QWidget and QDialog.
The QDialog choice is obvious for, well, dialogs. It includes and exec() method to start a local loop and has methods to standard dialog actions - accept and reject (ok/cancel).
QMainWindow has features for building a main app experience. It has built-in specialized layout for housing status and tool bars. It also has a powerful docking capabilities for creating dynamic app layouts using QDockWidgets.
QWidget is the generic choice when you don't need any of the above capabilities. This is often true for various tool windows, widgets meant to be embedded in the QDockWidgets and all the windows types that don't have rich widget-based UI eg. games or visualization windows.
Depending on an app type there's usually a single QMainWidget used for the main app window, several smaller QWidget based windows as docks, visualization and tool windows and occasional QDialogs for "talking" to the user.
- qtdialog
- qmake
-
/path/to/qt/installation/5.7/gcc_64/bin/qmake -makefile -o Makefile /path/to/sysinfoproject/ch02-sysinfo.pro
-
make
-
the moc_*.cpp file) containing everything Qt needs to properly handle your signals and slots.
- '#' : comment line
- = : This operator sets the variable to the value.
- += : This operator adds the value to a list of values.
- -= : This operator removes the value from the list.
- *= : This operator adds the value to the list only if it is not already present.
- ~= : This operator replaces any values that match a regular expression with the specified value, DEFINE ~= s/DEBUG_FLAG/debug .
- QT : This is a list of the Qt modules used in the project. In the platform-specific Makefile, each of the values will include the module headers and the corresponding library link.
- CONFIG : This is a list of configuration options for the project. Here, we configure the support of C++14 in the Makefile.
- TARGET : This is the name of the target output file.
- TEMPLATE : This is the project template used when generating the Makefile.app tells qmake to generate a Makefile targeted for a binary. If you are building a library, use the lib value.
- macx/linux/windows : for that OS only
- windows {
- SOURCES += SysInfoWindowsImpl.cpp
- HEADERS += SysInfoWindowsImpl.h
- }
- You can even have else if/else statements:
- windows {
windows|unix {
SOURCES += SysInfoWindowsAndLinux.cpp
} else:macx {
SOURCES += SysInfoMacImpl.cpp
} else {
SOURCES += UltimateGenericSources.cpp
}
- message($$COMPILE_MSG linux) : display string, during compilation.
- error(string) : This function displays the string and exits the compilation immediately.
- exists(filename) : This function tests the existence of the filename . qmake also provides the ! operator, which means you can write !exist(myfile)
- include(filename) : This function includes the content of another .pro file.
- qmake -makefile -o Makefile project.pro
- -makefile: generate a 'Makefile' based on your project.pro file.
My personal take on how to decide if it goes in view on controller:
If the same code would have to be implemented(the same way) between two views(desktop vs mobile) then it is probably controller code.
- The Model manages the data. It is responsible for requesting for the data and updating it.
- The View displays the data to the user.
- The Controller interacts with both the Model and the View.
- It is responsible for feeding the View with the correct data and sending commands to the Model based on the user interaction received from the View.
A: You have to run the local install instead of the system install ~/Qt/5.11.2/gcc_64/bin/qdoc project.qdocconf
- https://forum.qt.io/topic/89038/how-to-properly-structure-qttest-project/3
- https://github.com/qt/qtbase/tree/5.11/tests/auto
- http://doc.qt.io/qt-5/qtwidgets-mainwindows-application-example.html
-
https://forum.qt.io/topic/53814/qlayout-attempting-to-add-qlayout-to-mainwindow-which-already-has-a-layout-solved/4
- setCentralWidget(central);
-
I seems that grid layout need to be in a QWidget.
-
By default items will be arranged according to the flow property. The default value of the flow property is GridLayout.LeftToRight.
See: https://forum.qt.io/topic/58057/solved-invalid-use-of-incomplete-type-class-ui-mainwindow/2
Was missing: #include