qt

Drag and drop in QML [closed]

[亡魂溺海] 提交于 2021-02-18 18:06:00
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 months ago . Improve this question How can I develop drag and drop functionality in QML? I want to drag and drop one image to another. 回答1: At this point in time, you will probably need to use C++, especially if you want to accept drops from outside the QML application (e.g. the user drags a

Drag and drop in QML [closed]

删除回忆录丶 提交于 2021-02-18 18:05:50
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 months ago . Improve this question How can I develop drag and drop functionality in QML? I want to drag and drop one image to another. 回答1: At this point in time, you will probably need to use C++, especially if you want to accept drops from outside the QML application (e.g. the user drags a

Qt modbus serial port flow control handling

萝らか妹 提交于 2021-02-18 16:58:49
问题 I'm writing a small program using QModbusDevice over the serial port (using the QModbusRtuSerialMaster class) and have some problems. One of the problems seems to be that the flow control of the serial port is incorrect. Checking in a serial port sniffer I see that a working client sets RTS on when it sends requests, and then RTS off to receive replies. When I use QModbusRtuSerialMaster to send messages that doesn't happen. The message is sent correctly (sometimes, subject for another

Qt modbus serial port flow control handling

回眸只為那壹抹淺笑 提交于 2021-02-18 16:58:01
问题 I'm writing a small program using QModbusDevice over the serial port (using the QModbusRtuSerialMaster class) and have some problems. One of the problems seems to be that the flow control of the serial port is incorrect. Checking in a serial port sniffer I see that a working client sets RTS on when it sends requests, and then RTS off to receive replies. When I use QModbusRtuSerialMaster to send messages that doesn't happen. The message is sent correctly (sometimes, subject for another

CMake and Qt5 AUTOMOC error

折月煮酒 提交于 2021-02-18 15:51:41
问题 I have a project which uses Qt5 and I have a CMakeLists.txt file that I use for creating the Visual Studio Solution. This is an excerpt of my CMakeLists.txt cmake_policy(SET CMP0020 NEW) set(CMAKE_AUTOMOC ON) find_package(Qt5 REQUIRED COMPONENTS core widgets) set(COMMON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src) include_directories( ${Boost_INCLUDE_DIRS} ${COMMON_INCLUDE_DIR} ) file(GLOB_RECURSE COMMON_SOURCE "*.hpp" "*.cpp") add_library(${PROJECT_NAME} ${COMMON_SOURCE}) qt5_use_modules(${PROJECT

How to use google protobuf in a project with precompiled headers

*爱你&永不变心* 提交于 2021-02-18 13:53:18
问题 I have a solution which contains several projects. My projects (but not all of them) use precompiled headers. I decided to use protobuf and I've met a problem. After generetaing *.pb.h from *.proto by protoc.exe I'm trying to include the header and get the error - precompiled header wasn't included into *.pb.h. How I can solve this problem? I have an idea (but I don't like it at all) - after protoc generates *.pb.h I can run some script, which'll include my precompiled header into the *.pb.h.

Pause a python script until an event occurs without hanging/blocking the GUI

妖精的绣舞 提交于 2021-02-18 12:48:06
问题 Trying to migrate from PyQt with Kivy and I cant even imagine a solution for this. I have thousands of lines of code that use Qt's dialogues for text input. That is, when their line of code is reached, they 'stop' the script until the "ok" button is pressed, so they can return the text input. Kivy doesnt have that functionality, so ideally, when the program needs user input, the "ok" button would call for the next function to run. Therefore I must replace all the current calls to a PyQt

QT编译错误:Project ERROR: This example requires Qt to be configured with -opengl desktop

有些话、适合烂在心里 提交于 2021-02-18 12:30:48
学习QT场景视图,对一个Boxes的例子比较感兴趣,于是去编译学习,结果编译不能通过(使用的是QT5.12): Project ERROR: This example requires Qt to be configured with -opengl desktop 我尝试在*.pro文件中加入 -opengl desktop,不管用! 在知乎上 查到 : “-opengl desktop”只是一个configure的选项,编译Qt库时设置的。 或者你说像5.4预编译的qt-opensource-windows-x86-msvc2013_opengl-5.4.2.exe?5.5中默认使用了“-opengl dynamic”了。 看来只能重新编译一遍QT的源代码来获得了~(对此我后来进行了尝试: https://www.cnblogs.com/MakeView660/p/10416924.html ) 编译QT源码配置关于OpenGL的支持选项说明如下(QT5.12版本 configure -h截图):Linux环境默认是支持 -opengl desktop的 回到家,我又重新安装了QT4.8.6以及QT Creater4.2.2,这下就可以查看Boxes例子了,直接编译成功! 来源: oschina 链接: https://my.oschina.net/u/4277132/blog

Border color of Qt components

£可爱£侵袭症+ 提交于 2021-02-18 12:11:29
问题 I want to change border color of QFrame component. Also tried with style sheet but no effect at run time. In my project there are various Dialog UI are there which are basically QFrame and i want to change the border color of selected dialog i.e. QFrame border color. Is there any workaround for that in QT. As shown below there are two dialog when any one of selected it's respective frame border color should get changed 回答1: Try this: frame->setObjectName("myObject"); frame->setStyleSheet("

how do i create a custom (widget) plugin for qt designer with cmake ( and visual studio )

怎甘沉沦 提交于 2021-02-18 12:11:28
问题 The amount of tutorials, how to create a qt designer plugin is very thin..and the ones i found always use qt creator ( like this one : http://qt-project.org/doc/qt-4.8/designer-customwidgetplugin.html ). Where i have to add some qt definitions in the .pro file CONFIG += designer plugin I use CMake and Visual Studio for coding, so it would be really awesome if someone could tell me how i successfully create a .dll that i can put in the plugins/designer folder to have the custom widget show up