Questions tagged [qchar]

The QChar class, part of the Qt framework, provides a 16-bit Unicode character.

In Qt, Unicode characters are 16-bit entities without any markup or structure. This class represents such an entity. It is lightweight, so it can be used everywhere. Most compilers treat it like a unsigned short.

23 questions
0
votes
1 answer

In Qt, how do I convert the Unicode codepoint U+1F64B to a QString holding its equivalent character ""?

Background: I am making a hash that will allow you to lookup the description you see below by feeding it a QString containing its character. I got a full list of the relevant data, looking something like this: QHash
Anon
  • 2,267
  • 3
  • 34
  • 51
0
votes
1 answer

Qt chart error: ASSERT: "width > 0.0" in file painting\qrasterizer.cpp, line 761

I got an error when using QValueAxis in QtCharts: ASSERT: "width > 0.0" in file painting\qrasterizer.cpp, line 761 This happens when the QBarSet values are all 0. I have this example with the minimal necessary code below: #include…
Theodore Tang
  • 831
  • 2
  • 21
  • 42
0
votes
1 answer

qt QScatterSeries clicked signal is emitted to ChartView mousePressEvent

I have a custom implementation of QChartView where I can zoom. (Class "ChartView" from this example) In there I have a mousePressEvent. Now I wanted to add a QScatterSeries and connect the clicked signal with a custom slot. Unfortunately as soon…
user7431005
  • 3,899
  • 4
  • 22
  • 49
0
votes
2 answers

QChar to uint32_t conversion / casting in Qt

I have a QString of 1500 QChar which I want to convert to an array of uint32_t. I am reading each element in for loop and trying to save each QChar of QString to uint32_t array. I can convert it to its equivalent representation (e.g. 1 -> 49)…
aly
  • 17
  • 5
0
votes
2 answers

QChar stores a negative Latin1 code for multiply sign '×'

I want to get the Latin1 code for multiply sign ×, but when I check the value inside the QChar it has -41'×'. My code: QString data = "×"; QChar m = data.at(0); unsigned short ascii = (unsigned short)m.toLatin1(); When I debug, in the second line I…
Robert
  • 10,403
  • 14
  • 67
  • 117
0
votes
1 answer

How convert QChar to char code in cp866 table?

How get int code of qchar in this table http://www.ascii-codes.com/cp866.html ? Here is my code: int getCp866Code(QChar c) { if (!c.isSurrogate()) { QString temp = c; QTextCodec* cp866 = QTextCodec::codecForName("IBM 866"); …
lukaville
  • 182
  • 3
  • 12
0
votes
2 answers

Qchar* to char* conversion

I'm building a Qt Gui application for monitoring data from serial port.I'm using qextserialport library. Here's the problem I ran into. void MainWindow::onDataAvailable() { QString data_ser,data_trimmed; port->readLine(data_ser.data(),0); …
tez
  • 4,990
  • 12
  • 47
  • 67
0
votes
2 answers

QChar::isLetterOrNumber() fails

I want to convert QStrings into filenames. Since I'd like the filename to look clean, I want to replace all non-letters and non-numbers by an underscore. The following code should do that. #include #include QString…
Johannes
  • 2,901
  • 5
  • 30
  • 50
1
2