Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • QGraphicsSceneMouseEvent compile error

    Unsolved
    4
    0 Votes
    4 Posts
    753 Views
    Christian EhrlicherC
    @ademmler said in QGraphicsSceneMouseEvent compile error: in the official QT "Elastics node example" they do exactly the same: No, they do not - the derive from QGraphicsScene which has the function mouseMoveEvent(QGraphicsSceneMouseEvent *).
  • How to load TGA file?

    Solved
    12
    0 Votes
    12 Posts
    2k Views
    M
    @Christian-Ehrlicher I didn't mean to say that. I'm sorry I didn't speak very well. I tried to determine which part of the file did not meet the specification. I saw the part where it check the footer, so I attached the footer, and the problem was found. Oh I got it. You already gave me a link related to footer. (I just recognized it as a tga document. I didn't recognize the anchor.) I had passed it. I checked it right now.
  • QFontMetrics::boundingRect is two times slower than QPainter::drawText

    Unsolved
    2
    0 Votes
    2 Posts
    276 Views
    Christian EhrlicherC
    Since those two functions do completely different things - no. But the Qt source code is freely available so you can take a look if you can improve it's performance.
  • QMYSQL Driver not loaded after compiling The software on Windows instead of Linux

    Unsolved
    2
    0 Votes
    2 Posts
    161 Views
    Christian EhrlicherC
    Please search the forum for mysql - it's asked three times a week.
  • 0 Votes
    13 Posts
    1k Views
    Please_Help_me_DP
    I've found a solution for my case. After paste() command wich is in void TableView::keyPressEvent(QKeyEvent *event) I do: setCurrentIndex(index); // set current index edit(index); // starts editing of item Whenever edit(..) is invoked a delegate is created and if displayed data is invalid then it removes it. And if data is acceptable then delegate accepts it. `setCurrentIndex(..)' is needed as only current indexes can be editable
  • Image Viewer Scaling

    Solved
    5
    0 Votes
    5 Posts
    536 Views
    A
    OK, not sure if this is the best way, but this seems to do what I want (and like Christian mentioned this should happen when a new image is loaded and when the widget is resized): label_image is a QLabel pix_orig is the original pixmap which I keep around in case I ever want to resize "pix manually" (probably not necassary to do this) QPixmap pix = pix_orig; ui->label_image->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); ui->label_image->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); ui->label_image->setPixmap(pix.scaled( ui->label_image->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
  • Qt5 Code Not Inserting values into SQL database

    Unsolved
    8
    0 Votes
    8 Posts
    551 Views
    SGaistS
    Beside the good point of @Christian-Ehrlicher, add proper checks to all your query execution
  • Qt::NoOpaqueDetection

    Unsolved
    7
    0 Votes
    7 Posts
    503 Views
    N
    @Christian-Ehrlicher Ok thanks for that, it'll save me looking any further
  • Button click fails

    Solved
    4
    0 Votes
    4 Posts
    224 Views
    DriftwoodD
    @JonB said in Button click fails: Consider changing that to QSqlQueryModel or QSqlTableModel I'll check that out and see what it offers. We were right about on_tableWidget_AddCustomers_cellChanged firing if characters are left in the field when hitting the Cancel button. Your answer was thorough (much appreciated, that) and I'll go over all you provided me. I've barely scratched the surface of Qt and I know that. I'm coming from Object Pascal (I used Lazarus), where the database components are data-aware and easy to work with. This is just a little different. I think, in the long run, I'll have more (and better) control over my databases with Qt. And when you throw in this excellent community, man, that's just peanut butter icing on a fat chocolate cake :D @Christian-Ehrlicher - Thank you for your assistance.
  • Correct dimension of widgets

    Solved
    5
    0 Votes
    5 Posts
    347 Views
    S
    It works fine. Many thanks.
  • Most convenient way from qDebug to log...

    Solved
    2
    0 Votes
    2 Posts
    188 Views
    sierdzioS
    You should install custom log handler instead: qInstallMessageHandler. This gives you full control over all logs, without any need to change existing calls - you can still use qDebug(), qWarning() etc.
  • How to set the BG color of qMainWindow

    Solved
    2
    0 Votes
    2 Posts
    287 Views
    SGaistS
    Hi, You can use rgb(255, 255, 255). There's an example here in the documentation.
  • 0 Votes
    8 Posts
    1k Views
    M
    @JonB Thanks! The problem is resolved by manually copying TBB DLLs next to the application executable. I guess, some other application has added tbb.dll to my PATH environment variable, but tbb_debug.dll is NOT added to it by any application. Just a guess ...
  • Adding UI elements to a form is not propagated to the code

    Unsolved
    26
    0 Votes
    26 Posts
    4k Views
    kshegunovK
    @AnneRanch said in Adding UI elements to a form is not propagated to the code: @kshegunov said in Adding UI elements to a form is not propagated to the code: Out of curiosity, did you have a fairly good understanding and experience in C++ before picking Qt? Wrote my first program in 1973 - in assembly. Wrote couple of C programs in 1987 - before Windows . Was Q&A analyst for Visual Basic software ... NO, I do not have a foggiest idea about programming... None of which is actually an answer to my question. But doesn't matter, there's no need for the snide remarks, I did only ask out of curiosity. @JonB said in Adding UI elements to a form is not propagated to the code: Are you able to reproduce the "file's name changed along the lifetime of the project"? So far as I am aware, the only time Qt Creator auto-generates a filename is when you add a new class via the wizard, and at that point it makes the case of the filename all lower case, at least under Linux presumably so case is consistent. This is for sources/headers/form files/resources etc. In any case there's the option to correct the file name before creating the file. Here it's about the ui_<formname>.h which is generated by the uic.
  • How to Find a UI By ID at Runtime

    Unsolved
    4
    0 Votes
    4 Posts
    380 Views
    sierdzioS
    @Chris-Weber said in How to Find a UI By ID at Runtime: Hm so for an a/v playing app, would it be fair to say the a/v window (in native Android) should be in a separate activity with Qt drawn over it? You can play AV in QML using QtMultimedia module. Whether it's possible to overlay Qt app on top of another activity - I'm not sure, you'd have to try it out.
  • Auto resize the mainwindow to fit the content in the tab widget

    Solved
    6
    0 Votes
    6 Posts
    5k Views
    H
    @Christian-Ehrlicher @JonB Thanks for your opinion. I will avoid such things and find a better solution.
  • QLabel Opacity Register Event

    Unsolved
    3
    0 Votes
    3 Posts
    340 Views
    N
    @JonB Thanks Jon QPushButton not a goer as is would be too much of an upheaval at this stage considering the work done to this point. I will look at your eventfilter suggestion. I thought the answer would be more straightforward than this but Ive been looking for a few days now..head wrecked.
  • QxtSignalWaiter broken in latest Qt5

    Unsolved
    3
    0 Votes
    3 Posts
    347 Views
    J
    libqxt was abandoned a decade ago I'll try to replace it with a simple QEventLoop based solution
  • How to focus the selected index in the tree view

    Solved
    2
    0 Votes
    2 Posts
    476 Views
    Christian EhrlicherC
    Take a look at QAbstractItemView::scrolTo()
  • How to add a widget in UI design under the mac os?

    Solved
    3
    0 Votes
    3 Posts
    428 Views
    H
    @artwaw said in How to add a widget in UI design under the mac os?: https://forum.qt.io/topic/119537/qt-creator-rollback thanks