qstring Questions

5

Solved

How can I specify a unicode character by code (such as "4FF0") using QString? I tried QString s("\u4FF0"); but it only outputs a question mark. Any idea how to do this? Edit: It works that way, b...
Belong asked 28/9, 2011 at 17:1

4

Solved

I have a QJsonObject data and want to convert to QString. How can I do this? Searched for help in Qt, it only can convert QJsonObject to QVariantMap... Thanks in advance.
Glob asked 27/1, 2015 at 22:59

4

Solved

I'm desperate about finding any information about the mentioned error. I'm working on visual studio 2010. When I compile my project (in 32 bits), in debug or release, I get the following message :...
Parthen asked 14/9, 2012 at 16:13

2

Solved

I'm trying to create a QString which is a hexadecimal number with its letter digits in Capitals instead of small caps, how can it be done? QString( " %1" ).arg( 15, 1, 16 ) yields f and I'd lik...
Beaufort asked 18/6, 2010 at 22:23

5

Solved

I am thinking of regular expressions, but that is not exactly readable. There are also functions like s.toUpper() to consider, and probably other things as well. So what is the best method for ca...
Bouffant asked 21/12, 2016 at 0:23

12

Solved

I am trying to do something like this: QString string; // do things... std::cout << string << std::endl; but the code doesn't compile. How to output the content of qstring into the c...
Goldcrest asked 18/11, 2010 at 11:43

6

Solved

I'm wondering How I can have a string in QML that will be occupied with some arguments? Some thing like this in Qt: QString str("%1 %2"); str = str.arg("Number").arg(12);//str = "Number 12"
Mannequin asked 6/10, 2012 at 8:56

3

Solved

is there a way to draw fixed text that has subscripts. My goal is to have something like: "K_max=K_2 . 3" QString equation="K_max=K_2 . 3"; painter.drawText( QRect(x, y , width, y+height), Qt::Ali...
Hesione asked 27/4, 2015 at 9:43

3

Solved

How can I change the color and font of QLineEdit? Here is my code: self.lineEdit = QtGui.QLineEdit(widget) self.lineEdit.setText("enter keywords here") #I want this to be in italics and in brown ...
Phonotypy asked 29/12, 2016 at 21:41

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

5

Solved

So when you use qDebug() to print a QString, quotation marks appears suddenly in the output. int main() { QString str = "hello world"; //Classic qDebug() << str; //Output: "hello world" /...
Pignus asked 16/1, 2015 at 2:54

5

Solved

I have created an encrypt/decrypt program, when encrypting I store the encrypted QByteArray in a text file. When trying to decrypt I retrieved it and then put it into the decryption method, the pr...
Booby asked 14/6, 2016 at 3:40

6

Solved

How to remove /Job from /home/admin/job0/Job QString name = "/home/admin/job0/Job" I want to remove last string after"/"
Gondola asked 9/11, 2017 at 12:0

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

4

Solved

I have a char array and want to convert one of the values from char to qstring: unsigned char inBuffer[64]; .... QString str= QString(*inBuffer[1]); ui->counter->setText(str); This isn't ...
Trabzon asked 11/1, 2013 at 2:33

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

5

Solved

I want to convert number to QString with 3 significant digits. QString::number(myNumber,'f',3); does the job but remains trailing zeros. How to use it without them. Also I've tried 'g' and whic...
Intyre asked 17/9, 2012 at 12:20

14

Solved

I want to use switch-case in my program but the compiler gives me this error: switch expression of type 'QString' is illegal How can I use the switch statement with a QString? My code is as fol...
Chopping asked 27/3, 2011 at 20:29

3

Solved

I have QString with html tags. Why can i get plain text from this string?
Talcahuano asked 14/5, 2011 at 5:18

2

Solved

I'm trying to replace heavy QString class with the lighter alternatives (QStringRef/QStringView). The problem is that Qt widgets don't consume these classes by any mean. For example, the QLabel::se...
Hawker asked 15/7, 2020 at 8:45

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

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

2

Solved

I was surprised to learn that QVector3D does not have a built-in way of outputting the x, y, and z coordinates as a QString. I can write a simple function to do this, but I was wondering if there w...
Stillwell asked 18/8, 2011 at 18:2

1

Solved

QString has a method remove that takes a QRegExp. It removes every occurrence of the regular expression. Is there a way to remove only the first occurrence of the regular expression? Answer to QS...
Seeker asked 5/1, 2016 at 13:21

2

Solved

I am using PyQt5 but can't import QStringList. I know that QStringList used to be in the module QtCore in PyQt4. So I try importing the class using from PyQt5.QtCore import QStringList but it sh...
Cunningham asked 3/1, 2015 at 17:41

© 2022 - 2025 — McMap. All rights reserved.