Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Broadcasting QVector data

    Solved
    7
    0 Votes
    7 Posts
    592 Views
    JKSHJ
    @Kent-Dorfman said in Broadcasting QVector data: We already have well-defined, standardized binary protocols like CBOR which can be used to transmit IEEE 754 values unambiguously, losslessly, and efficiently. A protocol that is based on JSON is anything but efficient. You have introduced the requirement of a grammar parser. Hardly. CBOR's structure is fixed header + payload. No grammar parsing required, unlike JSON. In my world (embedded and control systems) things need to be liteweight, interoperable, and unambiguous. Scaled integer approaches are almost always superior, unless bandwidth bloat of text representation is tolerable. Please allow for answers that cater for people outside your world. IEEE floating point numbers require no scaling on the receiver and involves no bandwidth bloat. As for CBOR...it's an RFC, not an industry standard such as IEEE or ISO standards...so is really only applicable to IP. That matters because...?
  • How to stretch the child nodes of QTreeView

    Solved
    12
    0 Votes
    12 Posts
    3k Views
    D
    @kshegunov, exactly. Now with header hidden, columns stretches automatically as I move the splitter. Thanks
  • How to use multi column model in QCompleter?

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    D
    @SGaist, very close to what I wanted with QTableView. There's a small gap between row cells and it's clearly visible when an item is selected: [image: 32b6c3f5-97d9-4dd7-abea-26b6ef3baddf.gif] still couldn't find a way to remove that gap. One more issue is, it doesn't resize to content size automatically. I've set the width manually table->setFixedWidth(totalColumnWidth + 20). The 20 is for vertical scrollbar and when that becomes invisible there's another big gap at the end.
  • Using Multiple Classes with QtTest

    Unsolved
    2
    0 Votes
    2 Posts
    296 Views
    SGaistS
    Hi, What is the structure of your project ? Are you using the SUBDIRS template ?
  • Reactive GUI when rendering is slow – how to?

    Unsolved gui design multithreading
    6
    0 Votes
    6 Posts
    2k Views
    S
    Thanks a lot for these answers. To summarize: Solution 1 from the original post is confusing and therefore not good. Solution 2 from the original post is much better. An alternative would be to disable tracking of the slider, so the image only gets updated on mouse release. Disable the tracking would be the easiest thing to do, but it is not very flexible. There are two main problems for me: I also have spin boxes in the dialog, which also change the image, and I do not want to disable the arrow-up and arrow-down support for these spin boxes because that seems a bit strange. I do not know the speed of the target system, so anyway I prefer to use threads to make sure the UI stays reactive. Therefore, I think I will go for solution 2. Stays the question of how to implement this. Did you try to see the hot paths of your application with a tool like hotspot ? No. Beside that, what exactly takes that long in your application ? From a quick look at your code, you likely do too much in your paint event. You are creating a new QImage every time paintEvent is called, why not create it once on resize and then just repaint on top of it. Indeed, the paint event (and also the rest of the code) is not speed-optimized at all. My plan was: Define which behaviour I want. (That is done now, thanks to you!) Decide which threading technologies to use. (To be done.) Optimize the individual parts where necessary. (To be done.) But I remember that, when once ago on a pretty fast computer and with a small widget size, I measured the old synchronous code, the paint event took 360 ms, of which 330 ms were the image rendering algorithm, which has therefore the biggest problem. Also, I will look into your suggestion to keep always a QImage in memory, so that it is not allocated again on each paint event. (Also, I have heard somewhere that Qt itself does the same thing.) you might want to check out the Mandelbrot example. Yes, indeed, the current multithread code is based on the Mandelbrot example. One other possibility is to update the content of the image when something changes and just paint the updated image once that is done. Indeed, I'm using yet an image cache, so there is no unnecessary rendering of the image. Of course, only you know why this thing takes this long and whether anything can be done to reduce it. That's the most interesting question. The algorithm calculates each pixel independently: Perfect for splitting the work into as many threads as the count of virtual cores of the target computer. And probably, the algorithm itself can also be optimized. How could this work? I have no experience in multithreading. Doing it manually with QThread seems therefore complicated and error-prone to me. Could I query the number of virtual cores, and then use QtConcurrent::run() as many times as virtual cores are available, each call with just a fraction of the rendering image? Would this scale well? (As I'm developing a library, I have no knowledge about what other threads the application developer will use in his own code.) it can't be done as a gradual thing. Actually, probably in can be done as a gradual thing. Maybe allocate a QImage in full-resolution size. Then, calculate pixel (0, 0) and set this color for pixel (0, 0), but also for (0, 1), (1, 0) and (1, 1). And so on, until the QImage is complete. Do a paint event with this low-resolution image. Do a new run and calculate (0, 1), (1, 0) and (1, 1) exactly. And so on, until the QImage is complete. Then, do a new paint event with the full-resolution image. This idea could also be adapted to work with more than only two steps. Do you think this is a good idea?
  • QTextToSpeech fails sporadically

    Solved
    4
    0 Votes
    4 Posts
    529 Views
    SGaistS
    That is a bit strange indeed. Something to investigate.
  • Example Using QGraphicsView Class

    Unsolved
    7
    0 Votes
    7 Posts
    613 Views
    JoeCFDJ
    @leinad https://doc.qt.io/qt-5/qtwidgets-graphicsview-chip-example.html
  • QListWidget: is there a way to set the number of visible rows?

    Solved
    3
    0 Votes
    3 Posts
    555 Views
    idlefrogI
    Thanks @mrjj ... That's what I thought... in the end I did something like this: QSize MyListWidget::sizeHint() { auto size = QListWidget::sizeHint(); int h = sizeHintForRow(0) * m_rows_visible; size.setHeight(h); return size; }
  • System Tray Icon Example bug if I change the current icon index to 0

    Solved
    10
    0 Votes
    10 Posts
    949 Views
    Pl45m4P
    @JonB said in System Tray Icon Example bug if I change the current icon index to 0: Then iconComboBox->setCurrentIndex(0) will not raise currentIndexChanged signal, and so not call the slot, but he wants it to be called, which I am assuming is the OP's situation? Yes, now I understand what you meant before :)
  • 0 Votes
    6 Posts
    2k Views
    B
    I have really learnt alot Thank you @eyllanesc
  • TLS1.3 Session Resumption on server-side with QSslSockets

    Unsolved
    1
    0 Votes
    1 Posts
    304 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • Getting started with Qt

    Unsolved
    3
    0 Votes
    3 Posts
    341 Views
    S
    @jsulm thank you for the response
  • Is QThread doc correct?

    Solved
    4
    0 Votes
    4 Posts
    330 Views
    jsulmJ
    @qwe3 said in Is QThread doc correct?: I thought that default is DirectConnection Take a look at the connect() signature: https://doc.qt.io/qt-5/qobject.html#connect-2
  • reach QComboBox (QStyledItemDelegate delegate) in QTableView from outside

    Unsolved
    9
    0 Votes
    9 Posts
    821 Views
    KaguroK
    @SGaist Sorry for super late, i have so many other task in my job nowadays. I will aswer it tomorrow as i can! Thanks your help!:)
  • Build Qt to cross compile for arm tutorial

    Unsolved
    3
    0 Votes
    3 Posts
    693 Views
    I
    @jsulm https://forum.qt.io/topic/131394/raspberry-cross-compiler-setting-cannot-run-target-compiler Can you answer the question in this link?
  • Fail to run application in Release mode but able to run in Debug mode

    Unsolved
    5
    0 Votes
    5 Posts
    414 Views
    M
    Through open source offline installer. (qt-opensource-windows-x86-5.12.11)
  • .run file not running in Ubuntu

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    C
    The Korean error message "Exec 형식 오류" is "Exec format error" in English. This is exactly what you would expect trying to run a X86 or X86_64 binary on an ARM64 architecture machine. This is a rehash of @IknowQT's earlier posts on the same/similar topics. As far as I can tell, Qt 5.12.8 is the latest Canonical-published Qt version for ARM64. There may be a PPA somewhere that offers later versions. It is clearly possible to build Qt libraries for ARM64 but before going down that path understand why the need for that specific later version. Is there a particular bug in 5.12.8 that absolutely must be fixed?
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    14 Views
  • Debugging : Unresolved Externals

    Unsolved
    2
    0 Votes
    2 Posts
    189 Views
    jsulmJ
    @Swati777999 said in Debugging : Unresolved Externals: filename.dll What lib is that? Is it your own? Please show the whole error message.