Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Easily Restart When Debugging External Executable

    Unsolved debugger external applic linux
    2
    0 Votes
    2 Posts
    553 Views
    RyanEdwardR
    @RyanEdward Although not a native QTCreator solution, I use: C gist to simulate key presses on linux. Mapping this binary to a keyboard shortcut on your native desktop environment can hack your way to a solution.
  • How to remove rows from QStandardItemModel?

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    JonBJ
    @Emon-Haque No, the model took ownership of the items when you added them and is responsible for deleting them when you remove them from the model (via removeRow(), but not if you used takeRow(), see https://www.qtcentre.org/threads/63505-removeRow-or-takeRow-in-QStandardItemModel).
  • Clearing QDateEdit and QLabel

    Unsolved
    9
    0 Votes
    9 Posts
    1k Views
    L
    @eyllanesc Thanks for your response. The .clear() worked.
  • QNetworkAccessManager delete json

    Unsolved
    11
    0 Votes
    11 Posts
    642 Views
    JonBJ
    @QQuickView-or As @jsulm says. Start by forgetting about your QJson... code. Just create a hard-coded QString for the payload, based on what your server wants, till you get that working. That rules out JSON problems. Then change over to correctly generating the desired string with QJson... calls.
  • Raspberry Cross Compiler Setting Cannot run target compiler

    Unsolved
    9
    0 Votes
    9 Posts
    1k Views
    I
    @jsulm @Pablo-J-Rogina ../qt-everywhere-src-5.15.2/configure -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/qt5pi/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/qt5pi/sysroot -prefix /usr/local/qt5pi -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtdatavis3d -nomake examples -make libs -pkg-config -no-use-gold-linker -v ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken. ============================================================================================ /opt/qt5pi/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -dumpmachine arm-linux-gnueabihf Checking for valid makespec... cd /opt/qt5pi/qt5build/config.tests/verifyspec && /opt/qt5pi/qt5build/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/opt/qt5pi/sysroot" "QMAKE_CXXFLAGS += --sysroot=/opt/qt5pi/sysroot" "QMAKE_LFLAGS += --sysroot=/opt/qt5pi/sysroot" -early "CONFIG += cross_compile" /opt/qt5pi/qt-everywhere-src-5.15.2/qtbase/config.tests/verifyspec cd /opt/qt5pi/qt5build/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make rm -f verifyspec.o rm -f *~ core *.core /opt/qt5pi/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/opt/qt5pi/sysroot -O2 -w -fPIC -I/opt/qt5pi/qt-everywhere-src-5.15.2/qtbase/config.tests/verifyspec -I. -I/opt/qt5pi/qt-everywhere-src-5.15.2/qtbase/mkspecs/devices/linux-rasp-pi4-v3d-g++ -o verifyspec.o /opt/qt5pi/qt-everywhere-src-5.15.2/qtbase/config.tests/verifyspec/verifyspec.cpp /opt/qt5pi/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/opt/qt5pi/sysroot -Wl,-O1 -Wl,-rpath-link,/opt/qt5pi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/opt/qt5pi/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o /opt/qt5pi/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: 그런 파일이나 디렉터리가 없습니다 /opt/qt5pi/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: 그런 파일이나 디렉터리가 없습니다 /opt/qt5pi/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm collect2: error: ld returned 1 exit status make: *** [Makefile:68: verifyspec] 오류 1 Note: Also available for Linux: linux-clang linux-icc I got this error. What can I do?
  • Database query, front end update, suggestions?

    Unsolved
    15
    0 Votes
    15 Posts
    503 Views
    SPlattenS
    @J-Hilk , thank you, I will look into it.
  • Problem with QScxmlStateMachine and boolean data type in SCXML transition condition

    Unsolved
    3
    0 Votes
    3 Posts
    295 Views
    M
    Thank you for your reply. By the way, I'm using QT 5.15.2 Unfortunately it doesn't work with 0 and 1. It works if I write it as a string cond="_event.data == 'true'" even if I leave the boolean in the code. And there is one more thing, my scxml file is auto-generated by a statechart tool (yakindu), so the program should work with this scxml syntax.
  • Touch screen can not trigger qtvirtualkeyboard

    Unsolved
    1
    0 Votes
    1 Posts
    146 Views
    No one has replied
  • Broadcasting QVector data

    Solved
    7
    0 Votes
    7 Posts
    584 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
    295 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
    523 Views
    SGaistS
    That is a bit strange indeed. Something to investigate.
  • Example Using QGraphicsView Class

    Unsolved
    7
    0 Votes
    7 Posts
    601 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
    553 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
    942 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
    302 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    10 Views
    No one has replied