qt5

Why do I get this “error: undefined reference to `qt_version_tag' ”?

穿精又带淫゛_ 提交于 2020-06-10 03:52:22
问题 I am using Qt 5.7 on Ubuntu 16 LTS machine. I get this error: (.qtversion[qt_version_tag]+0x0):-1: error: undefined reference to `qt_version_tag' This error comes only when I use SDL libraries. 回答1: I realize this is an old thread but you may be able to avoid it by defining QT_NO_VERSION_TAGGING; that is, by passing the option: -DQT_NO_VERSION_TAGGING to gcc. 来源: https://stackoverflow.com/questions/39871879/why-do-i-get-this-error-undefined-reference-to-qt-version-tag

How to build Qt5 for Android?

瘦欲@ 提交于 2020-06-09 17:04:42
问题 I have a server running Ubuntu 12.04 LTS. I would like to put the server to use building Qt5 for the Android ARMv6 platform. How does one go about doing this on a headless server? 回答1: The steps necessary for compiling Qt5 for Android on Ubuntu 12.04 LTS are described below. For the sake of convenience, I will assume that all of the commands below are run in the directory /opt/qt5-android . You will need to adjust the paths accordingly if this is not the case. First you will need to make sure

Show percentage in Qt Pie Charts?

大城市里の小女人 提交于 2020-06-08 13:50:49
问题 How to show percentage in Qt Pie charts on chart like this? 回答1: To do this task you have to enable to make the labels visible and place the position as LabelInsideHorizontal, in the following code the solution is shown. series->setLabelsVisible(); series->setLabelsPosition(QPieSlice::LabelInsideHorizontal); for(auto slice : series->slices()) slice->setLabel(QString("%1%").arg(100*slice->percentage(), 0, 'f', 1)); PyQt5: import sys from PyQt5 import QtCore, QtGui, QtWidgets, QtChart if __name

mousePressEvent of QWidget gets called even though QTabletEvent was accepted

荒凉一梦 提交于 2020-06-08 08:14:47
问题 In a QWidget derived class object with implemented tabletEvent(QTabletEvent *event) and mousePressEvent(QMouseEvent *event), the mousePressEvent gets called every time tabletEvent gets called with type TabletEvent::TabletPress. According to the Qt documentation, this should not happen: The event handler QWidget::tabletEvent() receives TabletPress, TabletRelease and TabletMove events. Qt will first send a tablet event, then if it is not accepted by any widget, it will send a mouse event .

CMake/C++: How to deploy a binary with the necessary shared library?

夙愿已清 提交于 2020-06-01 07:42:05
问题 I'm struggling with the task to generate a binary deployed with the required shared libraries. I created a "hello world" for Qt 5.12 plugins, the app runs as expected in my Ubuntu 18.04 machine, but make install gives an error. I tried the fixup_bundle() approach for resolving dependencies. obs.: I never done this before, I'm new to cmake . cmake_minimum_required(VERSION 3.17) project(plug-use LANGUAGES CXX) set(PROJECT_VERSION_MAJOR 1) set(PROJECT_VERSION_MINOR 0) set(PROJECT_VERSION_PATCH 0

How to make a QGraphicsView background blinking in R - G - B every second

馋奶兔 提交于 2020-05-17 07:08:20
问题 As the title says I am trying to have my QGraphicsView blinking 1 second in red, 1 second in green and 1 second in blue and after that the loop start over again. After doing a lot of research in the past couple of days I didn't have a lot of luck as the main problem is that I am not sure I need to subclass QGraphicsView to obtain the effect I am looking for. I came across some references that I inserted below saying that for this type of problems QPropertyAnimation seems to be the right

Missing crt1.o/crti.o for cross compilation

只谈情不闲聊 提交于 2020-05-17 06:27:06
问题 This question follow a problem on cross compilation: https://stackoverflow.com/posts/61433338/edit I tried to compile Qt5 with gcc 8.3.0 (gnueabihf) but i get the following error while recompilling Qt5: (note this is only the command failing during configure) $/usr/local/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/ftrefou/raspi/sysroot -Wl,-O1 -Wl,-rpath-link,/home/ftrefou/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link

How to change QGraphicsView background color based on specific QString content inside a QListView

淺唱寂寞╮ 提交于 2020-05-17 06:11:08
问题 In order to shrink the problem I made a small verifiable example of a small gui. If you would like to take a glance at the code you can see it here. I have a specific string on a QLineEdit , this string is passed to a QListView via QPushButton as shown below. Those strings are choices of a QComboBox and they are very specific: 1) "[ INFO] Minimum Distance: 5", 2) "[ INFO] Minimum Distance: 10" and 3) "[ INFO] Minimum Distance: 15" The problem: How can I detect the specific QString content

How to create qDebug signal from another thread to the Qt5 GUI thread

北城以北 提交于 2020-05-14 12:15:13
问题 I am trying to display log messages from a work thread in a GUI. I am trying to follow redirect qDebug to QTextEdit It started to work fine, but I am stuck, how to program QObject::connect(otherThread, SIGNAL(debug(QString)), s_textEdit, SLOT(append(QString)), Qt::QueuedConnection); The principle I see, that one signal in the thread shall be connected to a slot in the GUI thread; but how to trigger that signal? Also, I make some logging with QDebug , but also some output to std::cerr . Can I

How to create qDebug signal from another thread to the Qt5 GUI thread

我的未来我决定 提交于 2020-05-14 12:13:30
问题 I am trying to display log messages from a work thread in a GUI. I am trying to follow redirect qDebug to QTextEdit It started to work fine, but I am stuck, how to program QObject::connect(otherThread, SIGNAL(debug(QString)), s_textEdit, SLOT(append(QString)), Qt::QueuedConnection); The principle I see, that one signal in the thread shall be connected to a slot in the GUI thread; but how to trigger that signal? Also, I make some logging with QDebug , but also some output to std::cerr . Can I