Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • problems with getting keypress event

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    D
    Thank you for the pointer! I had completely forgotten about that possibility. I used it in my first prototypes - long time ago :/ ... in this case it did not help to get the desired result. Too many widgets between notebook and lineedit. But it was very helpful any way! It bothered me that even with Ctrl or Alt modifiers the number-/letter-keys produce an input in the lineedit. With the event filter I was able to iron out the flawed concept. First I did not like that I now have to code the access keys of the notebook in the editor. But after a short thought I realized that actually every input field needs an EventFilter to not process number and letter keys with modifiers as input. This kind of workaround is ok for me now ;) It works like this: editor adds itself as eventfilter to lineedit editor checks for modifiers at keypress if a modifier is active, editor calls keyPressEvent followed by return true - without modifiers active eventFilter returns false, which leads to default key processing of lineedit. Those keys don't arrive at keyPressEvent. keyPressEvent routes keys that will not be processed to its superclass. This will route key events to QMainWindow (I checked that by following timecode of event). As its not possible to route events to widgets parents, it was possible to distribute events top down, as all classes are my classes. So I changed keyPressEvent to public. After that change, QMainWindow passes unprocessed key events to center widget (which in my case is a stacked layout). As I manage all stacked pages with an individual class, it was easy to change keyPressEvent to public too. The stacked widget manager then distributes key events to the active page (widget), which in this case is the notebook. It's a big detour until the event reaches its destination, but it works.
  • how to refer same table widget to different pages of tabwidget

    Unsolved
    3
    0 Votes
    3 Posts
    417 Views
    artwawA
    @GodOfCode One way of achieving that would be to change table widget to table view, put the data in the model connected to the view. Then you can have as many views as you like and feed all of them with a single model and a single data set.
  • Glitches appear randomly

    Unsolved
    3
    0 Votes
    3 Posts
    317 Views
    D
    @J-Hilk Windows 10 Version 20H2 Build 19042.1348 and Qt 6.2.1. 3/4 days ago updated all drivers including display (Intel HD and NVIDIA). Connected through HDMI.
  • Multimedia Seg Fault on load

    Unsolved
    9
    0 Votes
    9 Posts
    901 Views
    A
    @sc20cah As per your debugger screenshot, qt media player using default media streamer is Gstreamer, so Install and resolve gstreamer with its dependencies . If plugins of gstreamer are correctly configured/installed . example1 or example2 will be run without error. then compile your qt media player program.
  • Trigger recompute of QListView item display

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    Chris HennesC
    OK, the answer turns out to be that I had an error elsewhere in my code that was masking the real problem. To get the update done all I actually need is self.item_model.layoutChanged.emit() Thanks again for the assistance.
  • qt.bluetooth.windows: Unable to get value for characteristic

    Unsolved
    2
    0 Votes
    2 Posts
    699 Views
    SGaistS
    Hi and welcome to devnet, You need to update to Qt 5.14 at least for that. See the documentation here.
  • Update QTreeView item editor when resize item geometry

    Unsolved
    13
    0 Votes
    13 Posts
    1k Views
    R
    @VRonin said in Update QTreeView item editor when resize item geometry: @Rory_1 Thanks for the image, is the editor open in that picture? Can you try disabling the stylesheet temporarily and see if you have the same behaviour? Same behavior with and without the stylesheet, as per my working example.
  • Convert a QString to an uint8_t

    Solved
    10
    0 Votes
    10 Posts
    3k Views
    P
    Ok really good things to know thanks for your help guys
  • Unicode symbols not being displayed in widgets

    Unsolved
    2
    0 Votes
    2 Posts
    422 Views
    AndyBriceA
    Here you can see the same text containing QChar( 0xFFFC ) characters is displayed differently via QLineEdit (spaces), QTextView (0 width) and qDebug (? chars). [image: 4963f810-9c60-40a2-9fc2-9bd0d3a2e48e.png] I have added this to the Qt bug database as: https://bugreports.qt.io/browse/QTBUG-98645 I have attached example code there.
  • Is there a dark mode for this site?

    Solved
    3
    0 Votes
    3 Posts
    340 Views
    D
    @Gojir4, excellent. It works on MS Edge without any problem. Now I'm in pleasant Dark Mode.
  • Constructor syntax in Qt in mainwindow.cpp

    Solved
    16
    0 Votes
    16 Posts
    3k Views
    M
    To go along with @jsulm With const and reference variables, using the initializer list is mandatory. class B { public: B() { a = A(1); str="hello"; // error } private: A a; const string str; }; Funny enough, that way you can initialize a const var two times ! class B { public: B() : str("hello2") { a = A(1); } private: A a; const string str="hello"; // since c++11 };
  • How do you add Header/Footer in QTextDocument

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    D
    @HoMa, this, probably, is the simplest possible way.
  • How to reduce output file size and printing time?

    Solved
    5
    0 Votes
    5 Posts
    857 Views
    D
    @artwaw, now it's ok. See the edited part.
  • QTcpSocket Write

    Unsolved qt5 qtcpsocket qthread qtimer
    8
    0 Votes
    8 Posts
    2k Views
    A
    @duckrae List your client with id, when you are getting new incomingConnection. server can reply as per client id to a specific client or reply to all.
  • QT update video frame cause stuck?

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    jsulmJ
    @Puppy-Bear said in QT update video frame cause stuck?: void app0::cropimg() { qApp->processEvents(QEventLoop::AllEvents, 100); processEvents() is not needed
  • Manipulate QInputDialog::SetText as a String

    Unsolved
    5
    0 Votes
    5 Posts
    435 Views
    L
    @jsulm God thank you it's working i know it was a real weird question, you saved me thanks !
  • This topic is deleted!

    Unsolved
    6
    0 Votes
    6 Posts
    21 Views
  • QBluetooth BLE MacOS Monterey Support

    Unsolved
    2
    0 Votes
    2 Posts
    253 Views
    J.HilkJ
    @ADvorani launch the app bundle outside of QtCreator or compile and launch with Xcode :( https://bugreports.qt.io/browse/QTBUG-97900
  • Unable to read from QSerialPort using MSVC compiler

    Solved qserialport mingw msvc read serial
    25
    0 Votes
    25 Posts
    6k Views
    Christian EhrlicherC
    Here the bug report for this issue: https://bugreports.qt.io/browse/QTBUG-78086
  • Frame Size Extention Animation

    Unsolved
    4
    0 Votes
    4 Posts
    332 Views
    jsulmJ
    @IknowQT said in Frame Size Extention Animation: How do you know and express the control that is the subject of the animation effect? Not sure what this means. First parameter in the QPropertyAnimation constructor specifies the widget to animate, second specifies the name of the property of that widget to animate. Why do you want to animate minimumWidth? Wouldn't it make more sense to animate https://doc.qt.io/qt-5/qwidget.html#width-prop?