2018-10-21         Jocelyn

Why is the selection border of a QGraphicsWidget not visible in QGraphicsScene?

I have added a widget to a graphic scene (QGraphicScene) through a QGraphicsProxyWidget. The problem is that when I select the item it's selected, but the selection border is not visible.Here is the code: QDial *dial= new QDial(); // Widget dial->setGeometry(3,3,100,100);// setting offset for graphicswidget and widget QGraphicsWidget *ParentWidget = new QGraphicsWidget();// created to move and select on scene ParentWidget->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); Scene->addItem(ParentWidget); // adding to scene QG...

 qt                     1 answers                     7 view
 2018-10-21         Sam

Reading from QDataStream to QVector: application crashes with SIGABRT signal

A crash with this message: The inferior stopped because it received a signal from the operating system. Signal name : SIGABRT Signal meaning : Abortedhappens at this line of code:// data is QByteArray ...QByteArray pos0 = data.mid( index, length );/* * Get float from byte-array */QDataStream streamPos0(pos0);QVector<float> floatPos0;streamPos0 >> floatPos0; // Crash happens exactly at this lineI couldn't figure out why the crash happens. I wonder if anybody can give me a hint ...UPDATEI stepped through the code and captured the local values when the code...

 qt                     1 answers                     61 view
 2018-10-21         Sabina

QT installation - OpenGL (No ANGLE)

I have installed the last version of QT but it seems that this one contains some DirectX calls, so I expect that the default installer use ANGLE !I wish to install a 100% openGL version, but I can't find one !Any idea ?Thx All official binary packages are configured with -opengl dynamicwhich means that programs can either use the installed (desktop) OpenGL driver, DirectX (via ANGLE), or an OpenGL emulation in software (Mesa) as OpenGL backends. If you always want to use Desktop OpenGL, you can force this bySetting the environment variable QT_OPENGL to desktopCalling QC...

 qt                     1 answers                     41 view
 2018-10-21         Sam

QCustomPlot set pixamp on grid

I tried to add pixamp on a QCustomPlot, this is my code: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); _pixmap = new QCPItemPixmap(ui->widget); ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);}MainWindow::~MainWindow(){ delete ui;}void MainWindow::on_pushButton_clicked() { QImage image = QImage(200, 200, QImage::Format_RGB32); int image_size = 200 * 200; QRgb pixel; QRgb green = qRgb(0, 255, 0); QRgb red = qRgb(255, 0, 0); for(...

 qt                     1 answers                     102 view
 2018-10-21         Eden

Undefined reference to fp_init() Using fprint in Qt

I am trying to use the libfprint in my Qt application#include <QtGui/QApplication>#include "mainwindow.h"#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <libfprint/fprint.h> int main(int argc, char *argv[]){ int r = 1; struct fp_dscv_dev *ddev; struct fp_dscv_dev **discovered_devs; struct fp_dev *dev; struct fp_print_data *data; r = fp_init(); QApplication a(argc, argv); MainWindow w; w.show(); return a.exec();}Compiling throws this error /concept/main.cpp:31: undefined reference to `fp_init()'...

 qt                     1 answers                     93 view
 2018-10-21         Noah

How to add a text box and show data on Veins Qtenv?

I am using Veins to do some Mobile Edge Computing simulations. To improve the visual effect, I am trying to show real time data of some nodes. For example, my application will return the communication delay in real time. In the Qtenv of Veins, I want to show the delay values in a text box just above the node icon. How to realize that? Or in which documentation can I get some help? Any advice will be appreciated! Setting a node's Display String (specifically, its t tag) should do exactly that. See https://omnetpp.org/doc/omnetpp/manual/#cha:display-strings for the full do...

 qt                     1 answers                     9 view
 2018-10-21         Troy

QMainWindow close button gets inactive while QNetworkReply is reading data

Here is some idea of my code.It executes successfully. I am just not able to use close button the moment it starts executing read statement.!inside main():int main(int argc, char *argv[]){ QApplication app(argc, argv); MainWindow mainWindow; mainWindow.show(); return app.exec();}this is my constructor: one main window and a button that calls execute when clickedinside MainWindow.cpp:MainWindow::MainWindow(QWidget *parent): QMainWindow(parent) //this creates a window that has a download button{ setWindowTitle("File Downloader"); QWidget* central = new QWidg...

 qt                     1 answers                     66 view
 2018-10-21         Arlen

qDebug function char FirstDriveFromMask( ULONG unitmask )

trying to make project in QT, I need to detect any new usb device and return the letter in my main.cpp.I found this with google and it should work but I don't know how to have a print of the driver letter in my main.cpp with simple qDebug() by calling the function char FirstDriveFromMask(ULONG unitmask).Could you help me?void Main_OnDeviceChange( HWND hwnd, WPARAM wParam, LPARAM lParam ) { PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR)lParam; TCHAR szMsg[80]; switch(wParam ) { case DBT_DEVICEARRIVAL: // Check whether a CD or DVD was inserted into a drive. ...

 qt                     1 answers                     28 view
 2018-10-21         Susan

SPI and I2C Protocol Detection in Qt

I have made a logic analyzer board and transport it's data trough USB to PC. In the PC side, I have a Qt App to Receive data. My Question is: How to analyze Protocols like SPI, I2C, etc in my Qt App to find ACK, NAK and more? Is there any proper Library for doing this? you can access SPI via the bcm2835-library: http://www.airspayce.com/mikem/bcm2835/The RPi used this one. RPi had mostly bcm2836, later the bcm2837 (just like RPi3). [XXX]

 qt                     1 answers                     62 view
 2018-10-21         Michell

QSqlQuery buffer size

I have a large table in PostgresDB (55GB). I want to scan it in C++ with QT, summarize the result, and send it back to the DB. As far as I understand, by default QSqlQuery transfers all the data into the main memory. Is it possible to state explicit buffer size for the object? Is it also possible to tell to QT/Postgres that I would like to get the answer incrementally, i.e., not after all the data is comuted and only then sent to the C++ program?The code I am using is the following:QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");db.setHostName("server");db.setDatabaseN...

 qt                     1 answers                     41 view
 2018-10-21         Burton

Why does delegate not recognize the state mouseOver?

I created a delegate and need to recognize mouseOver state to build an effect. But it does not work.When I my table appears, the output is like thisWhen i move the mouse over the table, the output is like thisI don't see the state MouseOver. How can I recognize it?void TableDelegate::paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const{ qDebug() << option.state; if ( option.state == QStyle::State_MouseOver ) { painter->fillRect( option.rect, QColor( 249, 126, 18 ) ); }} OK, it takes me a while to find out...

 qt                     1 answers                     52 view
 2018-10-22         Michell

QML: How to get the total height of a Repeater?

I have a Repeater but the Repeater's children have varying heights I can't determine myself. However, I need to find the total height of all the Repeater's children. I know I can loop through all the children and add up all their heights but I feel that's incredibly inefficient and was hoping there would be a better way. Here is some sample code I'm using to test:import QtQuick 2.10import QtQuick.Window 2.10Window {id: rootwidth: 320height: 580Component.onCompleted: loadData()function loadData() { var len, i, repeater_data len = 3 repeater_data = new Array(len) ...

 qt                     1 answers                     85 view
 2018-10-22         Harry

send command to server using QProcess

I made simple example using QProcess. Just get json value from DBpedia server. Q.How can handle one command on QProcess? Original commandcurl -s "http://dbpedia.org/data/Haeinsa.json"| perl dbpediaPlaceData.txt 'Haeinsa'dbpediaPlaceData.txt files comes from here.1. get JSON value from DBPedia server#include <QCoreApplication>#include <QDebug>#include <QProcess>#include <QFileInfo>int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); QString command="curl"; QProcess pro; QStringList arg; arg.append("-v"); arg.append("--i...

 qt                     1 answers                     56 view
 2018-10-22         Keith

Why QResizeEvent & QWidget::size gives different when fullscreen?

The question is from https://stackoverflow.com/a/52151020/3308570.(contains an example to reproduce the problem)I'm trying to get the widget size when it shows fullscreen. At first, I took the size from QResizeEvent::size. But the size only works correctly once. Like:show fullscreenQResizeEvent::size ⇒ 1920x1080show normalQResizeEvent::size ⇒ 500x400show fullscreenQResizeEvent::size ⇒ 516x439Then I changed to using QWidget::size in QResizeEvent, it gives the correct result 1920x1080 always when fullscreen.Is this a bug, or I did something wrong?Env: Qt 5.10.1 Mingw32 Win10U...

 qt                     1 answers                     25 view
 2018-10-22         Alan

How to maximise QLabel

I use Qt.4.6 in Nokia phone.My window, derived from QWidget, has set nontiled background: setStyleSheet("border:none; margin: 0px; background-image: url(:/images/background.png);");In my vertical layout there I have 3 QLabels. I want the middle one that contains image to be resized to fill all available space. If it is not stretched then the background image get duplicated on the background of the label, making an ugly effect.How can I force it to expand? Or at least how to find out the maximum available size to set with setMinimumHeight(). You can set the size policy of...

 qt                     1 answers                     18 view
 2018-10-22         Virginia

How to set maximum/minimum zoom of flickable

I'm trying to make zoomable Item (Image or any other component) and make it for tablet. Currently, my code looks like this:Rectangle { id: root anchors.fill: parent color: mainWindow.toGradient Flickable { id: flick anchors.fill: parent contentWidth: width contentHeight: height boundsBehavior: Flickable.StopAtBounds PinchArea { id: pArea width: Math.max(flick.contentWidth, flick.width) height: Math.max(flick.contentHeight, flick.height) property real initialWidth pro...

 qt                     1 answers                     49 view

Page 1 of 240  |  Show More Pages:  Top Prev Next Last