Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • How to scale QQuickItem in x or y direction only?

    Unsolved
    3
    0 Votes
    3 Posts
    256 Views
    A
    @GrecKo That is, I would instantiate a Scale object, and reparent the original component? And hope the component doesn't depend on a specific parent hierarchy to work.
  • Enable another application's window to be dragged and dropped onto my widget ?

    Unsolved
    4
    0 Votes
    4 Posts
    328 Views
    JonBJ
    @LinuxGuy I think it is not easy to see the mouse outside of your application windows. Might have to "grab" the mouse, which is not pretty and can leave window system unstable, might be able to "poll" on a timer (https://stackoverflow.com/a/29400627/489865). Google for qt mouse outside application. Then there is the complication that the windowing system is in the middle of a window-drag operation, which can only make it harder, and you want to detect drop as well. And if you are using Wayland wouldn't surprise me if it stops you doing this (I have no evidence for this, just that it sounds like what it would want to prevent). Can you name an application, other than something in the window manager itself, which does what you are wanting to do?
  • [Solved] Tooltip on QAction

    6
    0 Votes
    6 Posts
    10k Views
    S
    If your menu have actions & you want to add tool-tip for the respective actions , can follow these steps: 1: set tool-tip (action.settooltip("Your tool tip")) for every action. 2: write a connect statement on hovered() signal and write a slot for it. 3: in slot definition you have to write QAction* act = static_cast<QAction*>(QObject::sender()); QToolTip::showText(QCursor::pos(),act->toolTip(),menuObject_where you have added action);
  • Update data in a CSV file

    Unsolved
    5
    0 Votes
    5 Posts
    223 Views
    JonBJ
    @SeyMohsenFls As stated, you have to rewrite the complete file, can't be clearer. You have two possible ways: Read whole file into memory, in some structure (even if it's just a list of lines). Make modifications to it in memory. Write whole file back when completed, e.g. overwriting original file. This is how e.g. a text editor or sort works. Open existing file for read, open a new file for write. As you read each line in, make any modifications and write new line out. At the end probably/perhaps delete original file and rename new file to that. This is how e.g. sed works. Either way you completely rewrite new file. Difference is how much memory you use.
  • Qt cmake deployment API and Cpack not working for macos

    Solved
    3
    0 Votes
    3 Posts
    304 Views
    MesrineM
    @Mesrine said in Qt cmake deployment API and Cpack not working for macos: Unspecified That was the problem. It seems that install(TARGETS QVaultCli BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT vaultCli ) Do not add the bundle to the cpack vaultCli component.
  • How can I make a default QPushButton respond to ENTER?

    Solved dialog box default action
    13
    0 Votes
    13 Posts
    2k Views
    JonBJ
    @SimonSchroeder See the discussion around https://forum.qt.io/topic/155461/qlineedit-returnpressed-when-something-else-has-a-key_return-shortcut/16 for the pointlessness/potential evilness of the NumPad Enter key ;-)
  • OpenSSL linker issue in QT6.5.3 in macOS OSX

    Unsolved
    8
    0 Votes
    8 Posts
    548 Views
    I
    @SGaist yes
  • Raspberry pi

    Unsolved
    2
    0 Votes
    2 Posts
    179 Views
    C
    @Rockerz Qt for Linux/X11 - Deployment
  • QSharedData and the rule of five

    Unsolved rule of five qshareddata move ctor move assignment qshareddataptr
    1
    0 Votes
    1 Posts
    209 Views
    No one has replied
  • QDockWidget undocks in a wrong position

    Unsolved qdockwidget
    1
    0 Votes
    1 Posts
    142 Views
    No one has replied
  • Qt and Unity Integration

    Unsolved qt unity
    2
    0 Votes
    2 Posts
    1k Views
    Ronel_qtmasterR
    @Aliaa did you check this? https://forum.qt.io/topic/136275/trying-to-embed-an-application-in-my-qt-app
  • What is QStringConverter::LastEncoding?

    Unsolved
    3
    0 Votes
    3 Posts
    257 Views
    J
    @ChrisW67 Thanks! That explains it.
  • QT covert Xcode

    Unsolved
    4
    0 Votes
    4 Posts
    249 Views
    SGaistS
    @Mingzhi1213 you did not gave all the information required. By the way, 5.12 is outdated, you should consider to update to at least 5.15 if not Qt 6.
  • Single instance application

    Unsolved
    2
    0 Votes
    2 Posts
    577 Views
    JonBJ
    @franco-amato There is an old one but I believe kept up-to-date, QtSingleApplication at https://code.qt.io/cgit/qt-solutions/qt-solutions.git/. There are various alternatives in https://stackoverflow.com/questions/5006547/qt-best-practice-for-a-single-instance-app-protection/. See https://github.com/itay-grudev/SingleApplication for code which claims to be superior to QtSingleApplication .
  • 0 Votes
    6 Posts
    843 Views
    M
    @jdent said in How do I iterate across the columns of a QTableView so I can find the total width of the table?: @Axel-Spoerl How can I get the vertical scrollbar of the QTableView? Simply with verticalScrollBar() cause QTableView inherits of QAbstractScrollArea ;)
  • Docking and moving a frameless window?

    Unsolved c++ qt framelesswindow menubar
    4
    0 Votes
    4 Posts
    1k Views
    Pl45m4P
    @StudentScripter This? [image: be5a8ab0-8e53-44e3-bfbd-2ec07f548924.png] It's called Split Window / Window Tile or something like that and is a Window Manager functionality (in your case, X on Windows 7/10). Because frameless Qt toplevel Widgets don't request a Window decoration, I think X does not recognize that you want to snap/split it anyway. This is probably not doable with Qt only and platform/Window Manager dependent, maybe you need some extension. Haven't found one though. Edit: If you are fine with not using the native functionality, you could try to implement something like that using your Qt widget... when enabled, calculate the requested area (1/2, 1/4...) of your screen size and geometry and resize + move your widget accordingly.
  • QLineEdit::returnPressed when something else has a Key_Return shortcut

    Solved
    20
    1 Votes
    20 Posts
    3k Views
    JonBJ
    @Chris-Kawa 6 lines of code are worth a thousand words ;) Perfectly clear now!
  • CDialog OnInitDialog()

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    JonBJ
    @jdent You show a screenshot where so far as I can see the table view fills the width of the dialog. So you may know what else you mean, and perhaps someone else will, but I do not. I now see you have created https://forum.qt.io/topic/155541/how-do-i-iterate-across-the-columns-of-a-qtableview-so-i-can-find-the-total-width-of-the-table. I assume that is now the question you wish to ask. It would nice if you took the time to cross-reference from that question to this and vice versa so that people knew and did not spend time trying to answer both....
  • How to change "centralWidget" setting?

    Unsolved
    4
    0 Votes
    4 Posts
    843 Views
    Pl45m4P
    @AnneRanch said in How to change "centralWidget" setting?: I will agree ,the "boundary" between QtDesigner GUI and QtCreator code is a challenge - especially when "the code " is "self documenting" There is no boundary and the code / Qt is very well documentated.
  • I want to resize a dialog to the width of a QTableView inside of it....

    Unsolved
    6
    0 Votes
    6 Posts
    479 Views
    JonBJ
    @jdent Answered https://forum.qt.io/topic/115490/cdialog-oninitdialog