Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Can't unset Qt::WA_TransparentForMouseEvents attribute

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    B
    @jsulm Yes you are right, for some reason I did not think it would cause any problems but anyways, I tried this void MainWindow::toggleFocus() { focusable = !focusable; ui->textEdit->append("setting transparent "); ui->textEdit->append(focusable ? "true" : "false"); setAttribute(Qt::WA_TransparentForMouseEvents, focusable); hide(); QTimer::singleShot(1000, this, &MainWindow::hideShow); } void MainWindow::hideShow() { show(); } still no luck.
  • App Crashed on run

    Solved
    7
    0 Votes
    7 Posts
    387 Views
    JonBJ
    @aim0d OK, but still might be a good opportunity to learn how the debugger works and where the stack view pane is among its windows, as that will be very useful for your future.
  • How to print all tableview rows in qt using Thermal printer?

    Unsolved
    2
    0 Votes
    2 Posts
    230 Views
    JonBJ
    @Ramkumar-Mohan I don't see how a "thermal" printer is relevant to anything? I'm Printing row separately in tableview. Don't know why/what the significance is. There are several approaches to "printing" what is in a QTableView, depending on what your objective is. If you Google qtableview print you can look through the various hits and decide which approach you are looking for.
  • Program with a GUI crashes when add .h and .cpp files

    Unsolved
    6
    0 Votes
    6 Posts
    631 Views
    JonBJ
    @Pordo said in Program with a GUI crashes when add .h and .cpp files: I resolved it changing the variable type to float. That sounds a lot more useful :) Just a comment: consider using double instead of float for this, other constants and arithmetic. In C all floating point calculations are done in double-precision anyway (at least I think/thought this was the case). Using float instead of double throws away precision for no good reason. The only time I would use floats is to save space if I had millions of them....
  • libcurl corrupted attached file

    Unsolved
    5
    0 Votes
    5 Posts
    473 Views
    F
    I solved the issue with dfandrich suggestion, ising curl_mime_encoder: part = curl_mime_addpart(mime); QString logo=QApplication::applicationDirPath()+"/Images/logoIgn.jpeg"; curl_mime_filedata(part, logo.toStdString().c_str()); curl_mime_encoder(part, "base64");
  • macOS - QT application crash after going out of sleep

    Unsolved
    6
    0 Votes
    6 Posts
    546 Views
    jsulmJ
    @TalOz You could try to reopen that ticket and provide your description.
  • passing multiple options to qterminal

    Unsolved
    12
    0 Votes
    12 Posts
    844 Views
    JonBJ
    @AnneRanch said in passing multiple options to qterminal: but this "native window" exists physically and I should be able to access it. it is time to concentrate on access to "NATIVE WINDOW"... I have tried to explain several times that you will not be able to access the output you see in a terminal --- whether from xterm or qterminal --- from an external program, such as your Qt application. That output goes into the terminal's output window and is not available to "see" or "read" elsewhere, even though you would like it to be. But I will leave you to your investigations. When you come to the same conclusion you have my reply at https://forum.qt.io/topic/139374/another-xterm-qtextedit-issues/10 which shows what you will need to do if you do wish to access the output from bluetoothctl and has code showing how to do it and what the final output will look like.
  • Qt application size optimization

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    kkoehneK
    You should also run strip on your binary.
  • Plotting chart using lots of data

    Solved thread chart chartview
    8
    0 Votes
    8 Posts
    2k Views
    jsulmJ
    @StudyQt1 said in Plotting chart using lots of data: Is there a generic way to decide? Use a profiler. If you're using GCC you can use https://www.thegeekstuff.com/2012/08/gprof-tutorial/ Easier way which is often enough is simply to put debug output at the beginning and end of your methods/functions with timestamps and then check the output of your application while it is running.
  • Unwanted Windows Command Prompt when using QSignalSpy::wait()

    Solved
    4
    0 Votes
    4 Posts
    305 Views
    jsulmJ
    @JKappes said in Unwanted Windows Command Prompt when using QSignalSpy::wait(): It's better for UX to wait I disagree - you're blocking the UI, this can be frustrating for the user. But its you application.
  • How to use QSound on Visual Studio?

    Solved
    3
    0 Votes
    3 Posts
    569 Views
    CesarC
    Thank you, this did work, also the include need is #include <QtMultimedia/qsoundeffect.h>
  • How to effectively overwrite entire folders in Qt C++?

    Solved
    5
    0 Votes
    5 Posts
    484 Views
    H
    @SGaist Thank you! I did it using QDir::entryInfoList but I guess QDirIterator would be much better.
  • reading through view

    Unsolved
    2
    0 Votes
    2 Posts
    170 Views
    SGaistS
    Hi, One possible way could be to use an event filter with a search (or rather use the match method) applied to the column currently selected.
  • [Qt-Dbus] [Debian 10] Not possible de connect to D-bus session

    Solved
    7
    0 Votes
    7 Posts
    3k Views
    N
    Thank you for answering. This ticket can be closed now.
  • oauth2 setModifyParametersFunction post qt6

    Solved
    4
    0 Votes
    4 Posts
    527 Views
    testmonkeyT
    thanks again @JonB ! I have managed to get the app working. For completeness; I used to used to call a redirect in the requestinterceptor and link connect to the signal via -- connect(view, &QWebEngineView::urlChanged, view, &QWebEngineView::reload); in Qt 6.3 this was cause the QWebEnginePage::setUrlRequestInterceptor to backtrace and error out as mentioned with the parsed_headers.Equals error. So after a bit of digging and a few qDebug decided to settle on creating and emitting the newurl instead and changed the connect to ; connect(interceptor, &RequestInterceptor::newurl, view, &QWebEngineView::setUrl)
  • QRegExp returning incorrect position due to codec ?

    Unsolved qfile qtextstream qregexp codec utf-8
    14
    0 Votes
    14 Posts
    2k Views
    Christian EhrlicherC
    @Aramir said in QRegExp returning incorrect position due to codec ?: ve seen many SD cards/emmc die in ereaders (devices I'm aiming for) therefore I'm trying to lower the write operations on it in order to not reduce their lifetime. That's it I think it's worth the trouble to figure out a solution to this problem instead of creating more and more e-waste. Again a useless optimization due to a feeling. Optimize only when you can prove it's a problem and needs to be optimzied. You SD-Card has likely a sector size of 512 or 1024 bytes. On top of this your filesystem may use a block size up to 64kb (NTFS, ext4 use 4kb ). So when you even change single byte in your file which is less than the sector size or block size it will write the whole sector/block. It's just plain stupid and an over-complicating of things for nothing.
  • resize by clicking the column edges

    Unsolved
    5
    0 Votes
    5 Posts
    377 Views
    NevezN
    Thanks for your comment. I guess I'll have to give up on this method.
  • C++, emit signal from custom eventfilter failed

    Solved
    5
    1 Votes
    5 Posts
    509 Views
    X
    @JonB thank you very much! without you answer not only I can't understand lifetimes , but also I would never to think about memory.
  • Reading Number

    Unsolved c++
    5
    0 Votes
    5 Posts
    487 Views
    A
    @Paul-Colby Yes, that what I was meaning. I'm gonna try thanks.
  • Working with a QListView crashes with no error

    Solved
    8
    0 Votes
    8 Posts
    720 Views
    JonBJ
    @Sikarjan-0 said in Working with a QListView crashes with no error: why do I have to put mModel = new QStringListModel(...); prior mModel->setStringList? Is declaring it in the header not enough? No, it is not enough! You should take some time to understand this, you will need to in order to program in C++ successfully. Note that you are declaring a pointer to a QStringListModel when you write QStringListModel *mModel;. Your class will indeed have room for that pointer allocated, but it does not point to any QStringListModel when an instance of your class is created. If you are "lucky" (not really!) it is set to nullptr, if you are "unlucky" (much more likely for class members) the pointer has a garbage value. Either way if you try to do anything with mModel-> --- which mModel->setStringList() will be doing --- something "bad" will happen! In the constructor of the class you are likely to want to create the model instance with mModel = new QStringListModel(this), now you have allocated a model and set mModel to point to it. Note this is very different from having your class member variable declared via QStringListModel mModel;. This is not a pointer to an instance of QStringListModel, which needs to be allocated, it is an actual instance of a QStringListModel, which is created as your instance is created. Which of these two you want/prefer depends on your code.