Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
82.7k Topics 452.4k Posts
  • Reporting inappropriate content on the forums

    Pinned Locked
    29
    3 Votes
    29 Posts
    28k Views
    A

    Thank you for the report. I have banned the user, which got rid of the spam posting. Not a loss, as this user did not post any other content on the site. Just deleting this one posting was not possible.

    Thanks for reporting this.

  • QString destructor crash

    Unsolved
    3
    0 Votes
    3 Posts
    12 Views
    B

    @Christian-Ehrlicher

    Pardon me, but how do I make sure to compile in release? If I set CMAKE_BUILD_TYPE to Release, the issue stays the same

  • drawControl not being called for custom styled elements

    Unsolved
    10
    0 Votes
    10 Posts
    56 Views
    Christian EhrlicherC

    Start from the example in https://doc.qt.io/qt-6/qproxystyle.html#details and see what happens.

  • Cannot determine dependencies of qtposition_nmea.dll

    Unsolved
    8
    0 Votes
    8 Posts
    186 Views
    D

    @jsulm said in Cannot determine dependencies of qtposition_nmea.dll:

    @davecotter I'm wondering why qtposition_nmea.dll should depend on Qt6SerialPort?! Strange.

    i wonder the same.
    also why does it depend on QtQuick?

  • QSignalSpy verify emission order

    Solved
    8
    0 Votes
    8 Posts
    59 Views
    C

    @GrecKo said in QSignalSpy verify emission order:

    You don't have to use QSignalSpy, you could store the received signals in an ordered list:

    QStringList receivedSignals; QObject::connect(&inst, &MyClass::started, &inst, [&] { receivedSignals.append("started"); }); QObject::connect(&inst, &MyClass::finished, &inst, [&] { receivedSignals.append("finished"); }); inst.doSomething(); QStringList expectedSignals = {"started", "finished"}; QCOMPARE(receivedSignals, expectedSignals);

    That makes sense. I figured that using an external mechanism would do the trick, though your idea with a lambda populating a QStringList is far simpler than what I was cooking up. I was hoping for a simple solution, and this looks like it'll be the simplest way of achieving my goal.

    Thanks!

  • Adjust QListWidget contents to adjust to Dialog size

    Unsolved
    3
    0 Votes
    3 Posts
    48 Views
    G

    I entered the following code and it didn't do anything.

    soReport->setResizeMode(QListWidget::Adjust);
  • 0 Votes
    1 Posts
    22 Views
    No one has replied
  • 0 Votes
    3 Posts
    33 Views
    L

    Oh yes, thank you. That was a total thinking failure. What I actually wanted to test was something like that:

    { Nix nix4(4, "Hello, I'm four"); *nix1 = nix4; } qWarning() << "nix1: " << nix1->display(4);

    And that works.

    *nix2 = *nix1; delete nix1

    works too

    Thanks, solved!

  • qt6 qt creator acceptTouchEvents on x11 ubuntu

    Unsolved
    18
    0 Votes
    18 Posts
    663 Views
    Q

    Any new on how to solve the problem

  • 0 Votes
    5 Posts
    3k Views
    R

    @shavera said in Is there a canonical way to set up QApplication and Google Test together?:

    After many iterations, I've finally found what I think works well here:

    int main(int argc, char *argv[]) { QCoreApplication app{argc, argv}; QTimer::singleShot(0, [&]() { ::testing::InitGoogleTest(&argc, argv); auto testResult = RUN_ALL_TESTS(); app.exit(testResult); }); return app.exec(); }

    it works for me

  • 0 Votes
    4 Posts
    1k Views
    C

    @nyaruko said in Qt warning of type conversion already registered:

    I have a multi-thread Qt program...

    This is a common cause of issues of all flavours. It may be as simple as the same setup code for shared configuration, e.g. the metatype database, executing in multiple threads.

    @ocgltd said in Qt warning of type conversion already registered:

    Any way to track this down?

    You could provide a minimal program that invokes the message, some basic Qt version information, tool chain information, etc. Something that happens twice in ten years here and spans many Qt versions is not likely to have an immediate, "I've seen that before," response.

  • 0 Votes
    4 Posts
    78 Views
    SGaistS

    I am not sure to understand your phrase correctly.

    So the rule is: if you create a QWidget subclass where you want to use style sheets, then it needs both the Q_OBJECT macro and the paintEvent reimplementation.

  • drawPrimitive does not draw over all primitive elements

    Unsolved
    5
    0 Votes
    5 Posts
    62 Views
    A

    @Christian-Ehrlicher Thank you, I figured it out, using opt->rect's x and y attributes draws it in the correct place.

  • Unit Testing with multiple .cpp files

    Unsolved
    8
    0 Votes
    8 Posts
    146 Views
    SGaistS

    You are not linking against the library you are testing.

  • mac style: merged title bar and content area?

    Solved
    9
    1 Votes
    9 Posts
    785 Views
    D

    workaround: Add Qt::NoTitleBarBackgroundHint window flag

  • qt-v6.5.4-lts-lgpl cross compile for windows

    Unsolved
    1
    0 Votes
    1 Posts
    20 Views
    No one has replied
  • 0 Votes
    1 Posts
    46 Views
    No one has replied
  • QComboBox styling is not dyamic

    Unsolved
    3
    0 Votes
    3 Posts
    94 Views
    O

    @SGaist I am on windows.

  • 0 Votes
    10 Posts
    169 Views
    JonBJ

    @Mark81
    It is "difficult" because you do not have a proper foreign key relation, which is what QSqlRelationalTableModel requires. Having some other column (eventType) whose value dictates which of multiple tables (alarms, sessions, ...) is the foreign one in which to look up the key column's value is supported neither in SQL nor Qt's QSqlRelationalTableModel --- it is not allowed in the definition of a foreign key.

    Either think about redefining/rearchitecting your intended relationships which fits better with SQL or (in my opinion) give up trying to use QSqlRelationalTableModel. Instead read in the contents of all required/linked tables into their own normal QSqlTableModels, as well as the original "source" table, and implement your desired logic yourself in client code as required for your desired behaviour.

  • 0 Votes
    2 Posts
    46 Views
    Pl45m4P

    @nicker-player

    Set a stylesheet?!