Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Qt dynamic translation on a serialized enum key in a comboBox

    Unsolved
    10
    0 Votes
    10 Posts
    923 Views
    Christian EhrlicherC
    @Habibie said in Qt dynamic translation on a serialized enum key in a comboBox: If so, I noticed, the lupdate utility does not pickup all the enum keys and I reckon that's the problem. Because you do not properly define them - see QT_TRANSLATE_NOOP documentation.
  • MySQL reconnect option is not working with upgrade to mysql 8.0.26

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    I
    @Christian-Ehrlicher Thank you. I've seen that and double checked that MYSQL_VERSION_ID is correct. It appears as 80026 on the latest MySQL 8.0.26.
  • How to pass signal from one class to another.

    Solved
    12
    0 Votes
    12 Posts
    988 Views
    JonBJ
    @J-Hilk said in How to pass signal from one class to another.: you can connect without an receiver QObject You can indeed, but you cannot use that to connect to instances of the OP's Geometry, which is what he is trying to do. He might write, e.g., a static method in Geometry to use as the slot, but it won't then do what he has in mind, which is to "auto-connect" each instance created to main window's signal.
  • How can I connect 2 ui like login page and mainpage?

    Solved
    4
    0 Votes
    4 Posts
    332 Views
    K
    @jsulm Thanks.i can finally figure it out .i thought my question is too stupid when i asked this in stackoverflow.but it is ok now.Thanks for your help!
  • Infinite rows in QTableWidget?

    Unsolved
    17
    0 Votes
    17 Posts
    2k Views
    JonBJ
    @Publicnamer It depends just what you want, what is in your model, and whether you know how much is in the backing model. Your question seems to relate to paging the data, or something based off that. Rather than looking at visual rects --- especially if they don't work --- the alternative is to look at the scrollbar. That reflects how far through the data the user is. One possible implementation is given in Pagination in QtableWidget, @raven-worx's algorithmic outline there. I have seen others (unfortunately can't find references) where the algorithm is to maintain the scrollbar height such that there is always a "gap" at the bottom which the user can scroll into, and that fires a fetch of more data and recalibration of the scrollbar, which still has a "gap" at the bottom. Think of when you use an application which produces large or endless output, like a web page receiving more and more data or showing photos where more and more are to come (e.g. some tumblr pages). The scrollbar always allows the user to scroll some more. @raven-worx's suggestion could be adapted to that. If you Google for stuff involving QTableWidget or QTableView and pagination you may find some useful code/ideas.
  • Build error when loading vs2019 project from qt creator

    Solved
    4
    0 Votes
    4 Posts
    263 Views
    jsulmJ
    @IknowQT You can define build folders for debug and release in QtCreator under Projects/Build & Run. Also, I would remove CONFIG += debug, debug/release mode is handled in QtCreator.
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    5 Views
  • How to determine if cell of a QTableWidget is currently visible?

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    eyllanescE
    @Publicnamer Yes. I only point out the limitations of your solution for future readers. I am not saying that it is bad for you but I only warn the possible inconveniences for other users.
  • Qt UI design for the PinePhone?

    Unsolved
    9
    0 Votes
    9 Posts
    917 Views
    P
    @mattfbacon I find that QT_SCALE_FACTOR=2 does an amazing job at scaling. But I'm also wondering, is it real scaling at the pixel level, or is it just an OpenGL trick that makes that window bigger but the number of pixels in the window is unchanged?
  • 0 Votes
    16 Posts
    7k Views
    R
    @jazzco2 Right, but what's the solution? If an older windows dll fixes things, I could try finding and swapping it P.S. that thread talks about a different issue. It is a crash not a warning with strange behaviour and there is no solution there either
  • Running Qt app on phone vs desktop

    Unsolved
    6
    1 Votes
    6 Posts
    470 Views
    P
    @Bonnie The real problem here is that a screen of any size can be used like a desktop, or a phone screen. For instance the Raspberry Pi 7" is always used like a desktop UI. Thus it is a question of "user interface idiom" i.e. how the screen is meant to be used.
  • QProcess::start and GDB leading to missing symbols / ?? in stack

    Unsolved
    6
    1 Votes
    6 Posts
    921 Views
    U
    Yes and no - it seems to have been solved in an update. I checked it right now and the issue does not persist. I did not really find out what caused the problems.
  • Run a pyFile(QApplication) from a button of another app

    Solved
    15
    0 Votes
    15 Posts
    1k Views
    JonBJ
    @Giakara Wow! So you are on Windows and were trying to run python3 as the executable! OK :)
  • Resizing the Panel Window

    Unsolved
    4
    0 Votes
    4 Posts
    430 Views
    SGaistS
    Do not forget to add the coding tags to make it readable. This code does not seem to include the whole of your interface.
  • Hot to copy QGraphicsPixmapItem ?

    Unsolved
    7
    0 Votes
    7 Posts
    614 Views
    M
    @SGaist yeah you catch me. I didn't. It's really hard to deep into such code, so previously I wanted to ask here advice what can I do with common framework oportunities.
  • QSettings access issue

    Unsolved
    7
    0 Votes
    7 Posts
    783 Views
    JonBJ
    @junzhe-fan said in QSettings access issue: Hi it in C:\Program Files folder and under the same dirctory as my exe file Just so you know. Used to be fine years ago. Now C:\Program Files\... (and the (x86) one) are no longer writable by users without admin elevation as a security guard. QSettings by default accesses .ini file for write as well as read, assuming you want to allow settings to be altered by user (do you?). So that's why it's best for you to put the file elsewhere and presumably causes your error situation. Much better than raising elevation on your program to permit it to write there. Or let QSettings use its default behaviour of using the Windows Registry, then this would not be an issue....
  • problems with stacked widgets

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    D
    Just to close this ... ... I got help from occ forum. ... adding setAttribute(Qt::WA_NativeWindow); to the View-Constructor changed behaviour of the View-class - which now works as expected :)
  • How to remove the intersection of a circle and a square?

    Unsolved
    3
    0 Votes
    3 Posts
    408 Views
    JoeCFDJ
    painter.fillRect( squre_rect, background color or black ); /*you may pay attention to the order of drawing */ Another way to do it is to use graphics items for different shapes and texts in your app. You can set display order for them.
  • Allocate QLabel of a QFrame inside a Slot function

    Unsolved
    3
    0 Votes
    3 Posts
    236 Views
    Pl45m4P
    @cjacquel2021 You need to assign the label to a layout or show() it. Doesn't matter where you create it. What do you mean by "QLabel of a QFrame"? Label inside the frame? Just add the label to the frame layout.
  • MySQL driver not loaded in other computers.

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    JonBJ
    @mengsen Of course! Open a Command Prompt. Type: set QT_DEBUG_PLUGINS=1, then <Enter> key. Run the executable (presumably by typing its full path). Look at what you get back in the Command Prompt. Try it first on your system where it works. Then try it where it does not. You are usually interested in the end of the diagnostic output, where it indicates why it could not load MySQL driver. EDIT Ohhh, I have a bad feeling that under Windows someone said the diagnostic output does not go to the terminal where you run from, like it does under Linux, instead it goes somewhere for Windows logging instead :( Yep, see https://www.qtcentre.org/threads/34927-QT_DEBUG__PLUGINS-Windows-7-where-does-it-log-information One post said "Then I use sysinternals debugview free utility to monitor the output at run-time." See post on this forum https://forum.qt.io/topic/41943/platform-plugin-windows/8 Hi, just an update on why QT_DEBUG_PLUGINS=1 doesn't work as expected when you launch a Qt app from the command line (as it does on Linux and Macs): I found that for Windows MSVC and MinGW compilers, Qt routes the texts to OutputDebugString(), that's why the CMD window shows no output. Instead, to see the output, download "Sysinternal's DbgView":http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx