Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.3k Posts
  • Unable to Move Window Between Screens in Wayland

    Unsolved
    2
    0 Votes
    2 Posts
    942 Views
    SGaistS
    Hi, The reason is: it's a Wayland "feature" not something that Qt can do anything about. You could use a custom compositor that does not follow the official API but that's at your own risk.
  • QtCreator crashes when adding the path to Android NDK list on Android settings

    Unsolved
    2
    0 Votes
    2 Posts
    235 Views
    tomyT
    Qt Creator 10.0.0 IDE is the best amongst its prior versions for crashing so that I have to rise Task Manager each time just to terminate it! Wow great job creating that! A true piece of shit.
  • color individual points separately in QScatterSeries of Qt Charts

    Unsolved
    1
    0 Votes
    1 Posts
    536 Views
    No one has replied
  • QImage not opening 16-bit png (AFAICT)

    Solved
    2
    0 Votes
    2 Posts
    337 Views
    PerdrixP
    @Perdrix Woohoo! I found QImageReader::setAllocationLimit()
  • qt creator9 along with qt6.4 doesnt compile WYSIWYG, not similar with preview

    Unsolved
    14
    0 Votes
    14 Posts
    4k Views
    ?
    @Christian-Ehrlicher @ChrisW67 Thank you for your help. Here is an MVP of what shows the problem. Would you please tell me If I am doing layouts wrongly? Or should it be handled in other ways for high dpi management? https://drive.google.com/file/d/1oPCpIctbh9lgRSMbFnIiTSZmLba0I3R2/view?usp=sharing
  • Qt installator doesn't show components in Ubuntu 22.04

    Solved
    10
    0 Votes
    10 Posts
    2k Views
    C
    @Abderrahmene_Rayene I did "sudo apt-get install qtbase5-dev" , after this I ran the qt installer and the components appeared in the installer.
  • How to build WM_KEYDOWN|UP LPARAM from a QKeyEvent?

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    Chris KawaC
    @Ylvy said: I didn't understand this ll thing, based on these two examples i gave (wParam of wheel and lParam of KeyEvent) is it still possible to it construct wrong messages at sometime or is it correct now? LPARAM is a typedef for __int64, which is Microsoft's extension type name for 64bit signed integers (same as int64_t in modern C++), so when dealing with constants for it you should be using signed 64bit integers, for example 1LL. As @JonB said it stands for long long int, which is the old way of standard C++ to mean "at least 64 bit" (it is always 64 bit on 64bit Windows). WPARAM is a typedef for unsigned __int64, so when dealing with it you should be using unsigned 64bit integers, for example 1uLL, which stands for unsigned long long int. The type of (1<<31) expression is int, since all operands are int and that is a 32bit signed integer on Windows. When using it in expression like lParam | (1 << 31) it gets upcasted to 64bit type, because the left operand is a signed 64bit value. (1<<31) is a negative 32bit signed value, so when upcasted to 64bit you get 11111... at the extended part of the 64bit value (C++ uses Two's complement binary representation), which caused your problem. A type of (1LL << 31) expression is long long, since the left operand is a long long constant. It already is a 64bit value with 00000.... on the first 32 bits, so there's no upcasing needed when you | it with lParam. Btw. keep in mind that what I said is about 64bit Windows. If you target 32bit Windows too then LPARAM and WPARAM are typedefs for 32bit types long and unsigned int, so use 32bit constants there. A side question, why Qt use a different value for the key modifiers Qt::ControlModifier, etc, than Microsoft? Why should it be the same as Microsoft? Qt is a cross-platform framework with roots in Linux. I don't see any reason why it should use the same values for private implementation as any particular vendor, not just Microsoft.
  • Qt without qmake and the .pro file

    Unsolved
    6
    0 Votes
    6 Posts
    499 Views
    JoeCFDJ
    @clarify not sure which Qt version you are using? From Qt6 cmake is preferred. I saw most of Qt6 examples have both cmake and qmake. Better to switch now.
  • Adding custom port to "terminal" example - bump

    Unsolved
    6
    0 Votes
    6 Posts
    346 Views
    A
    @Pl45m4 I finally found the code which actually reads the system available serial ports... it is a challenge to start with "update settings" and go backwards... Temporary / partially solved
  • QPlaintTextEdit shows nonprintable characters

    Unsolved
    2
    0 Votes
    2 Posts
    212 Views
    SGaistS
    Hi, Which characters are you currently seeing ?
  • QTableWidget has no cellRightClicked

    Unsolved
    2
    0 Votes
    2 Posts
    257 Views
    JonBJ
    @clarify Right clicking on widgets is normally handled as a context menu request. For a QTableWidget right click on cell example, see e.g. @SGaist's code at https://forum.qt.io/topic/94905/simpliest-way-for-creating-contextmenu-for-qtablewidget-cells/5.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Drag and drop with drawing lines between items

    Unsolved
    2
    0 Votes
    2 Posts
    305 Views
    JonBJ
    @Jessevg Hi. I'm not an expert on the terminology, haven't used UML, but I term this a "flow chart", right? Qt provides Diagram Scene Example for a simple one/the principles. If you want to start from someone else's work, I Googled Qt flow chart. There seems to be a https://github.com/floji/floji, don't know what it does/how good it is. Or Google Qt UML. Qt itself has a "model editor to create Universal Modeling Language (UML) style models". I don't know whether you can use this, use this for inspiration, or if the sources are provided.
  • no query unable to fetch row

    Solved
    17
    0 Votes
    17 Posts
    5k Views
    M
    I was having a similar issue, but in my case I didn't realize that the QSqlQuery constructor executes the SQL immediately if you pass in the string. That created the "unable to fetch row" condition when I subsequently called .exec since I was erroneously instructing it to run the same query again.
  • Layout: Draw a button widget over the image drawn on the qlabel.

    Solved
    7
    0 Votes
    7 Posts
    685 Views
    M
    @jsulm Thanks so much :) buttonLayout = new QHBoxLayout(ui->label); buttonLayout->addWidget(ui->beginBtn); buttonLayout->addWidget(ui->prevBtn); buttonLayout->addWidget(ui->nextBtn); buttonLayout->addWidget(ui->endBtn); buttonLayout->setAlignment(Qt::AlignBottom | Qt::AlignCenter); However, since the qlabel is adjusted to the size of the image, the location of the button moves according to the size of the image. The button disappears when the picture size is larger than the window and there is a scroll bar. I guess I can fix it so that it is always centered under the window. thank you
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    33 Views
  • Install Qt for Ubuntu from command line

    Unsolved
    3
    0 Votes
    3 Posts
    473 Views
    SGaistS
    Or use the aqtinstall project.
  • How to embed QDialog into QWidget ?

    Solved
    1
    0 Votes
    1 Posts
    425 Views
    No one has replied
  • Is QModelIndex visible for the user in AbstractItemView?

    Solved
    3
    0 Votes
    3 Posts
    196 Views
    SGaistS
    @JonB AFAIK, that's the easy answer :-)
  • 0 Votes
    14 Posts
    961 Views
    Pl45m4P
    @tushu said in Rectangle in scene is changing it's position after multiple times closing - reopening scene window.: You are right, I am not destroying everything. I am not deleting _scene, after closing scene. I am clearing all the objects in it but not deleting scene. Yes, that's what I wrote here. With your additional movement in negative direction here QRectF Rect(topLeftX /+ 3/, topLeftY /- 20/, bottomRightX /+ 10/, bottomRightY /+ 30/); you expand your scene by 20. And it stays like this as long as you dont destroy your scene. When you add your items again, your items are not centered in your viewport anymore