qt5

Using an existing Q_PROPERTY to animate QGraphicsItem inheriting QObject

笑着哭i 提交于 2020-01-07 05:34:08
问题 I have 2 classes, one MainWindow in which we draw in a QGraphicsView a circle (which intend to become a button !) created thanks to an other class. The class MyCircle inherits from QObject and QGraphicsItem since I want to make animation. My issue is the following : My goal is first to make a simple animation on my drawing : make it smaller then it goes back to the original size. So I suppose I should use the property geometry, already existing in the QObject class. To do this I write in my

Qt Error : Procedure Entry Not Found

戏子无情 提交于 2020-01-07 04:11:32
问题 I am making a project in Qt 5.6.1. When I run it inside Qt Creator, it runs perfectly. But when I run it inside the folder, it shows: The procedure entry point ??0QVariant@@QAE@ABVQString@@@Z could not be located in the dll Qt5Core.dll. How can I fix it? 回答1: If you have multiple versions of Qt installed everything might work well inside QtCreator where the Kits are set properly. When you run from the build directory directly it might happen that you have another version of Qt in paths which

How to find reason for app crash on close?

扶醉桌前 提交于 2020-01-07 02:13:53
问题 My Qt5 app crashes when I hit the close window returning: MyApp(28741,0x7fff7aa73000) malloc: *** error for object 0x7fc40bc8e300: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug The program has unexpectedly finished. Classic approach to recover it, I guess, is to disable application modules (should I say parts of it, when things are not so well organized) systematically until the problem appears. Is there some (more) intelligent way to solve this

How to know when QSerialPort is ready for more data in Qt5?

。_饼干妹妹 提交于 2020-01-06 23:51:00
问题 Is there some way to be notified when my serial device is ready to receive more data? I am implementing a program that feeds commands to a servo controller over serial using the asynchronous API of QSerialPort. The program works, but it seems that I am experiencing congestion. In my application I keep a registry of most updated servo position that I wish to synchronize with the controller with as low latency as possible. My attempt at pushing new data to the serial port as quickly as time

How to deploy QT5.2 application?

流过昼夜 提交于 2020-01-06 17:55:07
问题 I have QT 5.2 installed on Ubuntu 12.04. I did not build it, but simply downloaded and unzipped from the QT website. My question is how can we package the required libs along with the executable for deployment? The QT documentation says that we should build QT for static linking, but the "configure" file is missing in the QT directory. Thanks in advance. 回答1: Ok. So I finally managed to deploy my Qt app along with its dependencies after countless hours of googling. This was done on Ubuntu 12

Enable native MacOS Mojave Dark Theme PySide2/Python apps on QT 5.12

时间秒杀一切 提交于 2020-01-06 08:31:55
问题 I would like to know to enable the native MacOS Mojave Dark Theme (and if could be multiplatform win/linux, the better) which is supposed to be available from QT 5.12 (which I guess, it should be available in PySide2). By default, the apps are still the same way, I don't know what to do to enable it. Thanks!! P.S.: using python 2.7.10 (and the solution of pyinstaler works!!, but not running python directly) 回答1: It's not clear how are you running your application. As a module python -m

QFileSystemModel and QTreeView - strange behavior when resetting view

妖精的绣舞 提交于 2020-01-06 08:14:18
问题 I wrote this on official forums of Qt, but it seems dead, so I am going to copy-paste it here. I am writing small program for copying files. I use QTreeView and I have inherited from QFileSystemModel , so I was able to add checkboxes to every row in the QTreeView . I also use setNameFilters method connected with QLineEdit , so user can specify what file extensions he wants to display in the QTreeView . I have spotted the following behavior: 1) When I run the program and enter extensions to

Does deleting layout deletes its sublayouts?

家住魔仙堡 提交于 2020-01-06 07:09:52
问题 I am working on Qt application. There I am creating layout and adding sublayout. I have seen that calling addLayout() sets as parent the container layout. Does that implies than when I delete superlayout its descendants will get deleted too? QWidget* centralWidget = new QWidget(this); QVBoxLayout *mainLayout = new QVBoxLayout(centralWidget); QFormLayout *formLayout = new QFormLayout; mainLayout->addLayout(formLayout); Will deleting centralWidget delete formLayout? Thanks and regards 回答1:

Quick Controls 2 bad looking

浪尽此生 提交于 2020-01-06 07:07:50
问题 Qt 5.10, Windows 10 desktop. The following QML code: import QtQuick 2.10 import QtQuick.Window 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 Window { visible: true width: 250 height: 100 title: qsTr("My app") GridLayout { columns: 2 Label { text: "Setting1:" } ComboBox { model: ["100%", "90%", "80%", "70%", "60%", "50%", "40%", "30%"] } CheckBox { id: tidle text: "Setting2:" } ComboBox { model: ["90%", "80%", "70%", "60%", "50%", "40%", "30%"] enabled: tidle.checked } } } gives

Found unsuitable Qt version “5.12.4” from C:/Qt/5.12.4/msvc2015_64/bin/qmake.exe when configuring Eigen 3.3.7 using CMake

流过昼夜 提交于 2020-01-06 06:59:10
问题 Environment: Windows 10 version 1903, 64 bit CMake 3.15.3 Qt 5.12.4 Eigen 3.3.7 Visual Studio 2015 Update 3 Issue: When I run cmake -G"Visual Studio 14 2015 Win64" .. in build folder created in Eigen 3.3.7 root folder, I got the following error message: -- Found unsuitable Qt version "5.12.4" from C:/Qt/5.12.4/msvc2015_64/bin/qmake.exe -- Qt4 not found, so disabling the mandelbrot and opengl demos I have googled for days but the articles are either about other platforms or do not work. For