Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.3k Posts
  • Qt Creator 4.12.4 - Strange issues when clock set back

    Solved
    2
    0 Votes
    2 Posts
    159 Views
    JonBJ
    @Nubcake It will be because some existing files are "newer" than those you now create "today". Makes, and checking debug builds against source code, are timestamp based. Not a Creator issue. Make sure you start off with all intermediate files deleted. But yes, if you keep setting the clock back you will encounter this sort of issue.
  • I'm trying to make a GUI for ROS and I get these errros.

    Solved
    7
    0 Votes
    7 Posts
    901 Views
    A
    @SGaist said in I'm trying to make a GUI for ROS and I get these errros.: "Ui::MainWindow" He told me to delete namespace. I thought that he meant namespace Ui { class MainWindow; } and I deleted this. I wrote back again and now works. Thank you.
  • New user - Qt5 Creator IDE displaying 'errors' although compiles ok

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    JonBJ
    @JohnM64 Well this hasn't resolved the issue of getting your clang code model working in Creator, it has just switched it off! You will get a different editing aid experience. If you are happy without clang that is OK for you.
  • Making good UIs

    Unsolved
    4
    0 Votes
    4 Posts
    258 Views
    SGaistS
    The thing is: you have guidelines you can base your GUI for the various platform Qt targets. For the rest it depends highly on the type of application you want to do.
  • QLabel Pixmap doesnt match with true size

    Unsolved
    14
    0 Votes
    14 Posts
    1k Views
    mrjjM
    @Infestor Super well i have had other cases with mysterious gaps and your "~10 pixel wide border " reminded me. Well then you dont leak it then but you also don't need to as QPixmap is meant to be copied (and its cheap) QPixmap p("minimap.png"); l->setPixmap(p); is better as then we cant forget to delete the pixmap and setPixmap copies it anyway. When ever you need to use * with Qt classes you give to other Qt class, its a sign you shouldn't need to new it.
  • Emulate a javascript function in a qss stylesheet

    Solved
    4
    0 Votes
    4 Posts
    372 Views
    K
    If I get it right, you can try CSS-like states (or pseudo-classes). For example, consider a button with the next style: QToolButton#MyBtn { background-color: #000; } QToolButton#MyBtn:hovered { background-color: #FFF; } It is black by default and white when hovered.
  • PrintPreviewDialog issue on 4K monitor

    Solved
    4
    0 Votes
    4 Posts
    326 Views
    Cobra91151C
    I have found some hack to get the toolbar actions from a print preview dialog. By adding some additional logic it fixed the issue. QList<QToolBar*> toolbarList = printPreviewDlg->findChildren<QToolBar*>(); if (!toolbarList.isEmpty()) { if (screenSize.width() > 1920 && screenSize.height() > 1080) { toolbarList.first()->actions().at(0)->activate(QAction::Trigger); } else { toolbarList.first()->actions().at(1)->activate(QAction::Trigger); } } To detect the screen size I use the native Win API methods. Now, it automatically triggers the Fit to width toolbar option and sets a better preview on 4K monitor. It works depending on the screen size. The issue is resolved.
  • Question about widgets on a form (beginner)

    Unsolved
    3
    0 Votes
    3 Posts
    189 Views
    W
    Thanks. Roberto
  • Resizing problems, dragging when it is not allowed

    Solved qtwidgets resize dragging borderless wind
    3
    0 Votes
    3 Posts
    836 Views
    K
    SetMinimumSize() does not work for me. I think it is because I change the window's position. However, the problem was in my form file. For an unknown reason, it changed the window's size to 802x600 when I was checking for 800x600. Maybe there was some another way out, but now all works just fine.
  • 0 Votes
    2 Posts
    579 Views
    Christian EhrlicherC
    You asked a similar question one week ago: https://forum.qt.io/topic/124033/
  • reading and writing a utf16 string inside a qdatastream operator

    Unsolved
    12
    0 Votes
    12 Posts
    943 Views
    mrjjM
    @Styx Yes its possible but you cannot do it via readstream << m_people.Name; as here you read in QString via QDataStream and Qstring would normally add its length to the stream before the actual text data. But since you did NOT use QDataStream to save the QString, it will read it wrong. So you must read back your string using "raw" reading just as you wrote it. Its important to understand that all Qt Types can save and load themself. They also save the size for strings and containers. So if you try to mix it with raw format, you have to be really careful as else it simply will read it wrong. As @Christian-Ehrlicher shows, is how Qt does it by itself. No handling of sizes as the classes does that themself. So you really are complicating it for your self and I hope there is a good reason as else just changing to use QDataStream &operator<< and >> for saving and loading is much less error-prone. :)
  • How to remove a ' from a string Qt 6.01

    Solved
    4
    0 Votes
    4 Posts
    305 Views
    S
    problem it was actually a right quote not a apostrophe and the remove("") function works beautifully.
  • QT 6.0.1 Windows 10x64 - an empty default console app can't be started

    Solved
    2
    0 Votes
    2 Posts
    439 Views
    A
    Found solution: it was very easy, but need to add to PATH environment variable: c:\Qt\6.0.1\mingw81_64\bin And now it builds and runs successfully. p.s. And if to check the box: Projects / Run / Run in terminal - an app. will start is a separate console, as c# console app under Visual Studio :)
  • error on build for qwt 6.1.6

    Moved Solved
    12
    0 Votes
    12 Posts
    2k Views
    S
    I recompiled qwt 6.2 with no errors. Tried a few different configuration. I removed the plugin file from within Qt. Then I retried qwt-6.1.5 again and BINGO - the widgets are up and working. Thank you for your expert guidance on this.
  • Keep animation/widget state on widget enter event

    Unsolved
    4
    0 Votes
    4 Posts
    216 Views
    SGaistS
    I would have put the hide in the else after the elif within the EnterEvent handling.
  • qss and children objects

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    magrifM
    @JonB said in qss and children objects: Did you try Hi Same results and with QWidget:hover > QPushButton { ... and with QWidget#widget:hover > QPushButton#btn { ... :(
  • 0 Votes
    8 Posts
    4k Views
    Christian EhrlicherC
    Why not use QDateTime (when you already ask a c++ only question in a Qt forum ;) )
  • How to parse an command line argument string into a QStringList for QProcess ?

    Solved
    12
    0 Votes
    12 Posts
    2k Views
    L
    @JonB Thanks it worked like magic. QString executable = "x264.exe"; QString arguments = " -i xxxxx -o test.mp4"; QStringList argumentsList = QProcess::splitCommand(arguments); process->start(executable, argumentsList );
  • Asymmetrical layout?

    Unsolved
    4
    0 Votes
    4 Posts
    526 Views
    D
    Answering my own question.... It's not a percentage. It seems to be some sort of relative scale where higher numbers get more scaling than lower numbers, but the numbers do not directly correlated to the percentage the widget scales. Kind of a weird system but with some trial and error I was able to get the results I wanted.
  • This topic is deleted!

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