Privacy policyContactsAbout siteOpinionsGitHubDonate
© EVILEG 2015-2018
Recommend hosting
Aug. 15, 2015, 4:31 p.m.


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.

Aug. 14, 2015, 5:44 p.m.


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:

  • - 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;
Aug. 13, 2015, 5:29 p.m.


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:

  • 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.
Aug. 12, 2015, 4:27 p.m.


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.
Aug. 11, 2015, 4:12 p.m.

Data Transmission Technologies

DELL, vlan, voice vlan

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
Aug. 10, 2015, 3:59 p.m.

Data Transmission Technologies


Campus Switching Architecture

Dell switches networking N-series are based on a modern architecture of campus networks

  1. Support loop redundancy without the use of STP by using MLAG protocol to create increased access to resources and high bandwidth.
  2. Smooth interoperability with existing infrastructure for greater compatibility and integration.
  3. 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.

Aug. 10, 2015, 4 a.m.


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 ( "; _"); 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 .

Aug. 9, 2015, 3:52 p.m.

Data Transmission Technologies


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.

Aug. 8, 2015, 8:49 a.m.

Data Transmission Technologies


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)

Aug. 7, 2015, 8:39 a.m.

Data Transmission Technologies

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)
Last comments
Feb. 14, 2019, 6:41 p.m.

Спасибо огромное! Заработало!
Feb. 12, 2019, 9:26 a.m.

Сам разборался, спасибо.
Feb. 12, 2019, 8:19 a.m.

День добрый! Можешь выложить форму mainwindow.ui от урока? Заранее спасибо
Feb. 11, 2019, 10:51 a.m.
Евгений Легоцкой

Нет, у меня проблема с жёстким диском случилась, занимался восстановлением ПК, ещё пару вечеров придётся этим заниматься, увы.
Now discuss on the forum
Feb. 15, 2019, 9:22 p.m.

Доброй ночи.Скромно напоминаю о своём вопросе...
Feb. 15, 2019, 3:36 p.m.
Евгений Легоцкой

Ну я тут нашёл одно решение, но сам его не проверял. Вам нужно помещать фамилии скорее всего в ячейки заголовка, и потом просто перерисовывать их QHeaderView * header = m_ui->tableWidget...
Feb. 15, 2019, 7:53 a.m.
Евгений Легоцкой

Добрый день! Не работал с remoteobjects, поэтому глянул документацию, чтобы рассмотреть, что это за зверь. После просмотра документации сложилось стойкой впечатление, что это вполне возм...
Feb. 14, 2019, 6:28 p.m.

Нашел решение на Java. Удалось интегрировать в проект сервиса на Qt, теперь из Qt запускаю Java-код акселерометра.
Feb. 14, 2019, 11 a.m.
Евгений Легоцкой

ok. I see. You changed related name Try this {% if goal.joined.all|user_in:request.user %}
Join us in social networks

For registered users on the site there is a minimum amount of advertising