Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • Right format to use to display an image cv::Mat CV_32F normalized

    Unsolved opencv qt image image
    2
    0 Votes
    2 Posts
    1k Views
    SGaistS
    Hi and welcome to devnet, You can't jump from a 32bit float image to 16bit integer one like that. Convert your OpenCV image to 16 bit before making a QImage out of it.
  • Is there any documentation for this text in the pro file?

    Unsolved
    2
    0 Votes
    2 Posts
    169 Views
    SGaistS
    Hi, Which part exactly ?
  • sizeHint of QCheckBox not correct.

    Unsolved
    11
    0 Votes
    11 Posts
    1k Views
    JonBJ
    @JoeCFD Yes, you can indeed do a calculation like that based on a font. But anything to do with, say, layouts is undefined.
  • QWindowsPipeWritter error

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    JonBJ
    @Dharani-Prasad A couple of observations. They probably have nothing to do with the error you are seeing, but anyway: updateFirmwareProcess->write("\n\r"); You should have "\r\n"? Assuming you are just asking cmd to run one command for you, why do you start an interactive cmd when you could just use cmd /c ...? Do you need to use cmd at all, could you not just execute updateFirmwareCommand without it?
  • Force one cell in a QTableView to redraw

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    JonBJ
    @VRonin I have now had a chance to try out QAbstractItemView::update(QModelIndex), and am pleased to confirm it does exactly what I wanted! Thank you for drawing my attention to this method. I could not find it? Why? Because of the irritating way Qt chooses to arrange methods in its documentation.... I started by going to https://doc.qt.io/qt-5/qtableview.html page. No update() methods there. So I clicked the List of all members, including inherited members at the top of the page. There I scroll through the big list alphabetically, till I come across the adjacent group of entries: update(int , int , int , int ) update(const QRect &) update(const QRegion &) Nothing using a QModelIndex. So I gave up. What I didn't notice is that right up near the start of the whole list is the update(const QModelIndex &) entry. And why is it there, miles away from the other ones in alphabetical order? Answer: because it happens to be a Public Slot. And Qt docs, in its infinite wisdom, thinks it's a good idea to produce alphabetical lists all mixed in together but with things like slots placed separately from Public Functions etc. in the alphabetical list.... When if a human is looking for an item in a list this is not what they expect. Grrrr! This is not the first time I have been deceived by the alphabetical list of functions re-starting the alphabetical list a couple of times for different "categories" of functions. It's really annoying.... :( Thanks anyway. Would you care to rearrange the Qt docs for this issue? ;-)
  • QProcess::StartDetached, but the child process closes when the parent exits

    Unsolved
    16
    0 Votes
    16 Posts
    3k Views
    JoeCFDJ
    @JonB That is true.
  • Problem with QDockWidget placement

    Unsolved
    7
    0 Votes
    7 Posts
    428 Views
    D
    Good point - thank you! I reduced the content of the docking widget to one line and it does not work. Then I dragged the dockable to the desktop, where I could resize it on a second step. With the minimal size of the dockable, docking to bottom works. Then I played with the size of the dockable and as soon as the size is bigger, than the space, that could be made available by squeezing center widget, dragging to bottom will be refused. Well, knowing the behaviour, I could work around it. Not nice, but ok. Thank you!
  • Cross-Compile Stage Qt Creator for Orange Pi One

    Unsolved
    3
    0 Votes
    3 Posts
    883 Views
    K
    I solved the problem I mentioned above by typing the following command line. ../qt-everywhere-src-5.15.2/configure -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=/opt/qt5opi/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/qt5opi/sysroot -prefix /usr/local/qt5opi -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtdatavis3d -nomake examples -make libs -pkg-config -no-use-gold-linker -v ,and then I successfully completed the cross-compile process. With the hope that all humanity who encounters or will encounter this problem will find a solution here.
  • Disable text shortcut in QTableWidget

    Unsolved
    2
    0 Votes
    2 Posts
    159 Views
    mrjjM
    Hi You could use an eventfilter. https://wiki.qt.io/How_to_catch_enter_key Just as a note. I use this feature a lot in most programs - so make sure you don't piss of your users by removing an expected feature.
  • QChartView mouse double click

    Unsolved
    2
    0 Votes
    2 Posts
    441 Views
    mrjjM
    Hi You will override https://doc.qt.io/qt-5/qwidget.html#mouseDoubleClickEvent Do notice that double clicks are not real. its 2 single clicks and Qt keep track of time between and location if makes you a double click event. So if you override both mousePress and mouseDoubleClickEvent BOTH will be called by a double click. This is by design and it's up to you to write logic to handle both if you need to have both single and double click actions. Why doesn't gesture support double-click? Well it does in QML https://doc.qt.io/qt-5/qml-qtquick-taphandler.html#details I dont know about QWidgets.
  • QOpenGLWidget's format(smaples) would be reset As QGraphicsView’s viewport

    Unsolved
    1
    0 Votes
    1 Posts
    120 Views
    No one has replied
  • WebAssembly build error: undefined symbols

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    veryqtpersonV
    And where should i put the -s ERROR_ON_UNDEFINED_SYMBOLS=0 var, to bypass these errors. For those who hasn't figured this out, that (and other) flag(s) can be set in Makefile in the build directory (after you ran configuration with qmake): ... LFLAGS = -s WASM=1 -s FULL_ES2=1 -s FULL_ES3=1 -s USE_WEBGL2=1 -s EXIT_RUNTIME=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16"] --bind -s FETCH=1 -O2 -s ALLOW_MEMORY_GROWTH=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 ... In my case this was enough for the build to continue and succeed, as undefined errors became warnings, and I didn't get any other errors after that.
  • Qt signal transition on parent state overriden by child state

    Unsolved
    1
    0 Votes
    1 Posts
    146 Views
    No one has replied
  • Different output on different macOS machines

    Solved
    2
    0 Votes
    2 Posts
    180 Views
    S
    @Strangelove Apparently this was a bug in Big Sur, fixed when upgrading from 11.4 to 11.5.2.
  • Draw separator between overlapping QTableviews

    Solved qtableview
    12
    0 Votes
    12 Posts
    2k Views
    F
    The documentation about stylesheets is for me not the best one from qt .. nevermind
  • 0 Votes
    5 Posts
    1k Views
    B
    @mrjj I have the following stylesheet applied to a containing widget QMenu, QMenu QPushButton { background-color: #303030; color: white } When I remove the QMenu selector, the white line disappears (hence it starts looking like this) [image: 5a161ee4-3e8d-419a-8680-e774d2c01e70.png] I cannot say whether the white line really disappears or it just blends with the white color of the menu item. After applying the same style with a QMenu::item selector, I get the following: [image: 134815d0-278a-4a93-af33-bbdd63c68ea2.png] The ordinary menu items are colored, but those created by my class are not. It appears as if the ::menuItem selector does not work on them. I also tried setting the following style rule on the container returned by the createWidget function container->setStyleSheet(".MenuItem {background-color: #303030; color: white; }"); and it oddly makes the custom menu items get shifted to the left and the hover effects on them do not seem to work any longer. Applying padding/margin does not fix it: [image: e5b252c8-4e60-4a32-b13e-794608842129.png]
  • Qt chart Zoom in out GraphicsTextItem location update

    Unsolved
    1
    0 Votes
    1 Posts
    143 Views
    No one has replied
  • Scroll Area

    Unsolved
    2
    0 Votes
    2 Posts
    208 Views
    JoeCFDJ
    Scroll area is not needed in this case. Simply create models for these objects and update them when left or right arrow is clicked.
  • problem detecting Shift in keyReleaseEvent

    Unsolved
    3
    0 Votes
    3 Posts
    327 Views
    S
    @SGaist said in problem detecting Shift in keyReleaseEvent: Hi, Which version of Qt ? On which platform ? Qt 5.15 Debian Bullseye
  • crosscompiling to run C code on Raspberry Pi

    Unsolved
    6
    0 Votes
    6 Posts
    447 Views
    Pablo J. RoginaP
    @AnneRanch said in crosscompiling to run C code on Raspberry Pi: so far so good Indeed you're just actually testing that your RPi device is accessible from Qt Creator. And that you eventually will be able to deploy any file(s) to it. Up to this point you should have already cross-compiled Qt and have setup a kit in Qt Creator to use that Qt component. simple code to verify crosssscomplie... flash LED ??? why not to create some Qt widgets instead? i.e. simple QMainWindow For accessing RPi GPIO from C/C++ you may need to resort to some helper libary, i.e. libgpiod. See this blog post just in case.