Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Unexpected crash in QCoreApplicationPrivate::lockThreadPostEventList

    Unsolved
    1
    0 Votes
    1 Posts
    260 Views
    No one has replied
  • Window cannot shrink after expanding

    Unsolved
    3
    0 Votes
    3 Posts
    315 Views
    E
    @Pl45m4 said in Window cannot shrink after expanding: In the first place, why you set the image on every resizeEvent? This was the only way I could find to make the label's contents be resized to fit the window. The images I'm displaying are quite hi-res TIFFs, and at native resolution they can't fit on my 1080p monitor. I assume there's a better way to do this, but I couldn't find one. Horizontally? Vertically? Or both? Both. Here's a video of the behavior: https://youtu.be/pe7nOlxXKcA And here's the configuration of another window exhibiting the same behavior [image: 0ba88c8a-50ae-4f23-afdb-4d1e08850cc6.png] [image: 840db8d5-288a-4889-816a-ffe3ff9438e8.png] This is the full form file of that window, in case that's helpful: <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>PointSelector</class> <widget class="QWidget" name="PointSelector"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>643</width> <height>528</height> </rect> </property> <property name="windowTitle"> <string>Point Selector</string> </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QLabel" name="imageDisplay"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> <string>No File</string> </property> <property name="alignment"> <set>Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> </property> </widget> </item> <item> <widget class="Line" name="line"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout"> <item> <widget class="QLabel" name="label"> <property name="text"> <string>Left Click on head | Right Click on tail</string> </property> </widget> </item> <item> <widget class="QPushButton" name="confirmButton"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="minimumSize"> <size> <width>175</width> <height>0</height> </size> </property> <property name="text"> <string>Confirm</string> </property> </widget> </item> </layout> </item> </layout> </widget> <resources/> <connections/> </ui>
  • 0 Votes
    10 Posts
    1k Views
    JonBJ
    @AntriX There isn't a separate signal depending on state of modifier buttons like Ctl. You have to attach to mouse down or up and check for modifiers there, or check for global state in normal click slot, I can't recall which is best.
  • how to print the address of QGraphicsScene

    Solved
    2
    0 Votes
    2 Posts
    179 Views
    Pl45m4P
    @micha_eleric QGraphicsScene scene_; qDebug() << &scene_;
  • The mystery of the leaking ui object

    Unsolved
    5
    0 Votes
    5 Posts
    426 Views
    Chris KawaC
    @SimonSchroeder said: Even better is to use std::unique_ptr<Ui::ProgressDlg> ui; in this case. The caveat being that you have to have a non-inline destructor for your class in that case, so you have to define it in your cpp even if it's empty. That's because the unique_ptr has to have a complete definition of the pointed to type at the time of instantiating its destructor, so can't be inlined in a header that only has forward declaration. Not a big deal if you do other stuff in the destructor, but kinda spoils the benefit of using RAII pointer if you don't.
  • QSerialPort not reading from Arduino

    Unsolved
    6
    0 Votes
    6 Posts
    545 Views
    SGaistS
    A timer can be a possibility however I would rather first determine whether it's really needed. Also, if the reconnection happens, does the serial port name change ?
  • Qt 6.5 not supporting Dark Mode on Windows

    Unsolved
    2
    0 Votes
    2 Posts
    580 Views
    SGaistS
    Hi, It seems there's a bit of a misnomer here. The comment on the related merge request seems to indicate that it is on hold until full support on Windows rather than buried. But I agree it's a bit counterintuitive with regard to the announcement.
  • Find a running timer in another thread

    Unsolved
    11
    0 Votes
    11 Posts
    809 Views
    JonBJ
    @ocgltd said in Find a running timer in another thread: I have a fairly large multithreaded app I would first suspect your own code. You will need a minimal reproducer to report it as a bug anyway, so I suggest you find what what is necessary for the message to appear.
  • Weird issue with SIGNAL/SLOT

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    L
    @JonB I figured out what is happening. Seems the Emit is being called before the connect statement had a chance to be called. I'll have to rearrange how statements get executed. Thanks!
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • What is \o in QRegExp and how to port it to QRegularExpression?

    Solved
    5
    0 Votes
    5 Posts
    535 Views
    V
    Thanks for disassembling and explaining that for me. I still don't understand what it did, and I definitely don't want it in my codebase now that I see how weird it is.
  • QT widget design - square under main window

    Unsolved
    3
    0 Votes
    3 Posts
    644 Views
    S
    @Pl45m4 said in QT widget design - square under main window: Took me minutes of looking at the image to see what you are talking about. Better point to it directly in the image or something :) Your the color scheme of your desktop background also doesn't help :) Sorry about that 😄 Thanks for the reply, I'll try that once I get home to my computer!
  • JSON read and write values

    Unsolved
    29
    0 Votes
    29 Posts
    5k Views
    A
    @JonB Hello! I find what reason by elimination method And on_open_folder_clicked() become the following: void M_m::on_open_folder_clicked() { QFileDialog dialog(this); dialog.setFileMode(QFileDialog::Directory); QString nameFile2 = dialog.getOpenFileName(this, tr("load bin"),"", tr("*.bin")); qDebug() << "file name at first "<< nameFile2; if (nameFile2.isEmpty()) { return; } else { qDebug() << "dirdir2"; ui->lineEdit->setStyleSheet("color: green; background-color: white"); ui->lineEdit->setText(nameFile2); g_FILE_LOAD = nameFile2; qDebug() << QString::number((unsigned int)fls, 16); ui->lineEdit->setStyleSheet("color: green; background-color: white"); ui->lineEdit->setText(nameFile2); qDebug() << "new g_FILE_LOAD" << g_FILE_LOAD; } fs2->setValue(3); }
  • 0 Votes
    5 Posts
    2k Views
    R
    5 years down the track, I've built my own https://github.com/RichardLangFromNZ/QtFakeTime
  • bindValue is not working

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    JonBJ
    @icoicqico If you want help, e.g. from @Christian-Ehrlicher or myself, let us know when you are prepared to make the changes we suggested, and not continue with something else which will never work. Up to you.
  • Reconnecting to another port in QSerialPort

    Unsolved
    1
    0 Votes
    1 Posts
    321 Views
    No one has replied
  • Building Qt5.15.2 from source code with configure -no-feature-accessibility

    Solved
    5
    0 Votes
    5 Posts
    628 Views
    JonBJ
    @gaojinhsu As @Christian-Ehrlicher says. See also https://code.qt.io/cgit/qt/qtbase.git/tree/configure?h=5.7 -no-accessibility .. Do not compile Accessibility support. Disabling accessibility is not recommended, as it will break QStyle and may break other internal parts of Qt. With this switch you create a source incompatible version of Qt, which is unsupported.
  • Modbus TCP Client - state connecting

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    R
    Hello, have you solved your problem? I also encountered this problem on Linux, but the Unconnected status can be detected when I disconnect the server in Windows
  • _ITERATOR_DEBUG_LEVEL when building debug with HDF5 libs

    Unsolved
    6
    0 Votes
    6 Posts
    747 Views
    Christian EhrlicherC
    @Rudresh said in _ITERATOR_DEBUG_LEVEL when building debug with HDF5 libs: Is there any other way ? Don't build a debug version of your app.
  • qt_generate_deploy_qml_app_script generates script with empty include()

    Unsolved
    5
    0 Votes
    5 Posts
    753 Views
    joborJ
    For reference, here's the bug report Rich created for this issue: https://bugreports.qt.io/browse/QTBUG-113769