Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Mac vs Windows scaling (same app much smaller on Windows)

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    jandymanJ
    It turns out the solution to this is simple, though I had to read a whole bunch of confusing descriptions of scalability. It really should be easier to find. And the Qt support pages on the topic could be less confusing. https://stackoverflow.com/questions/41331201/pyqt-5-and-4k-screen Put this in your setup code before creating the QGuiApplication, to support High DPI scaling on Windows: os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" sys.argv += ['--style', 'fusion'] app = QGuiApplication(sys.argv) The font scaling ends up a little bit different, but that is acceptable for my use case. For C++ users, look here: https://doc.qt.io/qt-5/qtquickcontrols2-highdpi.html Whew! I was getting nervous about my decision to create this cross platform UI.
  • How can I access json data at c++ code in qml?

    Unsolved
    2
    0 Votes
    2 Posts
    460 Views
    raven-worxR
    @taedooly said in How can I access json data at c++ code in qml?: does QJsonObject type support direct access in qml? QML converts the QVariantMap type to a JSON object. So simply call QJsonObject::toVariantMap() and pass it to on
  • Minimal SQL program that fails, what is wrong with it

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    O
    I guess so, thank you for your replies.
  • Constructing a std::filesystem::path from a QString

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    Christian EhrlicherC
    @Perdrix said in Constructing a std::filesystem::path from a QString: it's just that I've been bitten before by stuff that felt like it ought to work but didn't! Still no clear answer :) When the path is properly constructed I don't see what should go wrong here.
  • Is it ok? - QStandardItemModel and ownership of item

    Solved
    2
    0 Votes
    2 Posts
    423 Views
    Christian EhrlicherC
    Ownership and qobject parent / child relationship are two similar but different things. Just because an object takes ownership of another object there is not need that one is the parent of the other.
  • Update Class Value using Slider

    Solved
    8
    0 Votes
    8 Posts
    459 Views
    Christian EhrlicherC
    'widget' is a really bad name when you want to use findChild. Also why do you search for a QObject when you case it to a OSGWidget later on? Why not directly searching for a OSGWidget?
  • QT framework

    Solved
    2
    0 Votes
    2 Posts
    171 Views
    Christian EhrlicherC
    Use the Qt online installer to use the official binaries instead some third party stuff
  • How to create a thumbnail from a video using libvlc Qt vlc-qt

    Unsolved
    2
    0 Votes
    2 Posts
    907 Views
    JonBJ
    @devillIsHeree Did you try any Googling for, say: Qt vlc-qt thumbnail ? E.g. Start from the comments to https://stackoverflow.com/questions/31448313/video-preview-image-using-vlc-qt-or-libvlc-directly, https://forum.videolan.org/viewtopic.php?t=148937, and several others.
  • How to set window flags in QTDesigner

    Unsolved
    1
    0 Votes
    1 Posts
    260 Views
    No one has replied
  • How to play video backwards in qt using vlc-qt libvlc

    Unsolved
    1
    0 Votes
    1 Posts
    339 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    13 Views
    No one has replied
  • 0 Votes
    5 Posts
    529 Views
    O
    just detected that myself, thanks!
  • Deferred function call using QTimer.

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    JonBJ
    @SGaist , @Helg1980 Sorry, you can see from what I wrote I just missed the this parameter. My bad.
  • Can't get going with QML, Python and QT Creator on Mac OS

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    SGaistS
    AFAIK, you can reuse the same concepts that are used for C++ with some language adaptation.
  • Getting error 42601 when running procedure in PostgreSQL

    Solved sql
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How to use signal from QPushButton to Main.cpp

    Unsolved
    2
    0 Votes
    2 Posts
    177 Views
    Christian EhrlicherC
    @Nocturnal said in How to use signal from QPushButton to Main.cpp: static variables What do you mean with this? Signal/slots need objects. See the documentation.
  • How to make QList const from outside

    Solved
    12
    0 Votes
    12 Posts
    822 Views
    Christian EhrlicherC
    @Cocojambo said in How to make QList const from outside: Can I prohibit copying reference and cloning the source array as result in any way from my class? No - it's a copy so the 'user' can do what he wants.
  • [Solved] Initial "DockWidget->toggleViewAction()" value

    Unsolved
    2
    0 Votes
    2 Posts
    244 Views
    A
    Hi again, I could finally make it! I created a new action and I have connected it with the "toggleViewAction" from the DockWidget: triggerAction = new QAction(this); connect(triggerAction, &QAction::triggered, DockWidget->toggleViewAction(), &QAction::triggered); ... Then later I can trigger the new action: triggerAction->trigger(); Thanks anyway!
  • No rule to make target 'VLCQtWidgets/WidgetVideo.h', needed by 'ui_mediaplayer.h'

    Unsolved
    3
    0 Votes
    3 Posts
    360 Views
    D
    My pro file QT += core gui multimedia multimediawidgets xml network greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 CONFIG += vlc vlc { LIBS += -lVLCQtCore -lVLCQtWidgets LIBS += -lvlc } SOURCES += \ main.cpp \ expplayer.cpp \ videowidget.cpp HEADERS += \ expplayer.h \ videowidget.h FORMS += \ expplayer.ui # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target RESOURCES += \ icon.qrc
  • Strange autoclicking of qpushbutton

    Solved
    4
    0 Votes
    4 Posts
    301 Views
    Pl45m4P
    @jerin-johnson This property's default is true for buttons that have a QDialog parent; otherwise it defaults to false. https://doc.qt.io/qt-5/qpushbutton.html#autoDefault-prop Your buttonBox is a child of your QDialog, so it must be true. You can disable it manually, but then you can't accept your dialog by pressing enter anymore. But it seems that you don't need this anyway.