answerstu

makefile - Issue with QT and cross-compiling from Mac to Raspbian Stretch(RPi3)

I'm following QT's documentation here to the letter: https://wiki.qt.io/RaspberryPi2EGLFS but I am constantly running into the same issue on my mac on Step 10.I am running the following command:./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -vI get the follo...Read more

qt - Notifying subclass of QAbstractItemModel about changes

I've got a question about notifying a model of the changes made to some other object which it stores a reference to.I'm aware of the signal dataChanged(), but I'm not sure how to use it. For example, my model stores a reference to some other object (let's call it myObjPtr). The model queries myObjPtr for its contents only when the methods rowCount(), columnCount(), data() and others are called on the model.Then, if I make some changes to the contents of myObjPtr, how should I notify the model so that it could emit the dataChanged() signal with ...Read more

qt - QLabel and QPushButton align

I'm having a hard time aligning multiple qt widgets (label and push button). I want the widgets (colored green and red respectively) to line up. Any advice? #include <QVBoxLayout>#include <QLabel>#include <QPushButton>#include "ui_dialog.h"Dialog::Dialog(QWidget *parent): QDialog(parent),ui(new Ui::Dialog){ui->setupUi(this);QVBoxLayout * const layout = new QVBoxLayout(ui->scrollAreaWidgetContents);for(int i=0; i!=100; ++i){ QLabel *label = new QLabel(); layout->addWidget(label); label->setText(QString::number(i)...Read more

qt - Qml: Difference be onPropertyChange and setting a particular value based on property using a formula)

Suppose I have QML item A like so:Item A{ property real value property real position: value*100}As you can see, I have two properties, one of which depends on the other. The same result can be achieved by using onPropertyChanged. For example:Item A{ property real value property real position onValueChanged:{ position=value*100 }}Obviously the first approach reduces extra lines of code. But, there will be cases where the right hand side of the formula could get complicated. Based on the necessary actions required when on...Read more

qt - How to get the X and Y translated values applied to a QQuickItem on to the C++ side

I have the following QML Rectangle which has a parent item. The most important thing to note is that it applies a Translate QML element which I am struggling to understand as to what exactly it does the QML item and its children it applies to.Code: Window { id: main_window width: 640 height: 480 visible: true Item { id: rect_parent objectName: "rect_parent_object" x: 0 y: 0 width: parent.width height: parent.height transform: Translate {x: -20; y: -30} Rectangle { ...Read more

qt - Using curl in QProcess

I have a problem which is quite similar to my last question Ssh command from Qt. But I cannot understand what is wrong with one of the arguments that I pass to cUrl in QProcess. The code is: QStringList params; const double timeout = 8.0; params.append("'--connect-timeout " + QString("%1").arg(timeout) + "'"); params.append("-T" + obj->absoluteFilePath()); params.append("ftp://" + m_host + "/inbox" + m_logsPath + obj->name()); m_process->start("curl", params);But it always gives me an error: curl: option --connect-timeout 8: is u...Read more

qt - QML ComboBox style

I customized a Combobox with the following code but there are some things I don't understand and so can't fix.First, the height of the hovered element with id rectDlgt. I ouput in the console the heights of itemDlgt and rectDlgt and they are not the same while I expect they should. itemDlgt is 40 in height and rectDlgt is 16.The second thing is that grey rectangle that appears when I press on an element in the list. I assume it's linked to listView but it doesn't seem to change even with a delegate in the ListView.ComboBox { id:equipmentList ...Read more

opengl - Unable to add OpenAL library in Qt Creator

I want to add an audio library into my project but when I try to do this, I get this error message:cannot find -lOpenAL32dcannot find -lEFX-Utilderror: ld returned 1 exit statusI added the libraries by "add library" and then I chose the correct paths to OpenAL 1.1. I'm not sure what I'm doing wrong but when I delete lines in .pro file with "INCLUDEPATH +=[...]" etc., I get completly different error, so it seems that the program detects those libraries but something is wrong though. Any suggestions what I could have done wrong?EDIT:Posted .pro f...Read more

qt - How to size the texture to occupy only a portion of a QQuickItem UI

I have overriden updatePaintNode in the following way to draw an OpenGL texture on a QQuickItem derived class called MyQQuickItem here.QSGNode *MyQQuickItem::updatePaintNode(QSGNode * oldNode, QQuickItem::UpdatePaintNodeData * /*updatePaintNodeData*/) { QSGSimpleTextureNode * textureNode = static_cast<QSGSimpleTextureNode *>(oldNode); if (!textureNode) { textureNode = new QSGSimpleTextureNode(); } QSize size(800, 800); // myTextureId is a GLuint here textureNode.reset(window()->createTextureFromId(myTextureId, size)); texture...Read more

QT ODBC driver .mdb ms-access inserts not working above 1000 rows (windows)

I have tested many times my code on Windows.(I need to use ms-access to upgrade an old app)Trying to insert rows in a query using transaction or not, bindvalues or not, inserts doesn't go beyond 1061 rows.I have tested with this code:this->db_ = QSqlDatabase::addDatabase("QODBC");QString archivo_elegido = QString(ruta_inicial_ + "cods.mdb");cout << "archivo: " << archivo_elegido.toStdString() << endl;this->db_.setDatabaseName(QString("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=%1;").arg(QDir::toNativeSe...Read more

qt - Qt5, X11, libxcb. Sliders and other parts of widgets is too small

Some parts of widgets (e.g. button in a QDateEdit) are by far too small so they cannot be properly used with touch screens. On my system, the sliders, e.g. for the widget's scroll areas, become bigger if I use setGlobalStrut() accordingly. But a slider has buttons with arrows which are very small on our system. The same is true for QDateWidget. The Buttons with the arrows are very, very small in our system and therefore cannot be well used with touchscreen.We use Pvbrowser (pvbrowser.org) for visualisation of a gas measurement device on an embe...Read more

qt - Text display on GUI

In my Qt GUI application, there are 2 threads. The non-GUI thread receives data on a serial port very frequently. This data needs to be displayed on the GUI which is the main thread. Scrolling also needs to be implemented. How do I implement this? What Qt classes should be used?...Read more

layout - Qt creator 2 vertical splitters and fixed middle height

I try create middle space with fixed height and disable hide behaviour for it. This screenshot of my test window:As you can see, middle space too flat and can be hide when you drag it up or down to max position.How to correct make this layouts behaviour?EDIT:Now I set min max height of this middle widget. This fix height. But how to disable hide behaviour?EDIT 2:I found it. splitter->setChildrenCollapsible(false)This disable it for all. But I want disable it for middle widget only....Read more

qt - wkhtmltopdf is not rendering fonts and border-radius is incorrect

I have a couple of problems with wkhtmltopdf. I am using wkhtmltopdf 0.12.2 (with patched qt)I am converting a custom html page to a PDF. The rendered html looks correct on the browser, fonts rendered correctly, border-radius working fine. All that I expected.When I run the wkhtmltopdf program with the rendered html page as input, some of the styling is rendered but the fonts are not.I am using a custom font called Brandon Grotesque. I have tried importing it a myriad of waysServing it locally on my siteUsing base64 encodingInstalling the font ...Read more

qt - Shuffle QML ListModel

I have a ListModel and a repeater. The repeater draws the Items from the ListModel, one on top of a another. That works fine so far. Except that for on each application start I want to have a different draw order. So i guess it would be best, to "shuffle" the ListElements in the ListModel before applying the Repeater. How can I do this?...Read more