Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.3k Posts
  • How to convert ASCII Hex string to Byte array?

    hex ascii bytearray
    15
    0 Votes
    15 Posts
    34k Views
    Christian EhrlicherC
    @mganesh This works fine for me. Your output can not match on what you've written. Please post all your test code int main(int argc, char **argv) { QCoreApplication app(argc, argv); QString monitorCommand = "020400000006703B"; QByteArray data_to_transmit = QByteArray::fromHex(monitorCommand.toUtf8()); qDebug() << monitorCommand << data_to_transmit; return 0; } --> "020400000006703B" "\x02\x04\x00\x00\x00\x06p;"
  • Q_PROPERTY - write function for multiple property

    Unsolved
    2
    0 Votes
    2 Posts
    528 Views
    J.HilkJ
    @poucz I would suggest, if you're using QtCreator: Right click in Q_PROPERTY -> Refactor -> Generate Missing Q_PROPERTY members I use it all the time. It won't work for your quite as well, as you have an array as underlying data structure.
  • QFileSystemWatcher is working for changes inside too.

    Unsolved
    13
    0 Votes
    13 Posts
    877 Views
    JonBJ
    @developer_61 So it seems you have a couple of choices. When you change the file from inside your program: Switch off the file notification beforehand, re-enable it afterwards. Note the time at which you perform the internal update. Ignore notification for a period afterwards.
  • How long does the write operation of the database take

    Solved
    22
    0 Votes
    22 Posts
    4k Views
    tovaxT
    @Christian-Ehrlicher @JonB @J-Hilk @jsulm Thank you for your help. The reason for the slow speed should be the hard disk. The same demo takes about 80 ms for HDD and about 4 ms for SSD.
  • Reading Config Files in Qt

    Solved qt5.12.2 config file qsettings
    4
    0 Votes
    4 Posts
    4k Views
    A
    @jsulm Thanks after reading documentation again, i was able to use QSettings For anyone who needs some idea on using config files below code snippet might help you. ui->pushButton->setVisible(false); QSettings settings("../config/settings.ini",QSettings::IniFormat); QStringList keys = settings.allKeys(); for (auto i=0;i<keys.size();i++) { configvalues.push_back(settings.value(keys[i]).toString()); } Channel = configvalues[0].toInt() ; auto my_Ip = configvalues[1]; auto hostIp = configvalues[2]; auto iterations = configvalues[3]; Port = configvalues[0].toInt();
  • Table widget search bar doesnt update the value

    Solved
    6
    0 Votes
    6 Posts
    393 Views
    jsulmJ
    @suslucoder said in Table widget search bar doesnt update the value: is this a wrong usage or might it be a problem? This is actually easier than what I suggested.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    15 Views
  • Qt Creator 4.14.1, with Qt 5.12.10. Kits and Cmake issues

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    JKSHJ
    @OscarTheGrouch said in [Qt Creator 4.14.1, with Qt 5.12.10. Kits and Cmake issues] This worked and I can run a new project now .. Happy coding! Please mark the thread as "Solved"
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Qt VS Tools Application, QOCI not loaded

    Unsolved qoci
    1
    0 Votes
    1 Posts
    347 Views
    No one has replied
  • [Newbie] How to install Qt5Script

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    C
    OK, thank you. I finally posted a question, so the server came back. :)
  • This topic is deleted!

    Solved
    8
    0 Votes
    8 Posts
    19 Views
  • Getting JavaScript stack trace in C++ function ?

    Unsolved
    8
    0 Votes
    8 Posts
    835 Views
    SGaistS
    That I do not know, sorry.
  • 0 Votes
    8 Posts
    470 Views
    SGaistS
    IIRC, QtQuick video's output supports a larger range of formats without conversions or rather, the conversion is done in the last shader of the rendering pipeline,
  • Tons of error for no obvious reason

    Solved error qt creator 4.14 c++
    13
    0 Votes
    13 Posts
    4k Views
    Pl45m4P
    @RekTekk249 said in Tons of error for no obvious reason: Two hours ago, everything was going well, until I realised I needed the same instance of my helper class in my MainWindow than in my LoginWindow. If you would have posted the whole file, esp. showing the parts you've changed, it would have saved a lot of troubleshooting ;-) It's also a debugging thing... If you made changes and suddenly nothing works anymore, revert the changes and try to figure out why it happened.
  • 0 Votes
    2 Posts
    3k Views
    Pl45m4P
    @mingvv First, you should understand the basics of C++ and object-oriented programming in general. Without it's really hard to get a satisfying result and you will spend most of your time looking for things or trying to figure out how things work (or why they don't). Qt also has Model-View based classes. https://doc.qt.io/qt-5/model-view-programming.html You can communicate with your GUI or other QObject classes using the Qt signal&slot system or using events. For example if you press a button, you will emit the clicked signal. Then, if you connect a slot (= function) to this signal, the function will be called to perform some actions. https://doc.qt.io/qt-5/signalsandslots.html A (simple) snake game in Qt might be a practice to start with. Think about what classes / structure you will need, design your GUI and start writing your code :) Might be helpful: https://doc.qt.io/qt-5/graphicsview.html According the "GUI Code vs Designer" thing: It's mostly a mix of both. Some things just can't be done using the QtDesigner, but it helps a lot creating your basic widgets and your basic design.
  • Issues in new project from creation

    Solved
    9
    0 Votes
    9 Posts
    3k Views
    C
    Sorry, my fault. The attributes are editable. I had the editors on the sides squeezed a bit to show more of the form. So the attributes weren't visible, only the titles. Silly mistake. I think everything is working now. Thank you very much for your help.
  • QGraphicsTextItem doesn't have methods: setDefaultTextColor and setPos

    Solved
    2
    0 Votes
    2 Posts
    152 Views
    sergey.glazyrinS
    Solution was easy. I had to add #include <QGraphicsTextItem> and it just works.
  • 0 Votes
    17 Posts
    3k Views
    kshegunovK
    What is DataBuffer? And how do you render the data in the GUI thread?
  • How to produce base64 contents for reading as video via QVideoFrame

    Solved
    11
    0 Votes
    11 Posts
    693 Views
    SGaistS
    All within the same device ?