Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • QAbstractSocket::KeepAliveOption not work on Windows10

    Unsolved
    2
    0 Votes
    2 Posts
    230 Views
    Christian EhrlicherC
    @Mozzie Windows Runtime = WindowsRT, not Windows. And in Qt6 the documentation is more specific: "Note: Since the options are set on an internal socket the options only apply if the socket has been created. This is only guaranteed to have happened after a call to bind(), or when connected() has been emitted."
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • How to draw rectangle with all corners rounded ?

    Unsolved
    31
    0 Votes
    31 Posts
    10k Views
    JoeCFDJ
    @tushu That means you do not use right click to select your widget. I do not know if it is a good idea to add right click to this feature. If you want to add it, you have to override mouse event to catch mouse right click and then set selected to be true.
  • 0 Votes
    8 Posts
    503 Views
    J
    @Abderrahmene_Rayene In mouseMoveEvent,when the cursor close to edge of A I grabMouse to ensure the QMouseEvent will be received ,otherwise releaseMouse. https://doc.qt.io/qt-6/qwidget.html#grabMouse
  • #define to distinguish between widget and console app

    Solved
    3
    0 Votes
    3 Posts
    351 Views
    M
    @JonB said in #define to distinguish between widget and console app: If you are using qmake/.pro file and it has QT += widgets in it then see if QT_WIDGETS_LIB is defined? If you have QT += gui, then see if QT_GUI_LIB is defined? I am not sure about these. Thx JonB, that's what i needed.
  • Convert GMT DateTime to local

    Unsolved
    3
    0 Votes
    3 Posts
    307 Views
    C
    This may get an actual date object to work with: QDateTime date = QDateTime::fromString("Mon, 27 Mar 2023 07:06:09 GMT", Qt::RFC2822Date); A little unclear if "GMT" is acceptable. If not, do a string substitution "GMT" => "+0000" first.
  • same problem but QPSQL DRIVER NOT LOADED

    Solved
    27
    0 Votes
    27 Posts
    4k Views
    1
    @SGaist Thank you
  • Copying and rotating a polygon

    Unsolved
    4
    0 Votes
    4 Posts
    371 Views
    JoeCFDJ
    @serebryakov https://stackoverflow.com/questions/8586088/rotate-rectangle-around-its-center https://stackoverflow.com/questions/46179769/qt-rotating-shapes
  • How to set a custom style into the QScrollBar of a QScrollArea?

    Unsolved
    20
    1 Votes
    20 Posts
    2k Views
    C
    @Cesar Btw you said you're setting style for the vertical scroll bar, but your code is handling horizontal bar style.
  • HOW TO SEND EMAIL VIA QT 5.9.9

    Unsolved
    2
    0 Votes
    2 Posts
    228 Views
    JonBJ
    @AM3NN Just as per the error messages, which version of OpenSSL did you install/are you using?
  • Not work Video stream

    Unsolved
    11
    0 Votes
    11 Posts
    760 Views
    JoeCFDJ
    @Mihaill Of course. I use Qt5 + Qt Gstreamer + gstreamer to do it. Unluckily, Qt gstreamer is not maintained anymore. It has a few leaks as well. But you can use qml sink + qml GUI + gstreamer to stream. I guess you can also feed a gstreamer pipeline into qt multimedia for streaming. However, it is not flexible for you to manipulate your pipeline. I have not tried Qt6 for streaming. Qt6 may be more FFmpeg oriented. Do your research. If h264 codec does not work on Windows, you need a tool to check if it is available. I know how to check it on Linux, but do not know how to do it on Windows.
  • This topic is deleted!

    Solved
    5
    0 Votes
    5 Posts
    20 Views
  • assign value from combobox to string

    Solved
    6
    0 Votes
    6 Posts
    486 Views
    M
    @Bonnie Yes! that was it. Thank you both!
  • Not capturing hidden rows in QTableWidget

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    C
    @leinad I'm trying to replicate what you have on my end, can I just fill my tableWidget with random text?
  • QML MediaPlayer. Custom source for gst-pipeline

    Unsolved
    20
    0 Votes
    20 Posts
    5k Views
    S
    @SGaist Hello, could you refer me to this Gstreamer plugin package? I'm trying the following qml: MediaPlayer{ id: playVideo source: "gst-pipeline: videotestsrc ! autovideosink" videoOutput: videoOutput } VideoOutput{ id: videoOutput anchors.fill: parent } But as soon as the component is loaded I get this message: qt.multimedia.player: Unable to set the pipeline to the paused state. And I cannot visualize the pipeline. I tried using a generic video as source in the MediaPlayer component instead of a pipeline and it works.
  • qwt with qt6

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    F
    @ChrisW67 HI, Qt is 6.4.2, and Qwt is 6.2. that guide you provided is nothing but talks about mac and other kind of installation and configuration, however, i would need for ubuntu 20.04 linux distribution. Thanks again. can you guide me gently??@ChrisW67
  • Application frozen by unix signal

    Unsolved
    6
    0 Votes
    6 Posts
    444 Views
    tovaxT
    @JonB Thank you very much for your suggestion. You have guided me through many valuable tests, leading to the discovery of useful information.
  • QTimer doesn't stop on calling stop()

    Unsolved qtimer crash
    11
    0 Votes
    11 Posts
    3k Views
    S
    @Axel-Spoerl The issue was with my build setup. After a clean build the debugger started behaving properly and I was able to resolve the crash.
  • How to resolve below type of crash issue for QT/QML Application on linux ?

    Solved
    21
    0 Votes
    21 Posts
    5k Views
    Q
    @jsulm Thanks we have resolve this type of crash by using mutex. And yes we use same this error list from 2 thread. and that's why this code cause the crash.
  • Error: undefined reference to `cvReleaseImage' (opencv + Qt)

    Moved
    36
    0 Votes
    36 Posts
    22k Views
    D
    @RodMckay said in Error: undefined reference to `cvReleaseImage' (opencv + Qt): I try to write a simple image viewer program by using opencv int Qt5.1 the problem is that Qt5.1 shows me the error in runtime , where am I wrong ? .pro @ #------------------------------------------------- Project created by QtCreator 2013-09-11T03:55:37 #------------------------------------------------- QT += core QT -= gui TARGET = camera_onConsole CONFIG += console CONFIG -= app_bundle TEMPLATE = app INCLUDEPATH += D:\opencv\build\include LIBS += -lopencv_highgui246 -lopencv_imgproc246 -lopencv_objdetect246 SOURCES += main.cpp @ .cpp @ #include <QCoreApplication> #include "opencv/cv.h" #include "opencv/highgui.h" #include <opencv/cxcore.h> int main(int argc, char argv[]) { QCoreApplication a(argc, argv); IplImage img = cvLoadImage("D:/image.jpg"); cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE ); cvShowImage("Example1", img); cvWaitKey(0); cvReleaseImage(&img); cvDestroyWindow( "Example1" ); return a.exec(); } @ is there anyone who knows solution of this ? thanks for replies The error in the runtime could be due to various reasons, and it would be helpful if you could provide more information about the specific error message or behavior that you are encountering. However, based on the code that you have provided, there are a few issues that might be causing the problem: The Qt project file (.pro) is missing the inclusion of the "widgets" module, which is required for creating GUI applications. You can add it by modifying the "QT" line in your .pro file to: QT += core widgets The OpenCV library that you are linking to is version 2.4.6, which might not be compatible with the version of Qt that you are using (Qt 5.1). You could try linking to a more recent version of OpenCV (e.g., 4.x), or using an older version of Qt that is compatible with OpenCV 2.4.6. The use of the "IplImage" data type is deprecated in newer versions of OpenCV, and you might encounter compatibility issues when using it with Qt. You could try using the newer "cv::Mat" data type instead, which is recommended for working with images in OpenCV. Here is a modified version of your code that addresses these issues: .pro @ #------------------------------------------------- Project created by QtCreator 2013-09-11T03:55:37 #------------------------------------------------- QT += core widgets TARGET = camera_onConsole CONFIG += console CONFIG -= app_bundle TEMPLATE = app INCLUDEPATH += D:\opencv\build\include LIBS += -lopencv_highgui -lopencv_imgproc -lopencv_objdetect SOURCES += main.cpp @ .cpp @ #include <QCoreApplication> #include <opencv2/core.hpp> #include <opencv2/highgui.hpp> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); cv::Mat img = cv::imread("D:/image.jpg"); cv::namedWindow("Example1", cv::WINDOW_AUTOSIZE); cv::imshow("Example1", img); cv::waitKey(0); cv::destroyWindow("Example1"); return a.exec(); } @ Note that this code uses the newer "cv::Mat" data type instead of "IplImage", and also uses the updated function names for creating and destroying windows in OpenCV.