Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • How to Set Font to all Application

    Solved
    9
    0 Votes
    9 Posts
    7k Views
    TheCipo76T
    @raven-worx yes.. i'm fix it with this: void MainWindow::updateAllWidgets() { foreach (QWidget *widget, QApplication::allWidgets()) { widget->setFont(QApplication::font()); widget->update(); } } But don't works on Menu Action
  • Schermo nero + icona fulmine

    Unsolved
    2
    0 Votes
    2 Posts
    347 Views
    mrjjM
    Hi Google says " As the title suggests, after the recalbox update. The power supply is from 5v 2a but I read on another thread that you are not using a correct boot code for P3B + ... how can I check?" So are you sure its the right forum ? (also this is the english section)
  • JOM error after VS2017 update?!

    Solved
    11
    0 Votes
    11 Posts
    3k Views
    MucipM
    Dear @aha_1980 , Changing TEMP path to c:\temp solved my problem... :) Thanks. Regards, Mucip:)
  • Having problems deleting and adding widgets to a layout.

    Solved
    4
    0 Votes
    4 Posts
    409 Views
    jsulmJ
    @blakejustblake Yes, you need to call show()
  • what is the best way to use variable read from a doubleSpin in another cpp file?

    Unsolved
    4
    0 Votes
    4 Posts
    533 Views
    jsulmJ
    @pedromenezes You can have a signal with more than one parameter or you create a struct containing these parameters and use this struct as parameter type for your signal.
  • How can I make my listview that uses custom widgets more efficient?

    Solved
    5
    0 Votes
    5 Posts
    3k Views
    DougBeneyD
    You're right! I ended up successfully moving to a delegate! [image: i6yXioK.png] Works beautifully. Painting in Qt was way less scary than I thought it would be. Before this I actually got my threaded idea working. It got the job done, but was not the best solution. This is so much better. Thanks for the help. In case anyone runs into this post in the future, here is my custom delegate. I also had to create a custom ListView in order to get the correct click behavior I wanted. (When you click the star, it shouldn't select the listview item)
  • how to delete rows in QtableView and Qabstractitemmodel

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    RatzzR
    @Qt-Enthusiast said in how to delete rows in QtableView and Qabstractitemmodel: Here is an re-implement example https://myprogrammingnotes.com/addinsertremove-row-qtableview.html Qt Doc here.
  • Problem exceptions from static library

    Solved
    10
    0 Votes
    10 Posts
    961 Views
    SGaistS
    No problem with that. As written, it was just curiosity.
  • Systemd shutdown, halt and reboot handling

    Solved systemd poweroff halt reboot
    19
    0 Votes
    19 Posts
    4k Views
    E
    @SGaist Yes, it is started as systemd service. Finally i found the reason, why it hangs. It is happened because I made blocking syscall from event loop. So this thread can be closed and marked as resolved. Appproach with QSocketNotifier and signalfd works.
  • QItemDelegate with multiple QWidgets inside - Focus problem

    Unsolved
    6
    0 Votes
    6 Posts
    987 Views
    Chris KawaC
    I had similar problem and went through couple of different solutions. My case was specific in the sense that I only wanted the edit to start via mouse press, not other methods (i.e. enter or tab). In that specific case I ended with the following: Blocked all edit triggers by setting editTriggers to NoEditTriggers. Implemented editorEvent() in the delegate to recognize a mouse press and calling edit() manually. In the created widget I implemented showEvent(). In it I check if it's the first show event or not. If it's the first I synthesize a fake mouse release event followed by a mouse press event and send them to the app via QApplication::sendEvent(). Some attention was needed to make sure the fake events are with the same mouse buttons and other event options, otherwise you can easily confuse the internals of the view. This way Qt does all the work to figure out which widget should get the focus and mouse press, how to route it through the item view etc. You can probably extend this to other trigger methods. You would just need to tell the widget somehow about which trigger method was used and act accordingly in the showEvent() e.g. set focus on the "first" widget when it's via tab key and so forth.
  • mysql driver crash when reconnecting to remote database from linux

    Unsolved
    5
    0 Votes
    5 Posts
    991 Views
    D
    I have created a (non) working example to reproduce it. It's docker based, and only requires a couple of commands in order to run / fail. It's available here (with documentation in README): https://github.com/tskardal/mysigsegv
  • webenginewidgets is very heavy! Why?

    Unsolved
    3
    0 Votes
    3 Posts
    301 Views
    MucipM
    Hi, You're right. Excause me. Win10x64 and Qt 5.12.0 And the address is: http://www.sacprofil.com/sac-agirlik-fiyat-hesaplama Regards, Mucip:)
  • How to properly trigger paintGL function ?

    Unsolved qopenglwidget qpaint qpainter qtime fps
    2
    0 Votes
    2 Posts
    1k Views
    D
    Ok solved It appears that a GLOBAL surface setInterval overrides the setIntervals I did on my glWidget. Kinda weird that the global one overrides local one if local one was specified, is this a bug ? format.setSwapInterval(0); QSurfaceFormat::setDefaultFormat(format); overrides on widget > QSurfaceFormat format; format.setSwapInterval(0); setFormat(format);
  • Static build

    Unsolved
    5
    0 Votes
    5 Posts
    565 Views
    sierdzioS
    Yep, we'll need more info like @dheerendra suggested. Other than that, I can recommend the very general instructions from Qt docs.
  • Change code versioning system in Qt Creator ?

    Solved
    3
    0 Votes
    3 Posts
    280 Views
    C
    Yes, I read that. I sort of solved it I think. It looks like the project has to be added to Perforce outside QT. For example in P4V.exe. When I open the project now that it's in Perforce I also see the Perforce submenu to check out and submit files. Thanks, Gerhard
  • public slots: - not always works?

    Solved
    4
    0 Votes
    4 Posts
    423 Views
    dheerendraD
    Delete the build directory and build the project again
  • First Qt cmd line app

    Unsolved
    3
    0 Votes
    3 Posts
    633 Views
    dheerendraD
    Did you create default project and no modifications from you. Does this simple project work ?
  • How can i get y value from a plotted QCustomPlot?

    Solved
    6
    0 Votes
    6 Posts
    3k Views
    SGaistS
    Hi, You can improve your access to the data using: auto plotData = ui->customPlot_1->graph(0)->data(); for (int i = 0 ; i < plotData->size() ; ++i) { double lastKey = plotData->at(i)->key; double lastValue = plotData->at(i)->value); qDebug () << "X:" << i << lastKey; qDebug () << "Y:" << i << lastValue; } Or use iterators.
  • Order of slots execution

    Unsolved
    13
    0 Votes
    13 Posts
    5k Views
    JKSHJ
    @Absurd said in Order of slots execution: what's the meaning behind "objects that live in the same thread"? This concept applies to QObjects and the signal-slot mechanism. In simple terms, when we say that a QObject lives in Thread X, we mean that the QObject's slots will run in Thread X. If your program is single-threaded, then you don't need to worry about this concept. If you want to learn more, read http://doc.qt.io/qt-5/qobject.html#thread-affinity. Although a single object can be instantiated by only one thread, it can be accessed by many, That is technically true, but there are dangers in allowing an object to be accessed from multiple threads. You'll need to take extra steps to make your object thread-safe. Just to make sure I understand... (and sorry if it sounds like a stupid question, as I don't have any experience with multi-threading programs...) It's a perfectly valid question :) We all ask questions to deepen our understanding! We're happy to answer your questions.
  • SetVisible(true)/SetVisible(false) or hide ()/show() error

    Solved
    5
    0 Votes
    5 Posts
    6k Views
    P
    @Pl45m4 Thank you guys. After your suggestions I solved the problem. Headers: //MainWindow.h #include <QMainWindow> ... private: Ui::MainWindow *ui; ... public slots: void openWindow(); //promediation.h #include <QMainWindow> ... signals: void exec_closeW(); private: Ui::promediation *prom; MainWindow *main; Forms: //MainWindow.cpp #include "promediation.h" ... void MainWindow::openWindow(){ this->show(); delete prom; } void MainWindow::on_pushButton_clicked() // hide "MainWindow" and show de "promediation" { prom = new promediation(); prom->show(); QObject::connect(prom, SIGNAL(exec_closeW()), this, SLOT(openWindow())); this->hide(); } //promediation.cpp #include "mainwindow.h" void promediation::on_pushButton_clicked() { emit exec_closeW(); //now everything works! } Thank you all!!