Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Advice for best practice high-DPI development needed

    Unsolved
    1
    0 Votes
    1 Posts
    421 Views
    No one has replied
  • Set Delegate for each cell in a QTableWidget?

    Solved
    23
    0 Votes
    23 Posts
    9k Views
    H
    @VRonin hi, I have finished modifying the delegate button so I can use it in my code and it works fine. However, I am wondering how can I set a stylesheet for it. With my old QPushButton I had it like this: QPushButton* cancel_button = new QPushButton(this); cancel_button->setIcon(QIcon(QPixmap(":/Icons/cancel.png"))); cancel_button->setStyleSheet("QPushButton{background-color: transparent; background-repeat: none; border: none;} QPushButton:pressed{ background-color: transparent; }"); Can I do it with the delegate button? The reason I want to do this is because I want the the button to display only the icon I set for it. Edit: I think I have solved it by going in the QStyleOptionButton buttonOptions(const QStyleOptionViewItem &option, bool skipRct=false) const function and change the QStyleOptionButton features to flat: QStyleOptionButton buttonOption; buttonOption.features = QStyleOptionButton::Flat;
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    84 Views
    No one has replied
  • QFileDialog Error

    Unsolved
    3
    0 Votes
    3 Posts
    313 Views
    L
    @JonB I don't know ...I wanted to find out if anyone has encounter this same issue and if yes . How was it solved, currently I'm searching online for help.
  • is it possible to turn off stylesheet distribution?

    Solved
    16
    0 Votes
    16 Posts
    2k Views
    JKSHJ
    @django-Reinhard said in is it possible to turn off stylesheet distribution?: I'll learn the Qt-way of coding Did you try the code in my last message?
  • QLabel pressed stylesheet is ignored

    Unsolved
    5
    0 Votes
    5 Posts
    465 Views
    JKSHJ
    Hi, and welcome! @Aario said in QLabel pressed stylesheet is ignored: does that mean it is not supported? :hover is not supported in QLabel: https://doc.qt.io/qt-5/stylesheet-reference.html
  • QFileDialog prints bad window warning

    Unsolved
    2
    0 Votes
    2 Posts
    894 Views
    SGaistS
    Hi, IIRC, it's not something to worry about. See this issue.
  • Setting and getting property on a widget...

    Unsolved
    10
    0 Votes
    10 Posts
    1k Views
    JoeCFDJ
    @SGaist I was wrong. Thanks.
  • error: ‘class qbs::Project’ has no member named ‘addFiles'.

    Unsolved
    3
    0 Votes
    3 Posts
    337 Views
    R
    I've seen that page but I don't understand it. I installed qbs but the same error is ocurring.
  • How to change color only in selected letters in QLineEdit?

    Unsolved
    15
    0 Votes
    15 Posts
    9k Views
    HeerokNewbieH
    @eyllanesc Your answer is helpful for me. Thanks
  • Buttons in layout enabled but not accessible.

    Solved
    10
    0 Votes
    10 Posts
    1k Views
    SPlattenS
    @JoeCFD , thanks for your effort and time, I've found the problem now and it wasn't to do with Qt, just my memory and me being stupid.
  • Project ERROR: Unknown module(s) in QT: script

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    R
    Thank you so much! It worked! I appreciate your help!
  • Handle QmouseEvent for rightClickEvent and rightClickEvent+moveEvent seperately

    Unsolved
    2
    0 Votes
    2 Posts
    173 Views
    JonBJ
    @gde23 Where are you doing all of this? You're just supposed to attach menus to widgets' QContextMenuEvent, QWidget::contextMenuEvent(QContextMenuEvent *event), etc. Oh, I think I see what you mean. Start by being more specific about "use right mouse move for moving stuff around.". Presumably you are talking about right mouse down and then drag/move around, else it wouldn't be interfering with the right-click context menu? So the trouble with your intention is that at right-mouse-down you still don't know whether to show a menu or start a drag? I don't think this is a good idea, I can't think of an application which deals with right-mouse-down ambiguously like this? I would try to think of one before you adopt this behaviour.
  • How to set a correct RS422 serial port communication

    Unsolved serial port com rs422 moxa
    4
    0 Votes
    4 Posts
    1k Views
    Christian EhrlicherC
    I would try with a more recent version of Qt but doubt it's really a Qt problem but more a driver problem.
  • Bytes array to QByteArray.

    Solved
    16
    0 Votes
    16 Posts
    5k Views
    J
    OK, I'll try it.
  • Disable Windows shortcuts

    Unsolved
    3
    0 Votes
    3 Posts
    301 Views
    artwawA
    @ivanicy There is not. You would need to run Windows in the kiosk mode as @jsulm pointed out. System architecture from Windows XP/2000 forbids this (in Windows 95/98 it was possible by specifying your program as "command=your_program" instead of "command=explorer.exe" in the win.ini file)
  • Building PostgreSQL driver on Linux

    Solved
    3
    0 Votes
    3 Posts
    786 Views
    nicmoraisN
    @jsulm Thank you for your attention, buy I got it fixed by compiling Qt 6 instead of 5.12.5.
  • The problem is that you can't find the header file starting with ui.

    Unsolved
    15
    0 Votes
    15 Posts
    2k Views
    I
    @J-Hilk Exactly ui_WTest.h. In that path, the files that I said were accessible are also in the same path.
  • How do you keep a class from deleting an argument passed in by reference?

    Solved
    6
    0 Votes
    6 Posts
    701 Views
    S
    @Christian-Ehrlicher is right that you should avoid (in general at least) to use a shared pointer with QObject. Try to always use the parent to manage the lifetime of QObjects. Once you start mixing the two you might easily provoke a double free. Be aware that Qt also automatically sets parents in some cases! Whenever you place a widget into a layout it will be reparented. It is much easier to avoid shared pointers with QObject than to try to figure out all the corner cases.
  • CMakeLists.txt error

    Unsolved
    2
    0 Votes
    2 Posts
    351 Views
    sierdzioS
    @britsfp said in CMakeLists.txt error: When my compiler does the parsing of CMakeLists.txt It's not compiler, it's cmake. it gets this error on this line CMakelists.txt file line:: find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) The line is correct. But is it located below project() call? It has to. If not that - maybe your Qt installation is broken? Try reinstalling.