Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Opencv video writing

    Solved
    7
    0 Votes
    7 Posts
    892 Views
    SGaistS
    @Vijaykarthikeyan said in Opencv video writing: @SGaist So I have to release the video variable after changing the state recording status to false..isn't it? You have to release them after the thread has stopped writing to the file. So it should rather be: Request recording to stop Emit recording has stopped when done Cleanup in response to that signal
  • Add new objects to an existing form

    Unsolved form editor
    3
    0 Votes
    3 Posts
    447 Views
    Pl45m4P
    @silvio Show the code please. Any chance that the ui file is not used at all or the project overwrites the ui file layout by setting a new one using the widget's code?!
  • Advice on how to implement if possible?

    Unsolved
    1
    0 Votes
    1 Posts
    151 Views
    No one has replied
  • How to make all objects shrinkable in QStatusBar

    Unsolved
    2
    0 Votes
    2 Posts
    157 Views
    JoeCFDJ
    @JackKuo class ResizableWidget : public QWidget { public: ResizableWidget(QWidget *parent = nullptr) : QWidget(parent), resizing(false) {} protected: void mousePressEvent(QMouseEvent *event) override { if (event->button() == Qt::LeftButton) { resizing = true; lastPos = event->globalPos(); } } void mouseMoveEvent(QMouseEvent *event) override { if (resizing) { int deltaX = event->globalX() - lastPos.x(); int deltaY = event->globalY() - lastPos.y(); resize(width() + deltaX, height() + deltaY); lastPos = event->globalPos(); } } void mouseReleaseEvent(QMouseEvent *event) override { Q_UNUSED(event); resizing = false; } void paintEvent(QPaintEvent *event) override { Q_UNUSED(event); QPainter painter(this); painter.fillRect(rect(), Qt::blue); } private: bool resizing; QPoint lastPos; };
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Qt Project in Visual Studio 2022

    Solved
    13
    0 Votes
    13 Posts
    10k Views
    F
    @jsulm I have solved this problem. Firstly, I use Qt vs tools to import my project but I have taken another error. It says "msvc-version.conf loaded but QMAKE_MSC_VER isn't set". Than I open msvc_version.conf file in wordpad to give a version. In this file, it says which version you should use for your visual studio version. I have done this to. After that, I just add my lib files and other environments.
  • How to synchronize files from linux to windows

    Unsolved
    14
    0 Votes
    14 Posts
    3k Views
    Axel SpoerlA
    @Srinath_S To summarize: This thread says "How to synchronize files from linux to windows". The answer is: With rsync, mutagen, scp, samba or any similar tool. The actual intention is to implement a remote file browser. That's way more complex, Dolphin can be an aspiration.
  • How to remove this extra border from Qt::FramelessWindowHint

    Locked Unsolved
    2
    0 Votes
    2 Posts
    258 Views
    Christian EhrlicherC
    @Krpadia123 Wouldn't it be easier to answer the question in the exact same thread instead simply opening a new one? https://forum.qt.io/topic/152108
  • (QWebEngineView )Passing argument values ​​to js function and drawing on canvas

    Unsolved
    7
    0 Votes
    7 Posts
    604 Views
    M
    @JonB I understand it. thank you so much. :)
  • Unable to build qtnetwork 5.15.11 due to invalid SSL

    Unsolved
    4
    0 Votes
    4 Posts
    774 Views
    A
    ok issue was resolved in https://forums.gentoo.org/viewtopic-p-8807781.html#8807781
  • Make QLineEdit query QCompleter again

    Unsolved
    2
    0 Votes
    2 Posts
    305 Views
    JonBJ
    @Stephan-Lorenzen I don't claim to understand entirely, and I have not even used a QCompleter, but in 2009(!) https://stackoverflow.com/questions/1927289/how-to-update-qcompleters-model-dynamically said It seems that the model should be set before QLineEdit emits textChanged signal. One way is to reimplement keyPressEvent, but it involves many conditions to get QLineEdit's text. and the OP claimed to answer his own question with Oh, I have found the answer: Use signal textEdited instead of textChanged. Debuging QT's source code told me the answer. Does this help any?
  • Why is the display of a top-level transparent window slower?

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    Q
    @Christian-Ehrlicher Let m_widget show() when initialize fix it. top level widget seems neet time to show at first time.
  • Creating widgets in "another" thread...

    Unsolved qthread qeventloop qwidget parent
    19
    0 Votes
    19 Posts
    12k Views
    Christian EhrlicherC
    @nintyfan said in Creating widgets in "another" thread...: Signal is not solution, because QApplication::exec could not been called yet So how do you show the push button then? Your design looks flawed.
  • QSqlError("", "Driver not loaded", "Driver not loaded")

    Unsolved
    2
    0 Votes
    2 Posts
    209 Views
    C
    @yato said in QSqlError("", "Driver not loaded", "Driver not loaded"): alguém poderia me ajudar com esse problema? sempre recebo essa mensagem no output The Qt PostgreSQL plugin is present but cannot load. This is probably because the PostgreSQL runtime libraries (DLLs) are not installed, or not in the same location as your program executable or on the system PATH.
  • Layout question

    Solved
    3
    0 Votes
    3 Posts
    282 Views
    DriftwoodD
    @Pl45m4 - Thank you for your spot-on response. I now see that the first QSizePolicy is for horizontal (width) and the second one is for the vertical (height), all of which is clearly laid out in the help files, QSpacerItem::QSpacerItem(int w, int h, QSizePolicy::Policy hPolicy = QSizePolicy::Minimum, QSizePolicy::Policy vPolicy = QSizePolicy::Minimum) stuff I was too blind to see last night =) Thank you for your help.
  • 0 Votes
    11 Posts
    2k Views
    S
    @ChrisW67 The cert was ok. The problem was in configuration function see hereunder: was httpServer.sslSetup(sslCertificateChain.front(), QSslKey(&privateKeyFile, QSsl::RSA ), QSsl::TlsV1_0OrLater); working config. httpServer.sslSetup(sslCertificateChain.front(), QSslKey(&privateKeyFile, QSsl::Ec, ), QSsl::TlsV1_0OrLater); So I alter QSsl:RSA to QSsl::Ec - this thanks to Let's Encrypt community forum.
  • Clear QTreeView selection when focus is outside its geometry

    Unsolved
    2
    0 Votes
    2 Posts
    232 Views
    L
    Came up with the following hack to identify when a delegate QComboBox gets focus: auto app = static_cast<QApplication *>(QApplication::instance()); connect(app, &QApplication::focusChanged, [=](QWidget *old, QWidget *now) { auto newTypeStr = now->metaObject()->className(); auto isComboBox = QString{newTypeStr} == QString{"QComboBoxListView"}; if (now && !this->isAncestorOf(now) && !isComboBox) { clearSelection(); } }); This works for my purposes but there's probably a less hacky way to do this.
  • Why do we use -L and l preceeding .pro file lines

    Unsolved
    2
    0 Votes
    2 Posts
    187 Views
    Chris KawaC
    @JacobNovitsky L in C++ code has nothing to do with L in pro files. LIBS variable specifies the arguments passed to the linker invocation. The -L parameter specifies a directory to look for linked libraries and -l specifies a library name to look for in that directory, so a line like LIBS += -LSomeDir/SomeSubdir/ -lsome means "Look for library libsome in directory SomeDir/SomeSubdir/ and link it". See your linker documentation for more detailed explanation e.g. this one for the gnu linker.
  • qtConfig in qt 6,how it works?

    Solved
    3
    0 Votes
    3 Posts
    724 Views
    B
    @ChrisW67 wow,thank you very much. "qtHaveModule() and qtConfig() are defined in .../mkspecs/features/qt_functions.prf." this helps me so much. emm ,thank you for spending time on me again.
  • external library

    Solved
    4
    0 Votes
    4 Posts
    351 Views
    D
    Ok I found the problem. It turns out that there is a library libmodbus-5.dl.a which is strangely located in the /bin directory . So I added this directory /bin in the PATH, and now it works fine. Thank you very much for your help SGaist !