Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Qt Development QLineEdit Cursor Color

    Unsolved
    2
    0 Votes
    2 Posts
    47 Views
    HansonH
    @byrAlpha Hi, You can try this. https://stackoverflow.com/questions/68769475/how-to-set-the-color-of-caret-blinking-cursor-in-qlineedit
  • How to know user select item by mouse move?

    Solved
    4
    0 Votes
    4 Posts
    91 Views
    qazaq408Q
    @JonB THAKN YOU! You save me !
  • Transitioning from QGLWidget to QOpenGLWidget issue.

    Unsolved opengl
    6
    0 Votes
    6 Posts
    107 Views
    D
    I have gotten a new sample from the library vendor, and it does use paintGL. We were working off a sample from 12 years ago as our base and apparently they have updated a lot since then. I am trying to fit their new implementation in and see how it works. Thanks for the feedback
  • Expand Activeqt comapp example to separate classes from main.cpp

    Solved forum
    13
    0 Votes
    13 Posts
    321 Views
    JonBJ
    @AliQT FWIW I included a CMakeLists.txt which should work (again, inside it a couple of lines for ActiveX need uncommenting) as an alternative to .pro/qmake. Most people use cmake with Qt6, but .pro/qmake is still supported if you prefer. Just check the other code does not require Qt5, else you won't be able to use the Q_MOC_INCLUDE() it now relies on.
  • [SOLVED] QScrollArea: Vertical scroll only.

    13
    0 Votes
    13 Posts
    38k Views
    S
    Thank you for the tip; I'm using Python, so I rewrote like this, and it works: class VerticalScrollArea(QtWidgets.QScrollArea): def __init__(self): super().__init__() self.setWidgetResizable(True) self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) def eventFilter(self, object, event): # This works because QScrollArea::setWidget installs an eventFilter on the widget if object is not None and object == self and event.type() == QEvent.Resize: self.setMinimumWidth(self.minimumSizeHint().width() + self.verticalScrollBar.width()) return super().eventFilter(object, event)
  • 0 Votes
    2 Posts
    126 Views
    semlanikS
    Hi @Ben-Campbell-Wallis, sorry for the delayed response. If you use vcpkg protobuf installation please make sure that the vcpkg tripplet binary directory is in PATH when you build your project. I expect that it should be something like "C:/Projects/_clientserverpoc/smappoc-gl-client-grpc/build/Desktop_Qt_6_9_1_MSVC2022_64bit-FromSrc-Debug/vcpkg_installed/x64-windows/bin" in your layout. It should help, but we probably need to think about setting it automatically. Qt delivers packages where protoc plugins are build statically, so you don't face missing dependency issues.
  • [SOLVED]QToolBox wihout scrollbars

    8
    0 Votes
    8 Posts
    6k Views
    A
    for (int i = 0; i < count(); ++i) { QWidget *viewport = widget(i)->parentWidget();//viewport qDebug() << viewport->metaObject()->className(); QScrollArea *scrollArea = qobject_cast<QScrollArea*>(viewport->parentWidget()); qDebug() << scrollArea->metaObject()->className(); Q_CHECK_PTR (scrollArea); scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOff); scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOff); }
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Strange QSettings issue with Qt6 on Jenkins

    Unsolved
    13
    0 Votes
    13 Posts
    381 Views
    Christian EhrlicherC
    This is for sure no compiler issue. More an access problem due to a virus scanner or tests running simultaneously.
  • 0 Votes
    7 Posts
    160 Views
    V
    @JonB Oh, right. I just did and it worked. I was tried to change CalibrationMaterial::updateTextures(QRhi *rhi, QRhiResourceUpdateBatch *resourceUpdates) to void CalibrationMaterial::updateTextures(QRhi &rhi, QRhiResourceUpdateBatch *resourceUpdates) so many other issues occured and I tried to fix them. But wit just *rhi, it solved.
  • Setting up Ffmpeg for QT

    Solved
    5
    0 Votes
    5 Posts
    192 Views
    V
    It seems like some .dll files was missing. I ran the debug log and it said the libwinpthread-1.dll was missing. So I copied it to the mingw64/bin/ folder and then it worked. It didn't say missing that .dll file when I run it normally but only when run by debug log
  • when using the qml occured the errors.couldnt find the wrong code line.

    Unsolved
    2
    0 Votes
    2 Posts
    72 Views
    jsulmJ
    @nicker-player said in when using the qml occured the errors.couldnt find the wrong code line.: so how to find the wrong place.any good ideas? Do you use QPainter somewhere? You seem to make screen-shots - I would start there. You can also remove functionality step by step until it does not crash anymore then you know where it happens. Also, debugger is the usual tool to investigate problems...
  • 0 Votes
    8 Posts
    205 Views
    l3u_L
    Well, this would be a possible workaround, but it neither explains nor solves the underlying problem …
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Debug of real time dependent app

    Unsolved real time debug
    7
    0 Votes
    7 Posts
    192 Views
    Kent-DorfmanK
    Correct. You cannot simulate that level of fidelity in realtime using win/linux/Qt. You would need to drastically lower your iterative frequency and maybe interpolate intermediate values. Otherwise, Do as I mention and use a synthetic timer that has no ties to realtime. As a safety margin on generic desktop systems don't do timers or trigger timed events at periods less than about 50ms (or 20hz). That broadly covers lower HZ values and "usually" handles scheduler noise. Remember that the Qt timers are more for UI responsiveness than tracking high precision events.
  • Qt 6: can't create working local QEventLoop while handling aboutToQuit()

    Solved
    3
    0 Votes
    3 Posts
    119 Views
    B
    @hskoglund I think this may be the only way to go, especially if the result of the thread interaction requires any sort of GUI (posting error messages, etc.). It does seem that aboutToQuit() is too late in the sequence. Evidence, after some exploration: My problem was caused by a change in Qt 6.5.0 (link) that moved the signaling point from QCoreApplication::execCleanup() (which explicitly turns off the quitNow flag) to exit() (which doesn't). That flag is what prevents a local QEventLoop in my slot handler from spinning up. It's not clear if they meant to do that, but... That change refers to a bug report (link). A comment by the maintainer says, "The docs for aboutToQuit specify 'Note that no user interaction is possible in this state.'" And indeed they do (link).
  • Changing the taskbar icon

    Unsolved
    4
    0 Votes
    4 Posts
    180 Views
    JonBJ
    @TolleTafel You need to set one or both of QApplication::setWindowIcon() and QWindow::setIcon(). See also https://doc.qt.io/qt-6/appicon.html. If by any chance you mean change the icon for every Python script, nothing to do with Qt or your applications, that would be by changing the icon for python.exe.
  • Obtaining MetaData from mp3 files

    Solved
    11
    0 Votes
    11 Posts
    324 Views
    D
    Sooooo, QMediaMetaData tmp = m_mp->metaData(); m_singers = tmp.value(QMediaMetaData::ContributingArtist).toString(); m_title = tmp.value(QMediaMetaData::Title).toString(); m_album = tmp.value(QMediaMetaData::AlbumTitle).toString(); m_duration = tmp.value(QMediaMetaData::Duration).toULongLong(); qDebug() << "Path:" << m_path; qDebug() << "Singers:" << m_singers; qDebug() << "Title:" << m_title; qDebug() << "Album:" << m_album; Works Fine !
  • UB or not

    Unsolved
    9
    0 Votes
    9 Posts
    514 Views
    Christian EhrlicherC
    @DmitryTS said in UB or not: a constant reference extend the life of this temporary object or not? I already answered it...
  • How to find which axis has been clicked on a QChartView

    Unsolved
    6
    0 Votes
    6 Posts
    152 Views
    JonBJ
    @kehr_I You have my sympathies. QtCharts was a bit "dodgy" at times. Whether we like it or not it is going away, to be replaced by QtGraphs. I too have zero desire to use anything QML in my code (widgets). I believe it is "supposed" to be callable from widgets app --- presumably all QML/QtQuick stuff to support it will now have to be bundled with widgets app for deployment --- but I have a feeling there was a recent post saying the API "is not available"(?) from widgets, as of the present time at least. It might have said it works for 3D but not 2D. Ah, have a read of https://forum.qt.io/topic/159224/qt-graphs-building-2d-plot-using-c-only