qtcore Questions

10

How do I know which version of Qt I am using? When I open Qt Creator it shows "Welcome to Qt Creator 2.3". In the build setting, however, it shows Qt Version 4.7.1.
Titania asked 14/4, 2014 at 11:18

3

Solved

std::vector::size() returns a size_type which is unsigned and usually the same as size_t, e.g. it is 8 bytes on 64bit platforms. In constrast, QVector::size() returns an int which is usually 4 byt...
Bounty asked 28/10, 2014 at 22:47

5

Solved

I am going to write program using Qt for some image processing and I want it to be able to run in non-gui mode (daemon mode?). I'm inspired by VLC player, which is "typically" GUI program, where yo...
Traps asked 24/5, 2014 at 12:10

3

Solved

Given the following piece of code: void test(int var) { Q_UNUSED(var); #ifdef SOMETHING printf("%d",var); //do something else with var... #endif } Would the Q_UNUSED macro have any effect if ...
Josefinejoseito asked 24/10, 2013 at 21:20

1

I'm doing a DLL with no GUI (TEMPLATE = lib), using QSerialPort. I don't create threads and I don't need any: I have no GUI and having a blocking serial port operation is no problem, it is what I w...
Feriga asked 29/6, 2022 at 9:17

1

Solved

I have read the question Can I use Qt without qmake or Qt Creator? which is basically the same for Linux, and very useful. How to compile a basic program using QtCore (console application, even wit...
Sturrock asked 27/6, 2022 at 15:7

3

Solved

I have a division like this: number / 1000.0 Sometimes it gives answers like 96.0000000001, sometimes the division works as expected. I want to limit my number to a maximum of two decimal place...
Koss asked 22/7, 2014 at 8:49

3

Solved

I am new to c++ and Qt and I am trying to initialize a QVector, which is a class member in a class initialization list like: MyClass::MyClass(QWidget *parent) : QMainWindow(parent) , myVector(QVec...
Zerla asked 5/1, 2014 at 12:24

4

Solved

I want to detect if the user has inputted a non-ASCII (otherwise incorrectly known as Unicode) character (for example, り) in a file save dialog box. As I am using Qt, any non-ASCII characters are p...
Dystrophy asked 7/1, 2014 at 20:23

2

I am trying to plot something with matplotlib but when I import it like this: import matplotlib.pyplot as plt in Pycharm Community 2016.1.4 using Anaconda version 3.5.1, I get this error: from ...
Lamontlamontagne asked 10/11, 2016 at 16:43

2

I want to split a QString, but according to the documentation, the split function only allows for splitting whenever the character to split at occurs. What I want is to only split at the place wher...
Aspirator asked 3/11, 2014 at 21:8

6

Solved

Is there any cross platform way to get the current username in a Qt C++ program? I've crawled the internet and the documentation for a solution, but the only thing I find are OS dependent system c...
Emaemaciate asked 24/10, 2014 at 16:46

4

Solved

I'm writing a program that send an UDP frame every 10 mS. Here's how my program is supposed to work : I've got a client class : //Constructor clientSupervision::clientSupervision() { } void clie...
Aerophagia asked 25/6, 2014 at 13:30

2

Solved

I've got an JSON like the following: { "agentsArray": [{ "ID": 570, "picture": "03803.png", "name": "Bob" }, { "ID": 571, "picture": "02103.png", "name": "Tina" }] } Now I'm trying to l...
Tinct asked 19/4, 2014 at 19:18

10

Solved

I was trying to convert a QString to char* type by the following methods, but they don't seem to work. //QLineEdit *line=new QLineEdit();{just to describe what is line here} QString temp=line-&gt...
Eckmann asked 26/3, 2010 at 13:59

5

Solved

I want a line edit which accepts an ip address. If I give input mask as: ui->lineEdit->setInputMask("000.000.000.000"); It is accepting values greater than 255. If I give a validator then ...
Prewar asked 19/4, 2014 at 5:33

7

Solved

I'm having issues with QByteArray and QString. I'm reading a file and stores its information in a QByteArray. The file is in unicode, so it contains something like: t\0 e\0 s\0 t\0 \0 \0 I'm tryi...
Span asked 2/1, 2013 at 23:55

9

I am getting the below error with the following imports. It seems to be related to pandas import. I am unsure how to debug/solve this. Imports: import pandas as pd import numpy as np import pdb, ...
Pasteurization asked 19/9, 2016 at 13:38

8

Solved

After reading some articles like this about Qt Signal-Slot communications I still have a question concerning the queued connection. If I have some threads sending signals all the time to each othe...
Jakoba asked 1/1, 2014 at 8:52

2

Solved

I have the following code: void class::Testfunc() { QTimer* timer = new QTimer; QObject::connect(timer, &QTimer::timeout, [this](){ emit Log("Time out..."); TestFunc(serverAddress, request...
Adulterate asked 3/11, 2014 at 11:59

5

Solved

I am porting a Linux app to Windows written in Qt. The application needs to save some settings before closing. On Linux, we can do that by signal handlers for SIGTERM etc. How can I implement the s...
Rafat asked 5/10, 2013 at 9:2

1

I just read a tutorial about pyqt5 button from here. And the code is as below. There is a question about button.clicked.connect(self.on_click) and @pyqtSlot(). If I delete @pyqtSlot() from th...
Masterly asked 23/8, 2017 at 13:58

5

Solved

I am working with a 50 fps camera (in Ubuntu environment and Qt framework) and every 20 ms I get a frame to process. I wrote a code to read images from camera and then store them in hard drive. w...
Ediva asked 5/1, 2014 at 8:19

2

Solved

I am trying to port a Qt application to C++ using STL. What is the equivalent of QVariant in C++? QVariant can store any data type - a container that holds heterogenous - different types of objects...
Conjunct asked 22/12, 2014 at 14:9

3

Solved

Does anyone know of a cleaner way to get the time zone included in the ISO string representation of a QDateTime? I should be able to just use the following: qDebug() << QDateTime::currentDa...
Furlana asked 23/2, 2014 at 23:36

© 2022 - 2024 — McMap. All rights reserved.