Privacy policyContactsAbout siteOpinionsGitHubDonate
© EVILEG 2015-2018
Recommend hosting
TIMEWEB
Dec. 5, 2018, 12:45 p.m.

Qt

Qt, install, drivers, Fierbird, SuSE, QMYSQL, IBASE, mysql

Очередная переустановка ОС в связи с заменой железа.

Установил Suse Leap 15.

Согласно статьи устанавливаем пакеты для разработки и сам Qt.

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

can't find -lGL error

Получается нет библиотеки libGL.  Ее предоставляет  пакет Mesa-libGL-devel и он почему-то не входит в комплект devel_basis.

Устанавливаем...

zypper in Mesa-libGL-devel

Проект собрался и приложение запустилось.

Dec. 4, 2018, 10:47 p.m.

Boost

options, class enum, Program, Boost

A small addition to the article on the use of boost::program_options .

In this appendix I will describe how to use enum enums. Because immediately they do not work. By default, boost::program_options work only with basic types and some types from the standard library, for example std::string .

Dec. 2, 2018, 2:58 p.m.

Linux

Linux, Bash, getopts

When developing a site to automate the deployment process, I wrote several bash scripts.

To customize the behavior of scripts, I use the transfer of arguments, which are handled in the bash script by the getopts library.

Nov. 29, 2018, 7:10 p.m.

Boost

cpp, Boost, linking, C++, static

A small note about static linking Boost, so as not to forget.

Initial data:

  • OS Windows
  • MSVC 2017 64bit
  • Boost 1.68.0
  • CMake project
An example will be shown in the simplest version without special variable settings. Maximum default.

Nov. 28, 2018, 6:58 p.m.

Java

Java, synchronization, threads, processes

I propose to consider several ways to synchronize threads and processes that are most commonly used in Java. They differ in implementation and use cases. We will consider all methods on interesting examples.

Critical section

This method is suitable for you if:

  • parallel threads work with a shared resource;
  • requires synchronization between threads, not processes;

This method of synchronization is called resource synchronization ("open – close" synchronization). The idea of this method is that each object in Java has an associated monitor . A monitor is a kind of tool to control access to an object.

Nov. 25, 2018, 10:11 p.m.

Qt

QLineEdit, max, Qt

Напишем небольшое приложение для получения максимального числа из нескольких полей QLineEdit.

This means that we will have several QLineEdit fields, let's say 4 pieces into which numbers will be entered. And there will be the fifth field QLineEdit in which the result will be displayed. We also have a QPushButton button, by clicking we will get values from all QLineEdit fields and among them we will look for the maximum number that has been entered into these fields.

The application will look like this

Nov. 20, 2018, 12:42 p.m.

Qt

QThread, Qt, QAbstractTableModel, QSqlQuery

There was a need to obtain a large amount of data from the database for the subsequent work of the user with them (Reference book of goods in a particular store).

For the code do not kick much. Programming for me is a hobby for the mind.

The query itself takes a long time. For this, we do it in the stream, display the endless ProgressBar to the user with the sentence "Lean back and wait." :-)

Nov. 18, 2018, 2:52 p.m.

Qt

QSequentialAnimationGroup, cpp, Qt, C++, QPropertyAnimation

Let's write a small example of an application in which a button will be moved using property animations. To do this, we use the QSequentialAnimationGroup and QPropertyAnimation classes.

QSequentialAnimationGroup is a class that combines several animations into one group, which allows you to automatically start one animation when the previous QPropertyAnimation has completed.

Animation will be launched by pressing the button and this button will move in the window as shown in the image.

Nov. 18, 2018, 10:57 a.m.

Boost

cpp, Boost, Menu, C++

And here is an article on the boost of my some accumulated materials. I offer you the option of writing a console program with support for the console menu, which is implemented using boost::program_options .

boost::program_options is responsible for processing the arguments passed to the program and sets all the necessary variables without the need to implement long logic from if else branches. This is already implemented inside boost::program_optons .

Suppose our program takes the following data as arguments

  • input file path
  • output file path
  • the size of the block being processed, no matter why, we will not do anything with it, just have such a parameter in the program.

Also, the program will have a help menu, which will be the console menu.

The figure below shows the use of this program.

Nov. 6, 2018, 10:13 p.m.

EVILEG

EVILEG, Развитие, News

After talking with one of the users, I decided to change the policy regarding advertising on the site, although I am not sure about that.

I myself am not pleased with the abundance of advertising banners, but I would like to receive sufficient income from the site in order to switch to part-time work and put more effort into the development of the site. I really enjoy the site, it's interesting. But at the moment you have to choose between a hobby and a job.

A
Jan. 22, 2019, 9:22 p.m.
Allyonz

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

  • Result:40points,
  • Rating points-8
A
Jan. 22, 2019, 2:15 p.m.
Alex

Qt - Test 001. Signals and slots

  • Result:89points,
  • Rating points6
IO
Jan. 20, 2019, 6:39 p.m.
Ivan Otreshko

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

  • Result:0points,
  • Rating points-10
Last comments
Jan. 22, 2019, 1:17 p.m.
Евгений Легоцкой

Создайте тогда тему здесь на форуме в разделе Qt с выкладками кода и вашими попытками внедрения делегата, позже гляну или может кто-то ещё глянет из опытных пользователей.
I
Jan. 22, 2019, 1:13 p.m.
IscanderChe

Не проще тогда использовать сразу кастомный делегат с чекбоксом? Я попробовал, но там засада в том, что чекбокс показывается только при щелчке на ячейку, а дефолтно показывается значение. Как ...
Jan. 22, 2019, 12:15 p.m.
Евгений Легоцкой

Если будет не приемлемо потом, то тогда через кастомный Item Delegate нужно будет перерисовать ячейки в той колонке.
I
Jan. 22, 2019, 12:09 p.m.
IscanderChe

Получилось приемлемо. Спасибо!Нюанс только в том, что поле рядом с чекбоксом не пропадает, оно просто пустое, что видно при выделении ячейки. Но этого достаточно.
Jan. 22, 2019, 11:50 a.m.
Евгений Легоцкой

Переопределить метод data для той колонки и роли Qt::DisplayRole, чтобы в том случае возвращался QVariant() я так думаю... Но возможно, что у вас там будут нюансы, если вы туда чекбокс за...
Now discuss on the forum
Jan. 23, 2019, 7:54 a.m.
Михаиллл

Зарание спасибо.А еще на эту тему можно будет сделать статью. Это контент будет уникальным.
Jan. 23, 2019, 7:37 a.m.
Евгений Легоцкой

Hello. Maybe the English will be better for you? I think russian is not native language for you, or did I mistake? Did I undesrtood rightly, that you mean this documentation ( ...
I
Jan. 22, 2019, 1:45 p.m.
IscanderChe

Всем добрый день. Суть задачи: надо, чтобы в одной из колонок QTableView вместо хранимого в QSqlTableModel значения выводился чекбокс и при смене состояния чекбокса значения в базе тоже ...
M
Jan. 22, 2019, 1:15 p.m.
Max-P85

Евгений, огромное спасибо, все работает!
Join us in social networks

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