Advanced search

JavaExample - Factory Method in Java

In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. This is done by creating objects by calling a factory method—either specified in an interface and implemented by child classes, or implemented in a base class and optionally overridden by derived classes—rather than by calling a constructor.

AndroidAndroid. Java vs Qt QML - Tutorial 005. Create a context menu

March 6, 2018, 1:17 a.m.

Qt, Menu, JAVA, Android, QML

After we figured out how to create a menu in the Action Bar, add a context menu to any objects.

In this lesson, we'll add two text fields that will have a context menu.

  • The context menu of the first text field will change the color and size of the text in the first text field
    The context menu of the second text box will simply change the text in the second text field.

The first context menu will have two submenus, the first will be responsible for changing the color, and the second will be responsible for resizing.

ActionBar in Java Activity is disabled so that it does not interfere.

AndroidAndroid. Java vs Qt QML - Tutorial 004. Creating a menu in the Action Bar from the submenu

March 2, 2018, 1:53 a.m.

Qt, JAVA, Android, QML

So, we continue to implement the same functionality in applications for Android from two fundamentally different worlds. Namely on traditional Java and less widespread Qt QML C ++.

This time we implement the menu in ActionBar Activation. I note that ActionBar for the variant with QML will have to write independently, because there is no such element in Qt QML, but it is implemented through the ToolBar component. Since this moment was described in the lesson about Hello World , in this lesson we will not dwell on it, just take ActionBar into a separate QML file, making it a separate type of QML and adding a menu icon to it, by clicking on which we will call the menu.

The menu will be as follows:

  • Information
    • First
    • Second
  • About

In the center of the application window there should be text that will be replaced by other text when you click the following menu items

  • First
  • Second
  • About

AndroidAndroid. Java vs Qt QML - Tutorial 003. Console messages and Toast pop-up messages

March 1, 2018, 1:58 a.m.

Android, Toast, QML, log, Qt, JAVA, console

In the previous article , two buttons were created, which were responsible for changing the text in the text field. And now let's consider the option when we need to output information to the console about the button presses, or to display a pop-up message. That is, we modify the previous lesson.

In fact, this will be the very moment when there will be almost no additional differences in the code. In both cases, there are corresponding Classes / Types that are responsible for all this functionality.

Output to the console

In the case of Java, the Log class serves for this, and in the case of QML, the console functional is used for this, which is familiar to Web programmers.

Console messages have different levels of importance:

  • WARN
  • NFO

AndroidAndroid. Java vs Qt QML - Tutorial 002. Handling of button clicks

Feb. 27, 2018, 1:40 a.m.

Qt, Android, JAVA, button, QML

After we got acquainted with Hello World from the Java world and Qt QML under Android, I suggest writing an application that will have two buttons and by clicking on these buttons it will change the text in a small text field. Applications should look the same, but not 100 percent identical. If desired, this can be achieved, but in this example is not necessary.

In both cases, Material Design will be used.

Before looking at the program code, let's look at the appearance of both applications.

An application that is written in Java

AndroidAndroid. Java vs Qt QML - Tutorial 001. Hello World

Feb. 19, 2018, 1:13 a.m.

Qt, JAVA, Android, QML

Curiosity sake decided to compare the two options for writing applications for Android. Once upon a time, I began to work on programming for Android on Java, but over time I switched to developing Desktop applications on Qt QML. But now again decided to refresh some aspects of memory to make sure that Qt QML I like more.

Immediately give the result of two Hello worlds. They certainly will not be 100 percent identical, but should be similar. As a basic example, take an empty Activity, which is created in Android Studio.

The first sample is Hello World in Java

June 16, 2017, 6:45 a.m.

QtQImage не может определить тип изображения сделаного средствами JAVA

Собственно изображение (снимок на WEB-камеру через браузер средствами JAVA JCrop), который не может определить QImage.
Задумка была вставлять обрезанное изображение с оттенками серого в QLabel, но дальше обрезки дело не идёт.
На выходе QImage::format() полчую - 0 что говорит о неверн…

How to become an author?

Contribute to the evolution of the EVILEG community.

Learn how to become a site author.

Learn it

Good day, Dear Users!!!

I am Evgenii Legotckoi, developer of EVILEG. And it is my hobby project, which helps to learn programming another programmers and developers

If the site helped you, and you want also support the development of the site, than you can donate by following ways


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 Timeweb
June 5, 2020, 2:25 p.m.

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

  • Result:33points,
  • Rating points-10
June 5, 2020, 1:09 p.m.
Artem Kin'ko

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:0points,
  • Rating points-10
June 5, 2020, 2:28 a.m.

Qt - Test 001. Signals and slots

  • Result:0points,
  • Rating points-10
Last comments
June 5, 2020, 10:52 a.m.

Распознавание изображений на Python с помощью TensorFlow и Keras

Огромное спасибо за метериал, по-больше бы подобных статей (с подробным описанием работы и примерами применения) на тему современных технологий. Вопрос поразмышлять. На текущий момент реал…
June 5, 2020, 1:39 a.m.
Evgenij Legotskoj

Qt/C++ - Tutorial 091. How to write a custom delegate controlling the highlighting of a row in a table

По-моему, смысла в этом нет особого. Если делегат будет игнорировать настройки таблицы, то это приведёт ещё к большему непониманию, что вообще происходит, для программиста, который после вас буд…
June 5, 2020, 1:34 a.m.

Qt/C++ - Tutorial 091. How to write a custom delegate controlling the highlighting of a row in a table

Сижу, размышляю: можно ли переписать делегата так, чтобы независимо от настроек строк выделялись строки?
June 5, 2020, 1:31 a.m.
Evgenij Legotskoj

Qt/C++ - Tutorial 091. How to write a custom delegate controlling the highlighting of a row in a table

Понятно. Я не обратил внимания на то, что там было в старом коде по настройкам строк :)
Now discuss on the forum
June 5, 2020, 1:09 p.m.

QPlainTextEdit настройка цвета фона

Вечер добрый. Пытаюсь настроить цвет фона QPlainTextEdit следующим образом: CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent){ ... QPalette::ColorRole role = bac…
June 5, 2020, 6:13 a.m.

Фильтр для QtableView sql

Добрый день. Для такой фильтрации необходимо использовать QSortFilterProxyModel. В оффдоках есть хороший пример.
June 4, 2020, 2:46 a.m.
Mihail A

Qt- C++ QTableView подсветить строку

June 3, 2020, 1:49 a.m.

Можно ли сделать в QML таблицу как в Excel?

edi-tableview - нашел пока такое выглядит коряво, посмотрим что можно сделать
June 2, 2020, 2:46 a.m.
Evgenij Legotskoj

Медиа файлы Google Firebase

Картинки можете попробовать сжимать через QPixmap, там есть возможность установки scaleFactor, через него можете устанавливать нужные параметры. А что касается конвертации видео, то лучше п…
© EVILEG 2015-2020
Recommend hosting TIMEWEB