qt5

QPainter.drawText() SIGSEGV Segmentation fault

爷,独闯天下 提交于 2021-02-07 14:28:34
问题 I'm trying to print a simple text message in a thermal printer through Qt5 printing methods. #include <QCoreApplication> #include <QDebug> #include <QtPrintSupport/QPrinterInfo> #include <QtPrintSupport/QPrinter> #include <QtGui/QPainter> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QPrinter printer(QPrinter::ScreenResolution); QPainter painter; painter.begin(&printer); painter.setFont(QFont("Tahoma",8)); painter.drawText(0,0,"Test"); painter.end(); return a.exec(); }

highlighting custom QWidgetAction on hover

喜欢而已 提交于 2021-02-07 13:34:44
问题 My application has a QMenuBar with a number of QMenu s, each of which having a number of QAction s and sub- QMenu s. Most of the QAction -items are derivatives of QWidgetAction with re-implemented QWidgetAction::createWidget methods. Usually, both QAction s and QMenu become highlighted on mouse hover. Even a QWidgetAction doesn't make trouble until here: But as soon as I override QWidgetAction::createWidget to return a custom QWidget QWidget* MyWidgetAction::createWidget(QWidget* parent) {

highlighting custom QWidgetAction on hover

旧街凉风 提交于 2021-02-07 13:34:14
问题 My application has a QMenuBar with a number of QMenu s, each of which having a number of QAction s and sub- QMenu s. Most of the QAction -items are derivatives of QWidgetAction with re-implemented QWidgetAction::createWidget methods. Usually, both QAction s and QMenu become highlighted on mouse hover. Even a QWidgetAction doesn't make trouble until here: But as soon as I override QWidgetAction::createWidget to return a custom QWidget QWidget* MyWidgetAction::createWidget(QWidget* parent) {

draging a point on qtcharts in qml

人走茶凉 提交于 2021-02-07 08:56:21
问题 I am trying to drag a point on LineSeries on qtcharts. Here is my code: import QtQuick 2.0 import QtCharts 2.0 Item { anchors.fill: parent ChartView { title: "Two Series, Common Axes" anchors.fill: parent ValueAxis { id: axisX min: 0 max: 10 tickCount: 5 } ValueAxis { id: axisY min: -0.5 max: 1.5 } LineSeries { id: series1 axisX: axisX axisY: axisY onPressed: console.log("Pressed: " + point.x + ", " + point.y); onReleased: console.log("Released: " + point.x + ", " + point.y); } } // Add data

draging a point on qtcharts in qml

旧时模样 提交于 2021-02-07 08:56:11
问题 I am trying to drag a point on LineSeries on qtcharts. Here is my code: import QtQuick 2.0 import QtCharts 2.0 Item { anchors.fill: parent ChartView { title: "Two Series, Common Axes" anchors.fill: parent ValueAxis { id: axisX min: 0 max: 10 tickCount: 5 } ValueAxis { id: axisY min: -0.5 max: 1.5 } LineSeries { id: series1 axisX: axisX axisY: axisY onPressed: console.log("Pressed: " + point.x + ", " + point.y); onReleased: console.log("Released: " + point.x + ", " + point.y); } } // Add data

draging a point on qtcharts in qml

蹲街弑〆低调 提交于 2021-02-07 08:54:47
问题 I am trying to drag a point on LineSeries on qtcharts. Here is my code: import QtQuick 2.0 import QtCharts 2.0 Item { anchors.fill: parent ChartView { title: "Two Series, Common Axes" anchors.fill: parent ValueAxis { id: axisX min: 0 max: 10 tickCount: 5 } ValueAxis { id: axisY min: -0.5 max: 1.5 } LineSeries { id: series1 axisX: axisX axisY: axisY onPressed: console.log("Pressed: " + point.x + ", " + point.y); onReleased: console.log("Released: " + point.x + ", " + point.y); } } // Add data

creating new thread using Qthread-Qt5

蹲街弑〆低调 提交于 2021-02-07 07:52:24
问题 I am trying to create a new thread gpsthread which should run in the back ground, and store the value. class gpsthread: public QThread{ Q_OBJECT private:nrega_status_t status2; public: explicit gpsthread(QObject *parent = 0):QThread(parent) { // QTimer *t = new QTimer(this); // connect(t, SIGNAL(timeout()), this, SLOT(processgps())); // t->start(10000); } void run(){ qDebug()<<"inside gps thread\n"; QTimer *t = new QTimer(this); connect(t, SIGNAL(timeout()), this, SLOT(processgps())); t-

Prevent QML Property Bindings when QML object isn't visible?

谁说胖子不能爱 提交于 2021-02-07 06:53:15
问题 I'm working on a QML application that has a lot of property bindings: hundreds of objects are tracked and displayed in different forms like Qt3D/QCanvas. When I'm on a separate page of the application those property bindings for x/y locations and relative sizes are still happening. How can I stop them? I know I could bind the properties based on whether they're visual or not but that is a lot of unnecessary code: x: visible ? tracking.location(index).x : 0 I would have to wrap a ton of

No decoder available for type 'video/x-h264

隐身守侯 提交于 2021-02-07 06:25:09
问题 I am trying to run one of qt sample apps without any modification. It is called player and it is a multimedia widget demonstration. My system is Ubuntu 16.04 64bit. When I try to play a video, I see the following error in the console: No decoder available for type 'video/x-h264 Here is the full error after trying two different videos: Starting /home/aras/Qt5.7.0_Sept2016/Examples/Qt-5.7/multimediawidgets/build-player-Sept2016-Debug/player... Warning: "No decoder available for type 'video/x

Why Qt5 creator doesn't detect my custom widget plugin?

安稳与你 提交于 2021-02-05 10:37:06
问题 I've built a Qt custom widget plugin found in a book "C++ programming with Qt 1st edition". When it finishes building I see a file "libiconeditorplugin.so" in /home/Itachi_dev/Qt/5.14.2/gcc_64/plugins/designer TEMPLATE = lib QT += designer widgets uiplugin CONFIG += release plugin HEADERS = ../iconeditor/iconeditor.h \ iconeditorplugin.h SOURCES = ../iconeditor/iconeditor.cpp \ iconeditorplugin.cpp RESOURCES = iconeditorplugin.qrc DESTDIR = /home/Raindrop7/Qt/5.14.2/gcc_64/plugins/designer