Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • SQLite (Drill Down example)

    Unsolved
    2
    0 Votes
    2 Posts
    195 Views
    C
    @Flaming-Moe When you construct a QSqlQuery without any arguments, or with only a query string, then the database argument defaults to an invalid QSqlDatabase object. In this circumstance the query object will be associated with the default database, i.e. the QSqlDatabase object returned by QSqlDatabase::database().
  • How to get "ProductName" and "ProductVersion" properties for a DLL file?

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    Chris KawaC
    @Urbi You seem to be running your app as non UNICODE and passing wide character functions to the WinAPI calls. Either make sure you define UNICODE in your project or explicitly use wide versions of the functions e.g. GetFileVersionInfoSizeW instead of GetFileVersionInfoSize.
  • closeEvent and focus

    Unsolved
    15
    0 Votes
    15 Posts
    2k Views
    Chris KawaC
    @james-b-s Starting an event loop in closeEvent won't work. You're already in an event handler and you need to get back from it for the dialog to function properly. You can do what @JonB said - delay closing until you process your focus loss. For example use a QDialog derived class like this: class MyDialog : public QDialog { bool allowClose = false; public: using QDialog::QDialog; void closeEvent(QCloseEvent* evt) override { if (!allowClose) { evt->ignore(); // don't close and let event loop handle focus loss allowClose = true; // let it close next time setFocus(Qt::OtherFocusReason); // switch focus to something else, e.g. this or cancel button QTimer::singleShot(0, this, &MyDialog::close); // schedule another close event } else { askUserToSaveStuff(); QDialog::closeEvent(evt); } } };
  • QCursor::pos() only works correctly if I change the Qt Creator theme.

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    P
    @Christian-Ehrlicher I disable Wayland in /etc/gdm3/custom.conf and reboot Ubuntu, everything worked correctly. Thanks for the help!
  • getting Qpainter error while settext for qlineEdit(urgent)

    6
    0 Votes
    6 Posts
    465 Views
    Christian EhrlicherC
    @Gokul2002 said in getting Qpainter error while settext for qlineEdit(urgent): If possible is there any other solution please let me know. https://doc.qt.io/qt-6/signalsandslots.html
  • How do I Build this Widget for Automotive Application in GUI

    Solved
    11
    0 Votes
    11 Posts
    948 Views
    M
    @JonB Thank You
  • The incredible shrinking dialogue

    Unsolved
    4
    0 Votes
    4 Posts
    332 Views
    PerdrixP
    Reported as https://bugreports.qt.io/browse/QTBUG-118597
  • Problem with maximised window

    Unsolved
    13
    0 Votes
    13 Posts
    2k Views
    PerdrixP
    Reported under https://bugreports.qt.io/browse/QTBUG-118598
  • Dependent Qt6Widgetsd.lib does not exist

    Unsolved
    9
    0 Votes
    9 Posts
    5k Views
    P
    I had the same problem and these were the trials that unblocked me : Check if you have this file in the mentioned location. I had them as .prl and not as .lib . This is due to the dynamically linked libraries instead of the static ones. If you are facing the same issue, follow this page : https://doc.qt.io/qt-5/windows-deployment.html. This creates the .dlls instead of .prls. The other issue I had was the mismatch of Visual Studio version. I uninstalled Qt after I got the libraries to get a clean start. With the updated MingW version, I did not face any issue. @mysondrink try this if you are still stuck.
  • Question about converting from QGLWidget to QOpenGLWindow

    Unsolved
    2
    0 Votes
    2 Posts
    195 Views
    Christian EhrlicherC
    @rock37 You want QOpenGLWidget, not window I would guess.
  • qt 6.7.0 to 32 bits plataforms

    Unsolved
    14
    0 Votes
    14 Posts
    2k Views
    J
    @ChrisW67 These are the parameters I use to compile to 32 ./configure.bat -platform win32-g++ -release -static -prefix "C:\Qt\6.7.0\mingw_x32_dro_static" -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake tests ...... Is it like that or am I doing something wrong?
  • Why Slot is not getting called when timer is timeout

    Unsolved
    10
    0 Votes
    10 Posts
    786 Views
    N
    @JonB I added a debug point.
  • Qss Slider Question

    Unsolved
    4
    0 Votes
    4 Posts
    562 Views
    JoeCFDJ
    @hunter-Li https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qslider and https://stackoverflow.com/questions/38071131/how-to-adjust-a-qsliders-handle
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    16 Views
    No one has replied
  • How to reconnect signal to slot after object change?

    Unsolved
    2
    0 Votes
    2 Posts
    211 Views
    Christian EhrlicherC
    @Rozerchik said in How to reconnect signal to slot after object change?: So, will it be right like this? Yes
  • QT6 Can't read the OUT parameter from MYSQL Database

    Solved
    6
    0 Votes
    6 Posts
    524 Views
    R
    @Christian-Ehrlicher thank You very much
  • :-1: error: gstreamer-1.0 development package not found

    Solved
    13
    0 Votes
    13 Posts
    3k Views
    V
    @SGaist thank you..
  • Preserve windows 10 style

    Unsolved
    4
    1 Votes
    4 Posts
    407 Views
    S
    @ChrisW67 https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmsetwindowattribute I don't do so much windows dev these days but I seem to recall you could also control this with those manifest files.
  • QTreeView how to support move action?

    Unsolved
    17
    0 Votes
    17 Posts
    1k Views
    S
    @JonB Yes but i can't get it to work by handling the methodes in the model directly. Instead i may gonna do this by accesing the model trough my QTreeView Drag and Drop Events. This seems way easier to me. void ViewLayerList::dragMoveEvent(QDragMoveEvent *event) { QTreeView::dragMoveEvent(event); QModelIndex belowIndex; // Überprüfen Sie die Position des Drop-Indikators QAbstractItemView::DropIndicatorPosition position = dropIndicatorPosition(); // Bestimmen Sie das Aussehen des Drop-Indikators basierend auf seiner Position switch (position) { case QAbstractItemView::AboveItem: case QAbstractItemView::BelowItem: qDebug() << "Drop AboveItem or BelowItem"; DropOnItem = false; // Holen Sie sich den QModelIndex des Elements unterhalb der aktuellen Position belowIndex = indexAt(event->position().toPoint() + QPoint(0, 1)); if (belowIndex.isValid()) { // Holen Sie sich die Zeile des Elements RowBelowDropPositon = belowIndex.row(); qDebug() << "Row of item below: " << RowBelowDropPositon; } //AN AI HIER BEKOMME ICH IMMER EIN VERBOTEN SCHILD UND KANN ES NICHT DROPPEN event->acceptProposedAction(); break; case QAbstractItemView::OnItem: qDebug() << "Drop OnItem"; DropOnItem = true; break; case QAbstractItemView::OnViewport: qDebug() << "Drop OnViewport"; break; } } void ViewLayerList::dropEvent(QDropEvent *event) { if(DropOnItem == false){ } QTreeView::dropEvent(event); } But i don't know if it has many downsides compared to doing this in the model directly. Thats what my question was to @SGaist