Qt → Qt/C++ - Lesson 005. QSqlRelationalTableModel - The work with relational tables
QSqlRelationalTableModel, QSqlRelationalTableModel example, qt, qt таблицы, sql, sqlite
In Qt to represent table fields, which involve foreign keys to other tables database, QSqlRelationalTableModel can be used, which is a more advanced version QSqlTableModel class, which was considered in the previous article .
This class allows you to set relationships between tables and substitute values in the representation of the table formed by the values of the connected tables.
This article discusses the option of two tables. One table contains information about the devices (host name and IP address), and the second table ID of the device, which in the second table to be substituted host name and IP address of the device, respectively.
Project Structure for QSqlRelationalTableModel
- Структура проекта
The project for this tutorial is a modified version of the preceding Article and remains unchanged.
Qt → Qt/C++ - Lesson 004. QSqlTableModel – How to present the table from database?
database, QSqlTableModel, QSqlTableModel example, qt, qt таблицы, sql, sqlite
In order to present the information in a database table we can to use the following classes:
- QSqlQueryModel - model that generates a table by defining the raw SQL-query. It may be useful in the formation of a special custom filters and compile information from various database tables. About it in more detail in later lessons.
- QSqlTableModel - the subject of our discussion in this article. The model that generates the table from database using name of table. But we can to create table without information from other tables.
- QSqlRelationalTableModel - a class that allows you to create a table with constraints from other tables, substituting the values of the table, which is the model on contained in other tables record ID.
For comfortable work with information that is placed in the database applied additional class, which partially constitutes a "facade" design pattern.
Project structure for QSqlTableModel
he project is created as an application Qt Widgets, and it contains the following files:
- DataBase.pro - project profile;
- mainwindow.h - header file of mainwindow;
- mainwindow.cpp - source file of mainwindow;
- main.cpp - file with main function;
- mainwindow.ui - interface of mainwindow;
- database.h - header file of helper class to be used for information that is placed in a database;
- database.cpp - source file of helper class to be used for information that is placed in a database;
Qt → Qt/C++ - Lesson 003. QSettings - How to save application settings?
QSettings, QSettings example, QSettings пример, qt, Настройки, сохранение настроек
Saving application settings - this is one of the first things that beginners learn when working with the Qt framework. For this purpose QSettings class that allows you to save the settings or operating system registry or a text file. In this tutorial you will use the easiest option - it is saving the settings in the operating system registry. In order to ensure the visibility of the store the settings in this tutorial use the draft of the lesson QSystemTrayIcon .
Project structure
The project is created as an application Qt Widgets, where files are created by default:
- Settings.pro
- mainwindow.h - header file of the main application window;
- mainwindow.cpp - source window;
- main.cpp - the main source file from which the application starts;
- mainwindow.ui - form of the main application window.
Qt → Qt/C++ - Lesson 002. QSystemTrayIcon - How to minimize the application to the system tray?
QSystemTrayIcon, Tray, qt, трей
Similar article on PyQt5/Python
Today will discuss the way to turn off the application, the Qt framework, written in, the operating system tray using QSystemTrayIcon class. This function is very useful for applications that need to run in the background for a long time mode. For example, video or audio playback application.
Therefore we will work with following questions:
- How to teach your program minimized to tray;
- How to make a popup menu for the tray icon of your applications;
- How to disable this feature if it is not needed.
Data Transmission Technologies → DELL Networking. VLAN Configuring
Configuring VLAN for DELL switches (depending on the version of the OS switch syntax may vary slightly.
Before you configure the VLAN on the switch interfaces, you must make the switch in the VLAN database and create a VLAN interface:
console(config)# vlan database console(config-vlan)# vlan 1972 console(config-vlan)# end console(config)# interface vlan 1972 console(config-if)# name Marketing console(config-if)# end
Data Transmission Technologies → DELL Networking. MLAG Protocol
Campus Switching Architecture
Dell switches networking N-series are based on a modern architecture of campus networks
- Support loop redundancy without the use of STP by using MLAG protocol to create increased access to resources and high bandwidth.
- Smooth interoperability with existing infrastructure for greater compatibility and integration.
- Combining a variety of network products with the latest open standards protocol for more choice in network.
Campus architecture on Dell switches based on functional MLAG protocol launched in version 6.1 operating system, Dell Switches. In this architecture, the two switches N4064F as peers aggregate access switches, which are combined in two stacks as well as peers. Each stack switch maintains a portion of one floor in the building of the campus, which is aggregated with two 10Gbit / c uplink'ami. N4064F aggregation layer switches easily support up to 24 stacks of switches. This architecture provides improved bandwidth, overcoming limitations STP to block redundant ports. Network is designed with a high redundancy in terms of link failure and switches.
Qt → Qt/C++ - Lesson 001. QLineEdit IP Address
ip address, ip адрес, lineedit, qlineedit, QLineEdit example, QLineEdit IP Address, qt, qtcreator
Available similar articles in Qt/QML and PyQt5/Python
When you will develop network applications, you may need to create form for input ip-address, but the use of a simple method setInputMask ( "000.000.000.000; _"); of QLineEdit does not provide the proper result as this mask allows to enter the values of 999, 657, etc., while the IP-address of the limited number of 255.
One way to solve this problem is to use Validator .
Data Transmission Technologies → DELL Networking. CLI (Command Line Interface)
For example, DELL PowerConnect 3524
You can control the device directly via the terminal port or via a Telnet connection. If access is via a Telnet connection, ensure that the device specific IP-address, which will be used by the workstation to access the device and connect the device to use the CLI commands.
Telnet is an emulation on a TCP / IP terminal. RS-232 terminals can be virtually connected to the local device through a TCP / IP network protocol. Telnet is an alternative to the local terminal where you want the remote control of the device. The Switch supports up to 4 Telnet sessions to manage. All CLI commands can be used over a telnet session.
Data Transmission Technologies → SDH - Synchronous Digital Hierarchy (Part 2)
GFP, LCAS, PDH, SDH, SDH-NG, Sonet, VCAT
Compensation of frequency synchronization error
The pointer can not only fulfill a fixed phase shift and mismatch clock multiplexer clocked device, from which the user data is received. To compensate for this effect, the index value is periodically incremented or decremented.
Positive alignment - The pointer is incremented by one, reflecting the delay start of the next container VC-4, three bytes.
Negative alignment - to accommodate the "extra" bytes used three younger byte pointer, ie the NT box (the pointer itself fits in fields H1 and H2)
Data Transmission Technologies → SDH - Synchronous Digital Hierarchy (Part 1)
PDH, SDH, Sonet, STM1, Мультиплексор ввода-вывода, Терминальный мультиплексор
Specific technologies PDH deficiencies have been addressed and overcome technology developers synchronous optical networks (Synchronous Optical NET, SONET), the first version of the standard which appeared in 1984. It was then standardized Committee of T-1 ANSI Institute. As a result of long work ITU-T and ETSI managed to prepare an international standard SDH (Synchronous Digital Hierarchy - Synchronous Digital Hierarchy).
The main goals of SDH developers were:
- Continuity of existing digital channels T1-T3, E1-E3
- Ensuring the hierarchy of speeds far exceeding the speed of plesiochronous digital hierarchy (PDH)
Николай Булахтин
C++ - Тест 003. Условия и циклы
- Result:50points,
- Rating points-4
Николай Булахтин
C++ - Test 001. The first program and data types
- Result:73points,
- Rating points1
- Popular publications in the last 90 Days
- Qt - Selecting data from a QSqlQuery database in a QThread stream and creating a QAbstractTableModel model based on it1.5K
- Qt/C++ - Tutorial 088. Text search with highlighting in QTextEdit1.2K
- Django - Tutorial 041. Display images in the admin panel on the example of a user profile1.1K
- Qt/C++ Tutorial 087. Get the maximum number of multiple input fields QLineEdit939
- Django - Tutorial 043. template tags to form breadcrumb with shema.org support806
Vlad15007
QML - Lesson 004. Signals and Slots in Qt QML
Александр90
Qt/C++ - Lesson 026. Using CallBack function
Александр90
Qt/C++ - Lesson 026. Using CallBack function

Михаиллл
Qt/C++ - Lesson 036. QWebView – How to make simple browser on the Qt

Евгений Легоцкой
Qt/C++ - Lesson 036. QWebView – How to make simple browser on the Qt

IscanderChe
QSqlTableModel + QTableView + кастомный делегат в виде чекбокса

Евгений Легоцкой
Как повернуть расположенные в QTabWidget элементы на 90 градусов?

Евгений Легоцкой
Можно ли использовать классы QTcpServer/QTcpSocket для взаимодействия с android-сервисом?
mr_roman
Не удается запустить акселерометр в android-сервисе

Евгений Легоцкой
For registered users on the site there is a minimum amount of advertising