qt5.4

How to use QDataStream::readBytes()

丶灬走出姿态 提交于 2021-01-27 07:51:46
问题 According to the documentation for readBytes() (in Qt 5.4's QDataStream), I would expect the following code to copy the input_array into newly allocated memory and point raw at the copy: QByteArray input_array{"\x01\x02\x03\x04qwertyuiop"}; QDataStream unmarshaller{&input_array, QIODevice::ReadOnly}; char* raw; uint length; unmarshaller.readBytes(raw, length); qDebug() << "raw null? " << (raw == nullptr) << " ; length = " << length << endl; ...but the code prints raw null? true ; length = 0 ,

How to make svg icons crisp again in Qt 5.6 on high DPI screens

会有一股神秘感。 提交于 2020-07-18 07:42:26
问题 Upgrading from Qt 5.4 to Qt 5.6 made all my .svg icons blurry/pixelated. I noticed this happens only on high density screens like on my MacBookPro Retina Display. I read the documentation of High DPI support in Qt 5.6 and I have set the QT_AUTO_SCREEN_SCALE_FACTOR=1 environment variable, but it didn't have much effect. Anybody has this issue? I have also found this bug report which probably relates to my question. EDIT 1: A simple example would be: Image { source: my_icon.svg sourceSize.width

QT5.4 remove and delete widget in a layout

喜你入骨 提交于 2020-01-17 01:17:50
问题 I have a QStackedLayout which contains few QWidget on it. The widgets layout is QVBoxLayout which have also few QPushButton . What I wanted to do is to remove all the widgets inside the QStackedLayout and then delete the widgets and layouts BUT I want all the buttons not to be deleted 'cause I will put them to another widget later. Here's my code: while (QLayoutItem *item = m_stacked_layout->takeAt(0)) { QWidget *w = item->widget(); for (int i = 0; i < w->layout()->count(); i++) { QPushButton

How to pass an array of string to dbus in PyQt5? [duplicate]

冷暖自知 提交于 2020-01-15 06:45:50
问题 This question already has an answer here : PyQt5 dbus: Force type signature of signal argument to be array of string (1 answer) Closed 8 days ago . I'm trying to make a dbus call using python3.4 and pyqt5.4 to a java-written daemon, the signature of the daemon for the method I'm calling is asa{sv} The call I'm doing is fpiudaemon = QDBusInterface("it.libersoft.FirmapiuDInterface", "/it/libersoft/FirmapiuD", interface='it.libersoft.FirmapiuDInterface' , parent=None) result = fpiudaemon.call(

“module “QtQuick” is not installed” (Android porting)

帅比萌擦擦* 提交于 2020-01-14 05:33:07
问题 I'm trying to porting my application to android with qt5.4 but I have this error: W/Qt (30916): qrc:/qml/FrontEnd.qml:1 ((null)): qrc:/qml/FrontEnd.qml:1:1: module "QtQuick" is not installed This is my .pro TEMPLATE = app TARGET = sandbox-build-android QT+= qml quick widgets printsupport xml svg INCLUDEPATH += [...]# my include path # Input HEADERS += [...] # my include SOURCES += [...] # my source RESOURCES += ../sandbox/resources.qrc LIBS += -L$$PWD/../../edalab/else-datamodel-classes/build

How to hide a QML Window when opening a other QML Window

喜夏-厌秋 提交于 2020-01-05 02:57:42
问题 I need to hide The QML Window when opening the another QML Window while clicking the button,I use Loader to open the another QML Window and its only hide the QML form components not QML Window,but I currently use window component to opens the QML Window Here is my code : Button { id: button2 x: 19 y: 54 width: 114 height: 25 text: qsTr("DIFF-R") style: ButtonStyle { background: Rectangle { implicitWidth: 10 implicitHeight: 25 border.width: control.activeFocus ? 2 : 1 border.color: "#555"

QtDbus is not working in Qt5.4.1 on Windows 7

若如初见. 提交于 2020-01-01 17:12:27
问题 When I run the Qt Creator dbus examples, they couldn't run, is there any settings or stuff for working QtDbus module or any prerequistics? for example in chat project: if (!QDBusConnection::sessionBus().isConnected()) { qWarning("Cannot connect to the D-Bus session bus.\n" "Please check your system settings and try again.\n"); return 1; } returns 1 and program terminated. 回答1: Finally I found the solution: For QtDbus module get working, The 3rd party Dbus module must be installed in Windows:

Qt 5.4/Qml: Prevent binding loop

谁都会走 提交于 2020-01-01 09:10:10
问题 I have a global singleton "Settings" which holds application settings. When I try to run the following code I get a QML CheckBox: Binding loop detected for property "checked" : CheckBox { checked: Settings.someSetting onCheckedChanged: { Settings.someSetting = checked; } } It is obvious why this error occurs, but how can I correctly implement this functionality without a binding loop? E.g. I want to save the current checked state of the checkbox in the settings singleton. I am using Qt 5.4

How can I simply parse a CSS like (!) file in my Qt application?

我怕爱的太早我们不能终老 提交于 2019-12-29 06:51:08
问题 I have a document in a *.css (Cascading Style Sheets) like format, but it has its own keywords. Actually it is a personalized css (I call it *.pss), with own tags and properties. here I have an excerpt: /* CSS like style sheet file *.pss */ @include "otherStyleSheet.pss"; /* comment */ [propertyID="1230000"] { fillColor : #f3f1ed; minSize : 5; lineWidth : 3; } /* sphere */ [propertyID="124???|123000"] { lineType : dotted; } /* square */ [propertyID="125???"] { lineType : thinline; } /* ring *

MSVC2013 - Entry Point Not Found

◇◆丶佛笑我妖孽 提交于 2019-12-25 05:34:11
问题 I recently installed the Qt add-inn for visual studio 2013. When I build a project in either Qt Creator or Visual Studio using MSVC2013 it builds without errors, but can only be run from inside the IDE. If I try to run it by clicking the .exe, it gives an error: "The procedure entry point ?qt_metacast@QMenuBar@@UAEPAXPBD@Z could not be located in the dynamic link library". From the research I have done online, I found that it could be something to do about adding the correct .dll files in my