Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • How to use a signal on QML side

    Solved
    1
    0 Votes
    1 Posts
    122 Views
    No one has replied
  • Building for Linux and Windows

    Unsolved
    8
    0 Votes
    8 Posts
    612 Views
    andrA
    @SimonSchroeder said in Building for Linux and Windows: Qt Creator for qmake projects will write a Makefile to the main folder both on Windows and Linux There is no difference between qmake and cmake here. It will put the Makefile in you build directory, so if you have different build dirs for the Linux and Windows builds that just works.
  • Qt::WindowStaysOnTopHint inconsistent behavior in RDP sessions on Windows 10

    Solved
    2
    0 Votes
    2 Posts
    163 Views
    deisikD
    It turns out that the real culprit is another application (on top of which my widget should be) which tries to stay above all other windows
  • QTableView merges cells

    Unsolved
    2
    0 Votes
    2 Posts
    233 Views
    JonBJ
    @Nan-Feng What do you mean other than void QTableView::setSpan(int row, int column, int rowSpanCount, int columnSpanCount)?
  • If Statement with QTime

    Solved
    13
    0 Votes
    13 Posts
    958 Views
    JonBJ
    @jsulm said in If Statement with QTime: Do you remember the "Port Qt to Rust" thread? :-) That was what I had in mind.... Maybe that would enforce half the C++ rules, without needing to impose an equal number of new ones for Rust?
  • How remove extra spaces from character using QFontMetrics?

    Unsolved
    7
    0 Votes
    7 Posts
    716 Views
    S
    @zabitqt said in How remove extra spaces from character using QFontMetrics?: If I draw Hello I see it correctly but if I draw character per character I see a space between character. This is because the font has embedded information how to adjust the distance between specific neighboring characters. If you draw them separately, this information is lost for the font renderer. Here is the definition of kerning from Wikipedia: In typography, kerning is the process of adjusting the spacing between characters in a proportional font, usually to achieve a visually pleasing result. Kerning adjusts the space between individual letterforms. I am not sure if Qt provides any way to get to this kind of information. You can disable kerning (for a whole word and not individual letters) and see if you get the same result when you are drawing the letters separately. If this is the case you know that you need to further research kerning.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • How to create border around modal window

    Unsolved
    3
    0 Votes
    3 Posts
    308 Views
    jsulmJ
    @masa4 It would be new to me that layouts can have styles. Layouts are not widgets and have no graphical representation. You need to set stylesheet on your widget.
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    27 Views
  • QStirng memory allocation and free

    Solved qstring memory allocati dynamic allocat
    6
    0 Votes
    6 Posts
    2k Views
    L
    @ChrisW67 thank you.
  • QWidget::mousePressEvent() not called

    Unsolved
    12
    0 Votes
    12 Posts
    3k Views
    N
    @jeremy_k Adding this QRectF TreeViewNode::boundingRect() const { return QRectF(-25, -25, 50, 50); } fixed it instantly.. such a silly mistake, it's almost as if I started learning about Qt last week.. (it's true). What can I say, thank you so much to everyone for your time and your suggestions, I'll make sure to remove m_scene and use scene() as well and keep learning more in detail about the classes I'm using. Thank you!
  • Setting limit size to vector and overwriting the oldest value when limit reached

    Unsolved
    9
    0 Votes
    9 Posts
    780 Views
    Kent-DorfmanK
    @JonB said in Setting limit size to vector and overwriting the oldest value when limit reached: I suggested earlier you can avoid this if you wish to be efficient. You would need to be able to read the oldest sample you are overwriting/discarding. MUST...FIGHT...URGE...TO...RESPOND!...but you read my mind. LOL
  • This topic is deleted!

    Unsolved
    4
    0 Votes
    4 Posts
    31 Views
  • MacOs: How to show a Folder Menu PopUp in window title bar

    Unsolved
    3
    0 Votes
    3 Posts
    436 Views
    S
    @mpergand Thanks - this works as expected for the main Window. I think it should also work for each Tab in a QMdiSubWindow - but if i set this for such a window it has no effect.
  • Crash in QMenu::exec() / QMenu::popup()

    Unsolved
    6
    0 Votes
    6 Posts
    762 Views
    Axel SpoerlA
    @NextSaturday It's indeed the paint event that ultimately causes the crash. It is consumed by a widget inheriting from QAbstractButton. That widget has a dangling d-pointer. It's theoretically possible but pretty unlikely, that it's not yet properly constructed. Unlikely because it already receives a mouse event. It's more likely on the way to destruction and still receiving a mouse event. The painting as such is doomed to fail, but it already fails when trying to obtain the d-pointer, so the crash happens before any painting is done. Sharing all the code in question would help to get to the bottom of it.
  • 5.15.12 ?

    Unsolved
    2
    0 Votes
    2 Posts
    211 Views
    Christian EhrlicherC
    If you've a commercial license then you will get 15.15.12, otherwise you have to stay with 5.15.2 when you want a pre-built binary package or 5.15.8 when you want to compile Qt on your own.
  • Copy object ?

    Unsolved
    2
    0 Votes
    2 Posts
    159 Views
    Pl45m4P
    @AnneRanch said in Copy object ?: all files (cpp / h / form ) at once You cant. Not with QtCreator and not with OS. Go to your project folder and just copy them. But what's the point? You need to rename everything anyway, otherwise it wont compile
  • TreeView in Qt5?

    Solved
    14
    0 Votes
    14 Posts
    1k Views
    C
    I managed to do it by using add_custom_target to invoke qmake from my cmake file. My cmake file now looks like this: cmake_minimum_required(VERSION 3.20) project(TreeViewTest VERSION 1.0 LANGUAGES CXX) # Configuration set(TREE_VIEW_OUTPUT ${PROJECT_BINARY_DIR}/qt_tree_view/qml/QtQuick/TreeView) set(QML_IMPORT_PATH ${TREE_VIEW_OUTPUT} CACHE STRING "Qml modules") # Qt set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) # Dependencies find_package(QT NAMES Qt5 COMPONENTS Quick Widgets QuickControls2 REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Quick Widgets QuickControls2 REQUIRED) # Build add_executable(appTreeViewTest src/sources.qrc src/main.cpp ) # Add treeview add_custom_target(qt_treeview_qmake ALL BYPRODUCTS ${TREE_VIEW_OUTPUT}/libqquicktreeviewplugin.so COMMAND mkdir -p qt_tree_view COMMAND qmake -o qt_tree_view ${PROJECT_SOURCE_DIR}/libs/qttreeview COMMAND make -C ${PROJECT_BINARY_DIR}/qt_tree_view VERBATIM USES_TERMINAL ) # Make treeViewTest depend on qt_treeview_qmake add_dependencies(appTreeViewTest qt_treeview_qmake) message(${PROJECT_BINARY_DIR}/qml/QtQuick/TreeView) # Link target_link_libraries(appTreeViewTest PRIVATE Qt5::Quick Qt5::Widgets Qt5::QuickControls2 ${TREE_VIEW_OUTPUT}/libqquicktreeviewplugin.so ) It surely can be improved, but this is the raw fix I came up with.
  • Any easy way to deploy an application for another pc?

    Unsolved
    16
    0 Votes
    16 Posts
    2k Views
    jsulmJ
    @agmar No, it means that it does not contain debug symbols and is better optimised than debug build.
  • Using breakpad on qt slots

    Unsolved
    1
    0 Votes
    1 Posts
    177 Views
    No one has replied