Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • QSqlTableModel::setFilter and sql injection

    Unsolved
    2
    0 Votes
    2 Posts
    232 Views
    Christian EhrlicherC
    @Seb-Tur said in QSqlTableModel::setFilter and sql injection: Is the setFilter() argument taken directly to WHERE clause Yes, see https://code.qt.io/cgit/qt/qtbase.git/tree/src/sql/models/qsqltablemodel.cpp#n978 or is there some kind of SQL injection protection? no If not... what would be the easiest way to have this protection? Do not let the user pass a value to this function or write a fool-proof function to avoid sql injection (I would not try it).
  • Trying to use QT from DLL in simple console project but it doesn't work

    Solved
    14
    0 Votes
    14 Posts
    987 Views
    J
    @JonB OPS. forget about it:D The main problem wasn't in QApplication as I thought initially. QUiLoader didn't want to work and showed an error that there was no access to the address. So i created QApplication and QUiLoader in console project and then transfer pointer to library. I still have a question why QCoreApplication::applicationDirPath(); is ok but quiLoader->addPluginPath(qstr); which calls QApplication, is not ok... Simple Console Project: int main(int argc, char* argv[]) { std::shared_ptr<QtUIEditorDLL> ptrQtUIEditorDLL(new QtUIEditorDLL(argc, argv)); // you can use it without any ptr. QtUIEditorDLL* test = ptrQtUIEditorDLL.get(); QUiLoader* quiLoader = new QUiLoader(); // as i can see it must be created in the same tread near QApp. Jsulm said that it not important...but it doesn't work if create it in DLL. test->Init(quiLoader); } And the library: QtUIEditorDLL::QtUIEditorDLL(int& argc, char** argv) :QApplication(argc,argv){} void QtUIEditorDLL::Init(QUiLoader* quiLoader) { QString qstr = QCoreApplication::applicationDirPath(); quiLoader->addPluginPath(qstr); //And it works. }
  • SSL issues after upgrading Ubuntu

    Unsolved
    17
    2 Votes
    17 Posts
    5k Views
    J
    @crashlog I'm having the same problem with Qt 5.15, and I creared a bug report here but I'm not quite sure what the resolution is yet: https://bugreports.qt.io/browse/QTBUG-115146
  • Dimensions Of QHeaderView

    Solved
    4
    0 Votes
    4 Posts
    192 Views
    jsulmJ
    @Abhi_Varma And what is the problem? treeView->header()->geometry();
  • This topic is deleted!

    Solved
    3
    0 Votes
    3 Posts
    4 Views
  • 0 Votes
    4 Posts
    1k Views
    SGaistS
    You shouldn't need to do that when starting from Qt Creator after a clean build.
  • QSystemTrayIcon disappears on UBuntu 20.04/22.04 after reboot

    Unsolved
    2
    0 Votes
    2 Posts
    189 Views
    SGaistS
    Hi, Did you check that the pixmap is created successfully on these platform ? On a side note, there's no need to created your QPixmap object on the heap.
  • get Wifi SSID with QT 6.5

    Unsolved
    5
    0 Votes
    5 Posts
    845 Views
    V
    QNetworkSettingsManager is part of Qt Device and : Qt Device Utilities C++ Classes Qt Device Utilities modules provide classes that are useful for embedded applications.
  • QComboBox::showpopup stealing focus completely

    Solved
    5
    0 Votes
    5 Posts
    425 Views
    T
    @JonB My objective was having a custom dropdown that has a starting position from the center of the QComboBox I thought originally there is no way to move the dropdown anywhere (I was trying that by moving the QListView since I didn't know there was a frame I could move) So my workaround was : instanciating 2 custom dropdowns and positionning em to look like one dropdown and just connecting the slots etc.. However, it seems that overriding the showPopup to let both popups the original one and the copy which is placed on top of the combobox receive events was somehow impossible because I don't understand how that method blocks/let the mouse events pass here or there. However, now since I was able to move the original dropdown by finding the frame on the QComboBox and moving it, there is no need anymore for this workaround and I reached my objective Thank you for triggering my brain to rethink about a thread I passed by in stackoverflow which showed the trick to move the dropdown simply without getting it clipped. link for anyone who needs it : https://stackoverflow.com/questions/10057140/how-to-make-qcombobox-popup-upwards
  • changing height of Qtablewidget Cells

    Unsolved qtablewidget qsizepolicy qt6.5.0 qlayout size
    5
    0 Votes
    5 Posts
    1k Views
    NarutoblazeN
    @mpergand Did not worked : setSectionResizeMode(QHeaderView::Fixed); setDefaultSectionSize(10);
  • How to maintain the current index of QTableView

    Solved
    3
    0 Votes
    3 Posts
    220 Views
    tovaxT
    @Christian-Ehrlicher Thank you for your reply. With your reminder, I found the cause of the error after checking: duplicate construction of a singleton class. Best Regards!
  • Sending message to choosen client

    Unsolved
    25
    0 Votes
    25 Posts
    3k Views
    G
    @apoyo One addition, if it works, it may be useful to use a telnet client program to try to connect to the server and send commands to it.
  • Unwanted empty space in expanded QTreeView items.

    Unsolved
    2
    0 Votes
    2 Posts
    222 Views
    Christian EhrlicherC
    Please provide a minimal, compilable example - normally QTreeView does not show this behavior. Also remove all stylesheets and other stuff from the treeview to see if this triggers this strange behavior. What exact Qt version do you use?
  • Can't plot any figure-UBUNTU 22.04 LTS

    Unsolved
    2
    0 Votes
    2 Posts
    918 Views
    JonBJ
    @AKAB This message comes up many times if you search this forum or Google. The answer every time is to export QT_DEBUG_PLUGINS=1 in a shell and then run your executable. Look at the end of the diagnostic output from the reason for xcb failure.
  • QProcess is blocking UI and destroyed while app running

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    K
    It seems that the problem is somewhere in my app, it is currently not clear where but minimal example I was trying to prepare to share here is working as expected. However full app does not work and I cannot even stop the code to see where it is stuck :-( EDIT: rootcause found - another timer was calling the same executable but with waiting for result. This was causing problem as the second process was waiting for the first to complete (this is limitation of the executable I am running).
  • running qt application on 32 bit OS

    Solved
    3
    0 Votes
    3 Posts
    183 Views
    V
    @sierdzio Thanks bro
  • QCloseEvent wait for a function to terminate

    Unsolved
    3
    0 Votes
    3 Posts
    268 Views
    Axel SpoerlA
    I haven't compiled and tested the application, but adding to what @JonB wrote: There is a lot of heavy lifting with blocking code. Even though events are processed in blocking loops, UI reactions may be hampered. Recommend to sit back, check what needs to be done, which signals flag intermediate results.
  • Add mp4 video

    Unsolved
    9
    0 Votes
    9 Posts
    532 Views
    Y
    Please try on .avi file. .mp4 file is not support for windows. kindly load .avi file. Then the video will play. Like, QUrl videoUrl = QUrl::fromLocalFile("‪C:/Users/Desktop/video.avi");
  • QAccel is not found in my Qt Library

    Unsolved
    3
    0 Votes
    3 Posts
    228 Views
    D
    @Christian-Ehrlicher Thank you Christian
  • confused while reading Qt Document

    Unsolved
    2
    0 Votes
    2 Posts
    224 Views
    C
    @jgxy1123 A quick look at the source code would indicate that the newConnection() and pendingConnectionAvailable() signals come after the connection is queued.