Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • DoubleClick in TableView

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    JonBJ
    @notyourfan Where should i connect this signal? In my Model? You can call the connect() anywhere that the necessary variables/functions you specify are visible. So it does not have to be "inside" anything in particular, most people put connections somewhere in their start up of the UI. However, putting it inside the model code area/classes is not a good idea. Models should not need to know anything about views. OTOH, views do need to know about models, so in the view code, or in the calling code which creates the view, would be best.
  • 0 Votes
    8 Posts
    2k Views
    SGaistS
    Hi @Sebastien-Leon and welcome to devnet, Can you post the link to the bug report / gerrit review you made ?
  • QNetworkReply::finished lambda QFile::open switch crash

    Solved
    8
    0 Votes
    8 Posts
    825 Views
    JonBJ
    @j-hilk , @Christian-Ehrlicher No, I didn't spot that link somehow, now I do, and I see it explains. So that's what I was looking for. I shall add this new & to the = for the (tortured) list of new "overloaded operator symbols with different meanings" that C++ wants me to remember... ;-)
  • Is there any method to batch build library for all platforms?

    Unsolved
    3
    0 Votes
    3 Posts
    350 Views
    brucezcgB
    Thanks for the reply. If there any else method to do this?
  • Building a "complex" progress widget

    Unsolved qthread qtconcurrent qprogressbar
    5
    0 Votes
    5 Posts
    1k Views
    D
    @sgaist said in Building a "complex" progress widget: Don't try to steal anything. Use signals and slots to communicate from your secondary threads back to your main thread. Yes, but as far as I can tell the main thread is "working" (or user has took control over it) as it spawned the secondary threads and is waiting for them to finish processing before moving on. Edit Ok so I've now run QMetaObject::invokeMethod(this,={callToLongFunction},Qt::QueuedConnection); This appear to work, however any loop that was being #pragma omp parallel for for (){} No longer threads... so qt somehow manages to break the omp multithreading ? -- well standalone teste indicates that no... all works there but my app stopped threading... sweet. Ok I'm a nub, its official! Everything works. It threads & runs job in qt internal event loop thus I don't have any issues. Wow. Ok I need to learn more on qt threading event loop :D I need to fork one for myself and have it process all my work stuff now :- )) EDIT... Ok seems like I did a full loop. I went from processing in user thread to processing in qt event loop - fine - but pragma still wont update the widget at the correct time... sigh. Since now we are in event loop, the processing of function is more important than processing of omp thread update signal... I need some kind of priority attached to signal to tell qt that hey... I know u have ur loop but process this signal now. Right now with Qt::DirectConnection while trying to update val/etc I get this > ###### WARNING: QWidget::repaint: Recursive repaint detected ((null):0, (null)) ###### ###### WARNING: QBackingStore::endPaint() called with active painter on backingstore paint device ((null):0, (null)) ###### And aparently by putting this inside omp seems to "work"... if (omp_get_thread_num() == 0) { qApp->processEvents(); } ```... ahhhh multithreading <3
  • MAC Catalina - Notarizing the Qt Application

    Unsolved
    2
    0 Votes
    2 Posts
    595 Views
    dheerendraD
    I have seen the link We will try & update the group.
  • QSerialPort compatibility between 5.2 and 5.10

    Unsolved qserialport
    5
    0 Votes
    5 Posts
    600 Views
    W
    @kent-dorfman Flow control is not implemented on this receiver. GPSD is also not a concern as this receiver does not speak NMEA it conforms to ICD-GPS-153c.
  • 0 Votes
    3 Posts
    381 Views
    D
    okay apparently, WYSI-NOT-WYG when i RUN the app, it sizes as expected
  • Can't get MetaData of URL using QMediaPlayer

    8
    0 Votes
    8 Posts
    2k Views
    W
    The OP seemed to be making a distinction between URLs and local files. The files I am using are local files; the URLs are created using QUrl::fromLocalFile. I thought that there might be some way that I could solve my issue of not being able to get metadata from the files if I somehow made them 'more local', but I don't see any method of doing that. Thanks, Alex
  • Qt does not play video

    Solved
    5
    0 Votes
    5 Posts
    375 Views
    M
    I create a widget in the editor, change its class to QVideoWidget and already stretch it.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    27 Views
    No one has replied
  • Connecting to statusBar()->showMessage gives compile time error in new syntax

    Solved
    16
    0 Votes
    16 Posts
    1k Views
    O
    @ofmrew Try this example: ``` void canvasResized(QString s); QString st = "It opened"; emit canvasResized(st); connect(ui->canvas, &MyCanvas::canvasResized, [this](const QString& st){this->ui->statusBar->showMessage(st, 0);}); I added the emit to the resizeEvent and it worked.
  • Trouble connecting to aws iot using QMqtt and QSsl stack.

    Unsolved
    5
    0 Votes
    5 Posts
    680 Views
    E
    @SGaist okay I will add that. But Don't you think if there was any error. Mqtt should also throw an error. Because if I remove a certificate or a private key from the file or add any wrong information, I do get an error stating that the transport properties are not set properly and the ClientState goes to disconnected it does not stays on connecting for a long period of time.
  • make visible 1 layout at a time

    Solved
    10
    0 Votes
    10 Posts
    838 Views
    B
    @j-hilk thanks guys it's working
  • cannot run: no command

    Unsolved
    50
    0 Votes
    50 Posts
    16k Views
    jsulmJ
    @asha workstation is not you target device but the machine where you're developing/crosscompiling...
  • cross compiler issue

    Locked Unsolved
    2
    0 Votes
    2 Posts
    475 Views
    Pablo J. RoginaP
    @asha please don't double post. Thanks.
  • win10 fails to connect to mysql but the same binary+dll's work on win7

    Solved
    2
    0 Votes
    2 Posts
    206 Views
    Seb TurS
    Found a bug - using QT_DEBUG_PLUGINS helped here. for some reason qt on win10 reads text files in a different way or sql treads db.setHostName parameter in a different way so when I have a txt file .myconfig with 2 lines db_host db_name for example 192.168.0.9 my_db and code File file(QDir::homePath()+"/.myconfig"); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { qDebug()<<" konf not open"; return; } QString sql_host; QTextStream in(&file); sql_host = in.readLine(); db_name = in.readLine(); db.setHostName(sql_host); db.setDatabaseName(db_name); db.setUserName("user"); db.setPassword(as+as); bool ok = db.open(); it was giving ok=true but failing on queries fix was to use: sql_host = in.readLine().trimmed(); intead of sql_host = in.readLine(); so readLine() was adding space at the end in win10 (.myconfig file edited in notepad) hope this helpes somebody else.
  • QSplitter not respecting the maximum size of the widget in Qt 5.12.3?

    Unsolved
    2
    0 Votes
    2 Posts
    816 Views
    SGaistS
    Hi, That looks strange indeed. Can you reproduce that with a minimal compilable example ? Did you also check with the latest Qt 5.13 to see if it's still the case ?
  • I am unable to find any example after my install i tried both in windows 10 and debian

    Unsolved
    7
    0 Votes
    7 Posts
    542 Views
    jsulmJ
    @abhishek08 said in I am unable to find any example after my install i tried both in windows 10 and debian: can u please let me know what else should be installed Qt Best is to use online installer as @beecksche suggested and select the MinGW Qt version there: it will install MinGW (GCC Windows port) and Qt for that compiler, then you should be ready to go. QtCreator is just an IDE. To use it you need at least a compiler and if you want to use Qt you have to install Qt as well.
  • Trouble with connect()...

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    A
    Thanks for all the help guys, figured it was just a stupid mistake like that. Just wanted to get this working and then I'll take everyone's advice and use the newer signal/slot syntax.