Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Please help with Qt::WindowStaysOnTopHint

    Unsolved
    11
    0 Votes
    11 Posts
    5k Views
    JoeCFDJ
    One way to work around this is to disable all other widgets when your window or dialog is on the top and enable all of them after this window or dialog is closed.
  • Get each video's frames as an QImage using GStreamer

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    SGaistS
    You should rather use the Qt version provided by your distribution since you installed the Qt5Gstreamer libraries through it.
  • 0 Votes
    4 Posts
    2k Views
    Christian EhrlicherC
    My second solution would be much more portable.
  • disconnect happens automatically?

    Unsolved
    3
    0 Votes
    3 Posts
    923 Views
    Christian EhrlicherC
    Properly explained in the documentation to QObject::disconnect(): 'A signal-slot connection is removed when either of the objects involved are destroyed.'
  • Using QObject::conect in a static function

    Unsolved
    11
    0 Votes
    11 Posts
    3k Views
    JonBJ
    @diego-qt said in Using QObject::conect in a static function: I have to admit it seemed easy at the beginning but it turned out to be hard to develop. This is called "programming" ;-) It's also why we're all underpaid.... I don't want to make you rewrite the whole thing. I'm also not claiming I have the time to digest or advise on a complete design methodology. But you might like to say a few words about what this file is for, who writes to it when, what processes you seem to have which need to communicate? "Sockets" and "named pipes" are one from of "IPC" --- InterProcess Communication. You have a "sender" and a "receiver". You are kind of using your file for that, I think. One difference is that there is no "going back and overwriting" --- you don't usually need that for messaging --- which you seem to be doing. Sockets also work across machines whereas QFileWatcher basically does not, which may or may not be relevant to your requirement. Anyway, like I said it's a big subject, and I'm not volunteering to write it for you, so up to you --- you might prefer to stay with what you are doing now since you have existing code.
  • error jumps :( QPainter::begin: Paint device returned engine == 0, type: 1

    Solved
    2
    0 Votes
    2 Posts
    344 Views
    jsulmJ
    @timob256 You can only paint inside paintEvent, see https://doc.qt.io/qt-5/qpainter.html "Warning: When the paintdevice is a widget, QPainter can only be used inside a paintEvent() function or in a function called by paintEvent().". So, move the painting into paintEvent.
  • qt Designer object position change when set another to visible or not

    Unsolved
    2
    0 Votes
    2 Posts
    233 Views
    AxelViennaA
    The idea behind layouts is that they group widgets automatically as they resize. If you want an item to keep its position, you can disable the others with myWidget->setEnabled(false); instead of hiding it completely. You can also „fill“ the position of invisible widgets by e.g. an empty label, which is less elegant.
  • This topic is deleted!

    Solved
    19
    0 Votes
    19 Posts
    23 Views
  • Image from resource never shown

    Solved
    8
    0 Votes
    8 Posts
    751 Views
    O
    @mchinand You help me to find what was wrong. I forgot to add the "imageformats" libraries (qgif.dll, qico.dll and qjpeg.dll) in the application folder. With this files, its working correctly. Thanks.
  • Image rotation - getting the best result

    Solved
    4
    0 Votes
    4 Posts
    3k Views
    O
    The image center is (width() - 1) / 2.0 (height() - 1) / 2.0 as the image coordinates starts at (0,0) and ends at (width-1, height-1).
  • 0 Votes
    2 Posts
    137 Views
    jsulmJ
    @eric0511 Please post the actual error (it should come before "Error while...").
  • Switch screens (.ui) on same window without opening new window with C++

    Solved
    8
    0 Votes
    8 Posts
    3k Views
    A
    @ChrisW67 It worked for me, Thank you Chris
  • QDateTimeEdit and QComboBox height in QToolBar

    Solved
    5
    0 Votes
    5 Posts
    668 Views
    J
    @eyllanesc Thank you so much for the example. Looked at your code closely. When I apply the "fusion" style, yes the comboboxes do size like your example showed. I am on a Mac. That is probably why the comboboxes are not resizing (this must be similar to how some of the other widgets behave on Mac vs other platforms). Thanks again for your help. I am marking this as resolved.
  • Save labels( Pixmap) and CSV table information on same file, then Load back

    Solved
    8
    0 Votes
    8 Posts
    849 Views
    G
    Well, Im changing to Solved, as @SGaist you are correct, best way was using a QDataStream to save and load data I used QByteArray and worked for me, but instead on saving internally I used a MYSQL database (localhost) to save pictures and works as a charm. Thanks for your time. here the code that worked for me: Hope it helps someone with the same issue. void MainWindow::on_pushButton_save2SQL_clicked() { auto fileName = QFileDialog ::getOpenFileName(this,"Select Image","/home/pi/Pictures","Image Files (*.png *.jpg);;Any file (*.*)"); if (fileName.isEmpty()) { return; } ui->nombreArchivoLineEdit->setText(fileName); QFile file (fileName); if (!file.open(QIODevice::ReadOnly)) return; QByteArray inbyteArray = file.readAll(); QSqlQuery query; query.prepare("INSERT INTO try (image) VALUES (:imageData)"); query.bindValue(":imageData",inbyteArray); query.exec(); mModel->select(); }
  • GtkDialog mapped without a transient parent

    2
    0 Votes
    2 Posts
    517 Views
    SGaistS
    Hi, IIRC, it comes from the GTK platform theme plugin and nothing you can do about.
  • Large offscreen bitmap, QImage *toImage* failing

    Unsolved
    10
    0 Votes
    10 Posts
    700 Views
    SPlattenS
    @SGaist , that is an option I’m considering, thank you
  • How to save multiple QOpenGLFrameObject into QImage

    Unsolved
    2
    0 Votes
    2 Posts
    131 Views
    SGaistS
    Hi, Parse the list to get all sizes Create a QImage of a suitable size to contain them all Paint that image with the content returned by toImage at a suitable place.
  • QUdpSocket Multicast can't receive

    Unsolved
    11
    1 Votes
    11 Posts
    3k Views
    ThirdStrandT
    also:: https://stackoverflow.com/questions/19218994/qt-joinmulticastgroup-for-all-interface Helps to use the various indications/flags in the QNetworkInterface object also.
  • QImage blur, sharpen etc.?

    Unsolved
    4
    0 Votes
    4 Posts
    778 Views
    SGaistS
    It was the other way around, OpenCV used Qt as one of the backend for its highgui module.
  • qpixmap::scaled: Pixmap is a null pixmap error on RELEASE, but works properly in DEBUG

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    A
    @JonB ok! Thanks for your tips. I finally got it to work. The code was ok afterall, but in the release folder, inside the imageformats folder, some dlls were missing. I overwrote this folder with the one in C:\Qt\5.15.2\msvc2019\plugins\imageformats, and that solved the issue.