Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.2k Topics 455.5k Posts
  • Mongo C Driver: Loosing decimal digits in QT application

    Solved
    4
    0 Votes
    4 Posts
    180 Views
    aha_1980A
    @Christoph-LaBP Super! Then please mark this topic as SOLVED (with the button Topic Tools). Thanks!
  • How is the Qt virtual keyboard initialized and how do I use it?

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    Aleksey_KA
    @Circuits said in How is the Qt virtual keyboard initialized and how do I use it?: input method is not set Solution is here: https://forum.qt.io/post/594648
  • How to specify the input method for the Qt Virtual Keyboard?

    Solved
    7
    0 Votes
    7 Posts
    5k Views
    Aleksey_KA
    Found the solution. Following workaround works for me: TextArea { onActiveFocusChanged: { if(activeFocus) { Qt.inputMethod.update(Qt.ImQueryInput) } } } Works with other controls as well.
  • How to prepend the data size to a file

    Solved
    8
    0 Votes
    8 Posts
    732 Views
    S
    @J-Hilk sorry i wanted to write that i am able to prepend the file now and my problem is solved. unfortunately it was a type error from my side in my previous comment.
  • Setting contentMargins for a QScrollArea?

    Solved
    3
    0 Votes
    3 Posts
    251 Views
    B
    @SGaist Thank you, it works now with applying the settings to the QWidget.
  • Problem with Signal and SLOTS

    Unsolved
    5
    0 Votes
    5 Posts
    254 Views
    jsulmJ
    @Chaki said in Problem with Signal and SLOTS: I am not quite sure in which header-file I should initialize a new serialcomm You can do it in MainWindow
  • Range-based for loop for a QList

    Unsolved
    16
    0 Votes
    16 Posts
    2k Views
    tomyT
    @Bonnie I've used "addItem" for both the comboBox and listWidget to add items thereby they are visible, but removeItem is for this usage apparently and deleting the selected items will do the job. Thanks.
  • Cannot marshal std::string with QDbus

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    X
    @wpmccormick I will answer your 3rd question,you should write Q_CLASSINFO("D-Bus Interface", "org.foo.bar"),your interface name can be correct. Now,I have a new question Unregistered input type in parameter list: ServiceStatusList when I use qdbuscpp2xml to generate xml. Who can tell me what should I do,thanks a lot.
  • Pause and Continue a Thread?

    Solved
    8
    0 Votes
    8 Posts
    4k Views
    S
    When you start a QThread it will run its own event loop. doStuff is the first slot that is executed in that event loop. However, by your design, the while-loop will block the event loop of this thread. The stop signal will thus never be executed as stop will be executed in the context of the receiver, i.e. the event loop of that other thread and not the main event loop. Here are a few ideas how you could solve your problem: Have the stop_action connect to a slot in MainWindow that directly calls self.worker.stop(). This will be executed in the main event loop, so blocking in the other thread is not a problem. Someone might mention that Worker.stopped is not an atomic variable. As long as you don't want to have an immediate reaction this will not be a problem. The worker thread will pick up the change eventually. (Actually, you might even not notice any delay.) If you want to simulate an infinite loop inside the event loop of that thread, you can have a QTimer running with a timeout of 0s. This will constantly put a call to the same slot into your event loop. Still, the stop signal has a chance to slip in between and you'll have a chance to kill that timer. As you said before you want to send data to the worker thread through a signal-slot connection. This approach would be the preferred way. Only do work in the worker thread when you have new data. Just call a slot in the worker thread (through a signal) with the new data and do the work. Afterwards the worker thread can idle to wait for new data. No need to have a loop running.
  • Usage of QGuiApplication::focusWindowChanged()

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    S
    BTW, I think QCoreApplication::instance() is a mouthful. There are two shorter versions for that: qApp and qGuiApp. These will cast the instance to QApplication and QGuiApplication, respectively.
  • QComboBox visible item populating issue

    Unsolved
    3
    0 Votes
    3 Posts
    349 Views
    Q
    @Christian-Ehrlicher qt version 5.4.0. the mmi interface is done using the qt creator, drag and drop. void MainWindow::on_down_slot() { int iIndex = ui->ui->comboxbox1->currentIndex() - 1; ui->comboxbox1->setCurrentIndex(iIndex); } so when down key is detected, the above slot will be executed.
  • output test results to stdout using -o

    Unsolved
    5
    0 Votes
    5 Posts
    568 Views
    B
    I should have specified that I am trying to log in multiple formats simultaneously. My bad. From your link: "The first version of the -o option (-o filename,format), may be repeated in order to log test results in multiple formats, but no more than one instance of this option can log test results to standard output." So, if I want to log to a file and stdout simultaneously, I believe this is the only option.
  • Check database (mysql) connection in other window

    Unsolved
    13
    0 Votes
    13 Posts
    2k Views
    SGaistS
    In that case and as I already wrote before, you should implement a proper web service to access the data from your desktop application. You then use QNetworkAccessManager to query that service.
  • QTextEdit save to a text file

    Unsolved
    2
    0 Votes
    2 Posts
    650 Views
    SGaistS
    Hi and welcome to devnet, You already have QTextEdit, use QFile to load and store your data.
  • Classes organisation - general good practices

    Unsolved good practice
    2
    0 Votes
    2 Posts
    270 Views
    SGaistS
    Hi, Go with the usual: single responsibility. If a widget shall handle a particular aspect then keep it separated with a clean API so can also make it testable. For the models, it will highly depend on what you want to access and how you need to interact with it.
  • Could not parse stylesheet of object 0x1018c1d50

    Solved
    8
    0 Votes
    8 Posts
    3k Views
    SPlattenS
    @JonB , found it missing ";" on the last statement before the "}"
  • add row to qtablewidget with button

    Solved
    3
    0 Votes
    3 Posts
    506 Views
    D
    @VRonin I cant believe I made this rookie mistake. Thank you so much. Cant believe it lol
  • Handshake failure conectting to AWS cloudFront on Linux

    Unsolved
    2
    0 Votes
    2 Posts
    172 Views
    SGaistS
    Hi and welcome to devnet, Qt 5.6.3 is really outdated. You should consider to either move to current latest version which is 5.14.2 or if you want to stay in LTS 5.12.8. Qt 5.6.3 still uses OpenSSL 1.0, do you have that one on your Linux system ?
  • 0 Votes
    17 Posts
    8k Views
    kshegunovK
    You're very welcome.
  • Model/View data access

    Unsolved
    2
    0 Votes
    2 Posts
    199 Views
    VRoninV
    Add my custom data access methods. (custom get/set functions). This also requires the delegate to get tied up with the model. I'm a fan of solution 1 but, in the interest of pragmatism, I'd say use the path that is less painful to implement for you. P.S. Classes that include the Q_GADGET macro are already registered metatypes so you can go down that route as well