Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • How to read data in questDB with QT application?

    Unsolved
    9
    0 Votes
    9 Posts
    969 Views
    JianJianJ
    @newKid can you show the code how to made it, i have the same condition, use quesdb in qt application,tks
  • get milliseconds from QTimeEdit

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    E
    Hi Chris, maybe I'm completely wrong. I think my problem is a different one. I grab the time value in a keyPressEvent loop. SO you enter the last number and press then Enter or Return. But the QTimeEdit didn't recognize the last entered number yet. if(event->key() == Qt::Key_Return|| event->key() == Qt::Key_Enter||event->key() == Qt::Key_Tab) { ... } If I put in if(event->key() == Qt::Key_Return|| event->key() == Qt::Key_Enter||event->key() == Qt::Key_Tab) { QTimeEdit::keyPressEvent(event); ... } I get the correct results. Thanks for your support. Without, I couldn't figure out my mistake.
  • After upgrading to Win11, compiling project is failed.

    Solved
    3
    0 Votes
    3 Posts
    270 Views
    W
    @Christian-Ehrlicher Thank you for your reply. After trying, this issue is solved. Have a nice day.
  • Qt5Test.dll error After Deployment of OpenCV application

    Unsolved
    4
    0 Votes
    4 Posts
    420 Views
    Christian EhrlicherC
    If you would not use anything from QTest library then windows would not ask for it. Maybe look with Dependency Walker to see where it comes from.
  • 0 Votes
    9 Posts
    562 Views
    Christian EhrlicherC
    @Crag_Hack Yes
  • Resizing QLineEdit in a QGridLayout

    Solved
    18
    0 Votes
    18 Posts
    4k Views
    S
    After some experimentation, I've finally got the "ideal" solution: If you want to use colspan and rowspan in the same way I'm looking for, then every row and column that is stretched through must have a stretch set to 1. Final code: QWidget *widget = new QWidget; setCentralWidget(widget); QLineEdit *edit = new QLineEdit("Test"); QLineEdit *edit2 = new QLineEdit("Test2"); QLineEdit *edit3 = new QLineEdit("Test3"); QLineEdit *edit4 = new QLineEdit("Test4"); QGridLayout *layout = new QGridLayout(widget); layout->setColumnStretch(0, 1); layout->setColumnStretch(1, 1); layout->setColumnStretch(2, 1); layout->setRowStretch(0, 1); layout->setRowStretch(1, 1); layout->setRowStretch(2, 1); layout->addWidget(edit, 0, 0, 2, 2); layout->addWidget(edit2, 0, 2, 1, 1); layout->addWidget(edit3, 2, 0, 1, 1); layout->addWidget(edit4, 2, 1, 1, 2); edit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); edit2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); edit3->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); edit4->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); Results in: [image: 5bff5352-35d9-4832-bb3e-d1d1e3213f9a.png] Before I had assumed that the default stretch of every widget in a layout was 1, but nope. This, however, fixes it. Also ensure that every column and row that is spanned at all is stretched (i.e. column 0 with span 2 = 0 and 1 need to be stretched to 1).
  • CDialog::Create failing.

    Solved
    2
    0 Votes
    2 Posts
    242 Views
    PerdrixP
    Changing the dialogue definition changing WS_CHILD to WS_POPUP appears to fix it. IDD_PROCESSING DIALOGEX 0, 0, 438, 332 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_POPUP FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN CONTROL "",IDC_PICTURE,"Static",SS_BLACKFRAME | SS_SUNKEN,6,28,427,148 LTEXT "Histo",IDC_ORIGINAL_HISTOGRAM,177,186,256,140,SS_SUNKEN LTEXT "Settings",IDC_SETTINGS,6,189,167,137,NOT WS_VISIBLE,WS_EX_STATICEDGE LTEXT "",IDC_INFO,6,6,427,16,0,WS_EX_TRANSPARENT CONTROL "",IDC_PROCESSING_PROGRESS,"msctls_progress32",PBS_SMOOTH,6,176,427,4 END David
  • Why does ${Qt6Core_INCLUDE_DIRS} contain Qt6::ZlibPrivate?

    Unsolved
    2
    0 Votes
    2 Posts
    647 Views
    C
    @Gertio said in Why does ${Qt6Core_INCLUDE_DIRS} contain Qt6::ZlibPrivate?: the following CMake minimal example configuration fails: Where did this come from? What are you trying to build? Why does ${Qt6Core_INCLUDE_DIRS} contain Qt6::ZlibPrivate? Qt6, by default, is built with a private copy of Zlib and some other libraries.
  • QMediaRecorder::record() delay on Windows

    Unsolved multimedia recording audio qmediarecorder
    11
    0 Votes
    11 Posts
    2k Views
    S
    @SGaist That is correct. The same application tested on different Windows machines presents exactly the same behavior.
  • How to Set the Hiding and Displaying of QScrollBar through QSS Statements

    Solved
    4
    0 Votes
    4 Posts
    361 Views
    X
    @Axel-Spoerl Thank you first! I use QScrollBar in QScrollArea. I think it is difficult to get capture the mouse leave or enter enevt in this case.
  • Load internet image into QWidget...

    Unsolved
    2
    0 Votes
    2 Posts
    241 Views
    sierdzioS
    @1XU7 said in Load internet image into QWidget...: I'm using QFrame to store image via stylesheet. Why? Just use QLabel, you can set it to display image instead of text with this property: https://doc.qt.io/qt-6/qlabel.html#pixmap-prop Image can come from the network, sure, you'll just need to download it.
  • This topic is deleted!

    Unsolved
    5
    0 Votes
    5 Posts
    112 Views
  • Problems using QUdpSocket

    Unsolved
    2
    0 Votes
    2 Posts
    123 Views
    Christian EhrlicherC
    Please provide some code on what you are doing. Also note that there is an example on how to use the QUdpSocket in the documentation which you should try out.
  • How to create rounded corners for GIF images.

    Unsolved
    6
    0 Votes
    6 Posts
    897 Views
    Q
    @Pl45m4 Thanks for your reply! I found that if it was a GIF, I would also need to rewrite the paintEvent function to draw each frame in the same way I did earlier.
  • 0 Votes
    7 Posts
    453 Views
    Q
    @jsulm I see. Thank you for your reply.
  • Trying to redirect input from a QInputDialog to a std::cin

    Solved
    6
    0 Votes
    6 Posts
    387 Views
    ?
    Yeah with future programs, I'll build it from the ground up better so as to avoid having to do funny business)). It's possible. Got it working. Found it easier to work with a pointer to a DialogInput than std::cin though.Followed this process: Show Dialog. Dialog gives back string. Pipe the string through stringstream. Write it to the variable Program I'm making is open source so can PM me if interested in looking at the source code
  • Preserving/Restoring QDockWidget size

    Unsolved
    27
    0 Votes
    27 Posts
    4k Views
    Axel SpoerlA
    @JonB Fully agree. QSettings deserves some love for sure.
  • QT Creator keeps crashing when run

    Unsolved
    6
    0 Votes
    6 Posts
    651 Views
    SGaistS
    @jakemaggieronan glad you found out and thanks for the feed back ! Please mark the thread as solved since all is working now.
  • Another dock widget problem

    Unsolved
    4
    0 Votes
    4 Posts
    270 Views
    Axel SpoerlA
    @Perdrix Agree! Pleasing everybody can make things messy at times ;-)
  • how to send c/c++ compiler errors to a text file compiling from Qt Creator

    Unsolved
    2
    0 Votes
    2 Posts
    444 Views
    C
    @JacobNovitsky You don't. $ cd /tmp/build-untitled-Desktop_Qt_6_6_0_GCC_64bit-Debug $ qmake ../untitled/untitled.pro $ make 2>&1 | tee compile.log ... normal compile output $ cat compile.log ... same output captured or, if you do not also want the output on the console: make > compile.log 2>&1 BTW: I do not understand why you think you need this. You can copy and paste from the Compiler Output pane in Qt Creator if you really need the output in a file.