Evgenij LegotskojAug. 31, 2015, 9 p.m.

AVRMacro Assembler in the example of AVR

AVR, macro, Assembler

Macro - a set of commands and instructions that are grouped together into a single command to automate programming tasks, speed up frequently performed editing and formatting actions.

Macros can also be used to accelerate software development for microcontrollers on Assembler programming language. During compilation macros are replaced by a sequence of commands microcontroller. Such an approach to programming facilitates the perception of the program code, reduce the size of the source, as well as to bring the programming in Assembler in appearance to the programming language C.

Evgenij LegotskojAug. 31, 2015, 10:39 a.m.

QtQt/C++ - Lesson 013. QMenu – How to work with context menu in QTableView?

QMenu, QMenu example, QMenu Qt, Qt, контекстное меню, меню

To use the context menu in Qt is used QMenu class. When performing actions that should cause the menu handler is called, which creates the menu and binds handlers to act in this menu.

In this lesson, work with the shortcut menu will be shown in the example code from the tutorial on working with QDataWidgetMapper. In this lesson, the two files from the previous lesson will be modified, but the project will not work if you do not include it as in the previous lesson files that can not be edited.

Project structure for QMenu

Project structure remains the same as in the tutorial, which is based on the lesson. Changes in the code will be subjected to only two files:

  • mainwindow.h
  • mainwindow.cpp
Evgenij LegotskojAug. 30, 2015, 10:33 a.m.

QtQt/C++ - Lesson 012. QShortcut – How to work with Hot Keys in Qt?

QShortcut, QShortcut example, Qt

Even in the official documentation on the topic QShortcut written not so much, so it's probably a note not to forget, not a full-fledged article. Just a few words about how to connect QShortcut entity that will be responsible for processing pressing a hotkey or keyboard shortcuts, such as Ctrl + D .

Project structure for QShortcut

The project structure is so trivial that I will not even bring it in this article. I shall confine myself to only those words that we will work with two files:

  • mainwindow.h
  • mainwindow.cpp

And even mainwindow.ui file will not touch this project. As it will be created by default, so it and leave.

Evgenij LegotskojAug. 30, 2015, 3:40 a.m.

QtQt/C++ - Lesson 007. Filter for records in QSqlTableModel

QSqlRelationalTableModel, QSqlTableModel, QSqlTableModel example, фильтр

Continuing to work with tables to Qt, we would like to spent the time, how to install the filter on the model of data representation in QSqlTableModel or QSqlRelationalTableModel . Therefore, the program code of the tutorial on QSqlTableModel was taken to describe the installation of the filter as a basis for the process.

The code was written in QtCreator 3.3.1 based on Qt 5.4.1.

Project structure

In this lesson, the project structure is similar to the project of the lesson QSqlTableModel.


Add the additional object in the main window of the application, namely, to add the following elements:

  • dateEditFROM - start date;
  • dateEditTO - end date;
  • timeEditFROM - start time;
  • timeEditTO - end time;
  • pushButton - button, by pressing which the filter will be applied.

Evgenij LegotskojAug. 28, 2015, 9:34 a.m.

QtQt/C++ - Lesson 011. XML files in Qt – Reading and Writing

Qt, QXmlStreamReader, QXmlStreamWriter, XML, xml example

Qt development tools include functionality for working with XML files, which allows you to create XML files and read them, which may be useful to create the automatic creation of XML markup software, configuration files, using XML, or for parsing XML-files .

To record in an XML file format used QXmlStreamWriter class, while the other is used QXmlStreamReader class to read an XML file.

The project structure for working with XML file

This project uses the minimum number of files:

  • XMLExample.pro - profile;
  • mainwindow.h - header file of the main application window;
  • mainwindow.cpp - source of window;
  • main.cpp - the main source file from which the application starts;
  • mainwindow.ui - form of the main application window;
Evgenij LegotskojAug. 26, 2015, 9 p.m.

AVRUSI in Attiny24 - settings of Two-wire mode

Attiny24, USI

USI - Universal Serial Interface (Universal Serial Interface) is actually a workpiece for hardware serial transmit and receive data. This interface is not a ready-made solution for some specific data transmission protocol, but provides a more convenient way to transfer data than in the case of full software solution.

The essence of this interface is that it offers a level of hardware to transmit and receive serial data and protocol operation logic is the responsibility of the software implementation.

Evgenij LegotskojAug. 26, 2015, 9:15 a.m.

QtQt/C++ - Lesson 010. QSplitter – how to add splitter?

QPallete, QSplitter, QSplitter color, QSplitter example, Qt

Qualitative layout always increases application usability, and this is true for all kinds of applications, from desktop to mobile. One such interface elements, which can improve usability is QSplitter class, which is an object-type layout with a movable divider that separates the two areas in the application interface.

Project Structure for QSplitter

Project Structure for QSplitter

Project structure completely unremarkable and a little interesting, since the main actions will be carried out in the designer, and QSplitter in mainwindow.cpp setting will produce a minimum.

Evgenij LegotskojAug. 24, 2015, 9 p.m.

AVRMUL - multiplication operation in AVR Attiny

Attiny, MUL

MUL - multiplication instruction in microcontrollers, is present, for example, microcontrollers Atmega. But not all AVR microcontrollers there is hardware support multiplication of functions. For example, in microcontrollers Attiny MUL team simply does not exist, so the solution to this problem lies with the program code.

The main point to be taken into account in the implementation of the multiplication function is that to save the multiplication result will need two registers. In one of the registers will be kept low byte of the result, and in the second case bude saved significant byte result.

Evgenij LegotskojAug. 22, 2015, 9 p.m.

AVRBCD format in Assembler in AVR Atmega

BCD, Atmega

Decimal numbers machine language may be represented in the form of eight-bit sequences of ones and zeros, that is bytes. However, there are two types of presentation formats decimal numbers. It is packed format (BCD), and unpacked.

Uncompressed format

In this format, one digit of a decimal number is placed in one byte. Namely LSnibble bytes, whereas the most significant nibble (referred to as a zone) is filled units. For example, the number 157 would be as follows.

Evgenij LegotskojAug. 21, 2015, 9:30 p.m.

AVRTWI interface in microcontrollers AVR Atmega

TWI, Atmega

I remembered a little hardcore in Hardwar with TWI interface, which takes a few years ago. Who would not say, and Assembler perfectly cleanses the brain and develops an understanding of the algorithms. The most important thing I learned while working with AVR microcontrollers on Assembler, is the fact that all the operations, all directives, all functions must be written in a clear sequence. After all, if the write data in the register is not in the sequence, then your controller firmware does not work. And when writing code in high-level languages, sometimes you can see a complete indifference to the sequence of calling functions and methods, though often in the instructions to the libraries can be read, in what order you need to initialize a particular functionality, to get everything working. But who would read them carefully? Well, if you dear reader to read this paragraph instead skopipastit immediately imagine a software library of code that is shown below.


Let me recommend you the excellent hosting on which EVILEG is located.

For many years, Timeweb has been proving his stability.

For projects on Django I recommend VDS hosting

View Hosting

C++ - Test 001. The first program and data types

  • Result:73points,
  • Rating points1

C++ - Тест 003. Условия и циклы

  • Result:64points,
  • Rating points-1

C++ - Test 001. The first program and data types

  • Result:86points,
  • Rating points6
Last comments

QML - Lesson 016. SQLite database and the working with it in QML Qt

Добрый день! можно как то обойтись без метода updateModel()? После вызова этого метода происходит перерисовка страницы(если я правильно понимаю), и все элементы, например, CheckBox перерисовываю…

QML - Lesson 016. SQLite database and the working with it in QML Qt

Добрый день, пытаюсь разобраться и подргнать пример под себя. Есть бд с огромным количеством полей. В приложении на виджетах при использовании QTableView все работает и путем простого sql запрос…

Django - Tutorial 039. Adding private messages and chats on the site - Part 2 (Dialogue and chat counter with unread messages)

Добавляйте поле файла в модель сообщения. И в форме сообщения указывайте, что поле с файлом.

Django - Tutorial 023. Like Dislike system using GenericForeignKey

все, я со всем разобрался!) Извините!)
Now discuss on the forum

применяется некорректное разрешение для стилей под обычным пользователем

Привет. Такая проблема на ALT Linux: если запускать приложение от руута, то со стилями и размером шрифта всё в полном порядке. Если же мы запускаем приложение под обычным пользователем, то …

Наследование QWidget

Это утверждение ничего не значит. Наличие методов и т.д. не делает обязательным наследование в том виде, в котором вы его изначально попытались сделать. Тем более, если у вас будет два видж…

Динамическое заполнение StackLayout в qml

Всем привет. Пытаюсь решить такую задачку, есть TabBar и его кнопки. StackLayout{ currentIndex: tabBar.currentIndex A {id: tabA} B {id: tabB} C {id: tabC} D {id: ta…

QML: изменение стиля при наведении и при нажатии на кнопку

enabled = false перестанет быть активной и не будет ни на что реагировать) Хм.. по-моему пробовал такое. Проверю ещё раз после работы. Ура, спасибо большо…

Динамическое наполнение StackView QML

Во затупил))) Спасибо за все))) StackView.push("ModuleTip1.qml") ну или в сложной иерархии StackView.push("qrc:/folder/ModuleTip1.qml") и всего делов... Не пойму, почему сра…
© EVILEG 2015-2020
Recommend hosting TIMEWEB