May 26, 2019, 11:57 p.m.

Qt

Qt, Развертывание, cqtdeployer, deploy, linux, переносимость qt, QML, Переносимость приложений, Run Linux Application, windows, deployment

Introduction

In this article we will look at how to properly collect all qt dependencies for your application, which was collected dynamically.

Jan. 15, 2019, 3:40 a.m.
Denis Shirokij

Qt

Добрый день! Установил Qt Creator под Windows, но не могу его настроить для удаленной работы с Ubuntu Server. В разделе Инструменты -> Параметры -> Устройство настроил обычное Linux устройство. Проверка связи по SSH проходит успешно, подключение есть. Однако при попытке добавить комплект…

z
Jan. 19, 2017, 7:15 a.m.
z3dd

Qt

Пытался разбираться как связывать данные с чартами и наткнулся на это: http://doc.qt.io/qt-5/qtcharts-audio-example.html В доках на writeData чётко написано: [pure virtual protected] qint64 QIODevice::writeData(const char *data, qint64 maxSize) Writes up to maxSize byte…

Feb. 28, 2016, 9:45 a.m.

Qt

HotKey, linux, QGlobalShortcut, Qt, Windows

In the process of studying the issues with global hotkeys for Linux and Windows, I wrote my library for quick registration hotkeys. The resulting library is called QGlobalShortcut and is available at GitHub under license LGPLv2. The library supports the Windows platform and Linux / Unix (which use X11)

The logic of class QGlobalShortcut, which provides this library, similar to the logic of the class QShortcut, although clearly not up to this class on a number of parameters, but the main thing that fulfills its basic function. Namely, global HotKey register and send a signal to activate it.

At this point it is necessary to use the library to put the header files and source files in your project, as well as to prescribe additional information in the project profile.

Feb. 28, 2016, 9:17 a.m.

Qt

Ubuntu, HotKey, linux, Qt, XCB, XLib

Work with the global keyboard hot keys in Windows is a trivial task than Linux, since this has WinAPI prepared methods that do not require a large amount of code. And each hotkey is set in line ID, in which the hot key can be removed.

In Linux / Unix, which uses the graphics server is the X11, with respect to Qt must use the function to register / unregister hotkeys from XLib library, but the process has to the values ​​obtained using XCB library functionality, which is being developed as an analogue XLib library, but is more low-level and written the C programming language. As in the case of Windows, for processing in the global hotkeys Qt 5 nativeEventFilter used method. I propose to make a separate class, inherited from QAbstractNativeEventFilter for processing hotkeys and set the filter to the entire application.

To set hotkeys to be used XKeysymToKeycode (to get the keys from KeySym sequence of code) and XGrabKey (to set the hotkey).

XUngrabKey function will be used for unregistration hotkey.

Project structure

  • GlobalHotkeyLinux.pro - the profile of the project;
  • mainwindow.h - header file of the main application window;
  • mainwindow.cpp - file source code of the main application window;
  • mainwindow.ui - file forms the main application window;
  • main.cpp - the main source file;
  • nativeeventfilter.h - header event filter file hotkeys;
  • nativeeventfilter.cpp - file source hotkeys event filter.
Feb. 24, 2016, 12:02 p.m.

Xlib

linux, unix, X11, XKeysymToKeycode, Xorg

Name and similar functions

XStringToKeysym, XKeysymToString, XKeycodeToKeysym, XKeysymToKeycode, XConvertCase - convert keysyms

Syntax

KeySym XStringToKeysym(char *string);

char *XKeysymToString(KeySym keysym);
KeySym XKeycodeToKeysym(Display *display, KeyCode keycode, int index);
KeyCode XKeysymToKeycode(Display *display, KeySym keysym);
void XConvertCase(KeySym keysym, KeySym *lower_return, KeySym *upper_return);

Arguments

display       // Specifies the connection to the X server.
index         // Specifies the element of KeyCode vector.
keycode       // Specifies the KeyCode.
keysym        // Specifies the KeySym that is to be searched for or converted.
lower_return  // Returns the lowercase form of keysym, or keysym.
string        // Specifies the name of the KeySym that is to be converted.
upper_return  // Returns the uppercase form of keysym, or keysym.
Feb. 24, 2016, 11:56 a.m.

Xlib

HotKey, linux, X11, XGrabKey

Syntax

XGrabKey(display, keycode, modifiers, grab_window, owner_events, pointer_mode, keyboard_mode)
      Display *    display;
      int          keycode;
      unsigned int modifiers;
      Window       grab_window;
      Bool         owner_events;
      int          pointer_mode, keyboard_mode;

Arguments

display	        // Specifies the connection to the X server.
keycode	        // Specifies the KeyCode or AnyKey.
modifiers       // Specifies the set of keymasks or AnyModifier. 
                // The mask is the bitwise inclusive OR of the valid keymask bits.
grab_window     // Specifies the grab window.
owner_events    // Specifies a Boolean value that indicates whether the keyboard events 
                // are to be reported as usual.
pointer_mode    // Specifies further processing of pointer events. 
                // You can pass GrabModeSync or GrabModeAsync.
keyboard_mode	// Specifies further processing of keyboard events. 
                // You can pass GrabModeSync or GrabModeAsync.
Feb. 23, 2016, noon

Xlib

HotKey, linux, X11, XUngrabKey

Syntax

XUngrabKey(display, keycode, modifiers, grab_window)
      Display *     display;
      int           keycode;
      unsigned int  modifiers;
      Window        grab_window;

Arguments

display	      // Specifies the connection to the X server.
keycode	      // Specifies the KeyCode or AnyKey.
modifiers     // Specifies the set of keymasks or AnyModifier. 
              // The mask is the bitwise inclusive OR of the valid keymask bits.
grab_window   // Specifies the grab window.
Looking for a Job?
25,000.00 руб. - 30,000.00 руб.
Разработчик Qt/C++
Barnaul, Altai Krai, Russia

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

z
Sept. 14, 2019, 6:30 a.m.
zhdv06

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

  • Result:93points,
  • Rating points8
AQ
Sept. 13, 2019, 12:49 p.m.
Ask Questions

C++ - Test 005. Structures and Classes

  • Result:83points,
  • Rating points4
B
Sept. 12, 2019, 2:42 a.m.
Baobab

C++ - Test 005. Structures and Classes

  • Result:58points,
  • Rating points-2
Last comments
Sept. 14, 2019, 4:08 p.m.
Misha Lebedev

Приветствую вас Евгений , давно наблюда за развитием вашего замечательного портала, много полезно тут нашел , переодически зачитываюсь. Теперь по сушеству, делаю портал и там идеально ложи…
Sept. 10, 2019, 3:38 p.m.
Evgenij Legotskoj

function view для модели Article и LikeDislike.LIKE будет выглядеть так def like(request, pk): obj = Article.objects.get(pk=pk) try: likedislike = LikeDislike.objects.get(cont…
OK
Sept. 10, 2019, 3:10 p.m.
Oliver Kolesnikov

тут view написан в class based view, если честно ничего не могу разобрать. Как это всё переписать в function view?
o
Sept. 4, 2019, 2:54 a.m.
omortie

thanks for the application, it helps me a lot
Sept. 1, 2019, 1:51 p.m.
Evgenij Legotskoj

Добрый день, Александр. Это Forward Declaration - Предварительное объявление. Позволяет объявить класс без подключения заголовочного файла в заголовочном файле другого класса. Такое об…
Now discuss on the forum
p
Sept. 15, 2019, 6:10 a.m.
pstMem

Всем привет При выполнении кода под отладкой msvc x64 через некоторое время работы получаю ошибку assert failure in qlist, приложение вылетает. Как правильно настроить qt чтобы при данной о…
Sept. 14, 2019, 7:18 a.m.
Mihailll

Добрый день. Есть такой код QByteArray block; QDataStream out(&block, QIODevice::WriteOnly); out << (quint16)0; if (ui->cbToAll->isChecked()) out …
Sept. 14, 2019, 7:13 a.m.
Mihailll

Можно использовать Flickable, растнянуть на него картинку и двигать
R
Sept. 13, 2019, 7:36 a.m.
RED_Spider

а чому ви не хочите скористатись Q_PROPERTY в С++? простіше, виконуєте свою операції на С++ викликаєте setFilePath("url") івсе
Sept. 12, 2019, 12:11 p.m.
AlexanderBardin

тогда уже oracle, но высоконагоруженные решения это кластеры, распределители нагрузки, может вам зайти с этой стороны? Т.е. понять что потом проще будет мастабировать и поддерживать. тут увы я п…
EVILEG
About
Services
© EVILEG 2015-2019
Recommend hosting TIMEWEB