Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 456.8k Posts
  • QTcpServer across threads

    Unsolved
    2
    0 Votes
    2 Posts
    370 Views
    VRoninV
    from google I know that QTcpSocket must be created and accessed in the same thread This is not the case Have a look at this example: https://wiki.qt.io/WIP-How_to_create_a_simple_chat_application
  • Modbus: exception 0x5

    Unsolved
    1
    0 Votes
    1 Posts
    411 Views
    No one has replied
  • GUI design - how to properly activate "whats this" help

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    mrjjM
    Hi Well shift+F1 hovering mouse cursor over a widget Widgets will shows its WhatisThis property. Also works on QMenu items so should also works on context menu although i didnt test it. You can use setWindowFlags(Qt::Window | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint); to set it on a MainWindow type window, but it wont have min/max then. Its not supported on/by Windows. alternatively , add it to status bar. auto button = new QPushButton("?"); button->setMaximumSize(32, 32); connect( button, &QPushButton::clicked, []() { QWhatsThis::enterWhatsThisMode(); } ); ui->statusBar->addPermanentWidget( button ); Works quite well. [image: LQB0PF.png] -- Normally people use tooltips which is supported in most places/types of windows. Adding a button to the titlebar is not possible with Qt. (alone)
  • QGraphicsScene performing "poorly" on dense scenes

    Solved
    20
    0 Votes
    20 Posts
    5k Views
    rkhaotixR
    @mrjj Yeah... I'm aware of that entry on PostgreSQL wiki :D
  • 0 Votes
    35 Posts
    10k Views
    E
    I don't understand this question. How do you think about information from Cppcheck's forum and issue tracker? Do you care for software aspects which can be discussed there?
  • Strange crash with QObject hierarchy deletion

    Unsolved
    16
    0 Votes
    16 Posts
    4k Views
    kshegunovK
    @pozdnyakov said in Strange crash with QObject hierarchy deletion: But it's nice to know that I've found a bug and it's not just some misunderstanding on my side. It's been making me crazy for the last day or so :) Thiago says it won't be fixed. So act accordingly.
  • QImage

    Unsolved
    8
    0 Votes
    8 Posts
    946 Views
    mrjjM
    @satyanarayana143 Sure https://www.dropbox.com/s/fladys1ao8cj5gq/centerlabel.zip?dl=0
  • Timer problem

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    JonBJ
    @kshegunov Yes! Just what I want! :)
  • how to decrypt a encrypted data?

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    VRoninV
    @ManiRon said in how to decrypt a encrypted data?: want to encrypt both password Very easy to understand yet informative: https://www.youtube.com/watch?v=8ZtInClXe1Q
  • How to scan and connect wifi in linux with QT API?

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    raven-worxR
    @victor-wang using D-BUS (QtDBus) is an option see this
  • Performance comparison: eglfs and linuxfb in QWidget based applications

    Solved
    3
    0 Votes
    3 Posts
    901 Views
    J
    Thanks for your feedback. Appreciated.
  • How to creating new file to designated path

    Solved
    11
    0 Votes
    11 Posts
    14k Views
    V
    @mrjj said in How to creating new file to designated path: @victor-wang Hi there is http://doc.qt.io/qt-5/qfiledevice.html#error Thanks alot ! I will look into it!
  • QImage::setColorTable for RGB16 does not work?

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    W
    @jakub_czana What format was the 16 bit image in? It's very unusual to have a 16 bit indexed image. I don't think I've ever run across something like that. Most 16 bit formats will already be some sort of RGB. You'd need a 65535 entry color table for a 16 bit indexed image. Just packed 8 bit RGB values would make the color table as large as a whole 512x384 a bit image. Which is why I am still curious about what use-case originally inspired your question. If you have a single channel of 16 bit data that you want to colorize for display, you can do that with a small LUT, rather than a full color table. Something like viewing an X-Ray in false color might use that sort of approach. You might want to look into a library like OpenColorIO for doing LUT handling if that's closer to your underlying use case.
  • QTableWidget's. setText() does not set any text to cells

    Unsolved
    3
    0 Votes
    3 Posts
    9k Views
    I
    Try, QTableWidgetItem *item = new QTableWidgetItem; item->setText("danny"); ui->tablewidget->setItem(2, 2, item);
  • Play an audio file in milliseconds

    Unsolved opengl sfml multimedia qtmultimedia audio
    4
    0 Votes
    4 Posts
    1k Views
    H
    https://drive.google.com/file/d/1SHw3k6gY9pz8cL7skhDUPUf2NrwF4xeE/view
  • Qt is shifting the old widget content during a resize

    Unsolved
    2
    0 Votes
    2 Posts
    328 Views
    Christian EhrlicherC
    @qt101 said in Qt is shifting the old widget content during a resize: Can anyone explain how to do this? Not without seeing a sample code which demonstrates the issue. Which platform do you use and which Qt version? I'm not aware of such a problem on Linux and Windows
  • adding widgets to UI on the fly

    Solved
    7
    0 Votes
    7 Posts
    939 Views
    mzimmersM
    Hey guys - thanks for the corrections. I've edited my prior post, correcting the destructor.
  • Writing raw data to a file using QFile

    Unsolved
    16
    0 Votes
    16 Posts
    9k Views
    mrjjM
    @J.Hilk Works fine :) template< class aType > qint64 write( QFile& file, aType var ) { qint64 toWrite = sizeof(decltype (var)); qint64 written = file.write(reinterpret_cast<const char*>(&var), toWrite); if (written != toWrite) { qDebug () << "write error"; } qDebug () << "out: " << written; return written; } template< class aType > qint64 read( QFile& file, aType &var ) { qint64 toRead = sizeof(decltype (var)); qint64 read = file.read(reinterpret_cast<char*>(&var), toRead); if (toRead != read) { qDebug () << "read error"; } qDebug () << "in: " << read; return read; } QFile file("e:/test.txt"); if (!file.open(QFile::WriteOnly)) { return; } uint8_t var1 = 10; uint32_t var2 = 20000; float var3 = 10.8; write(file, var1); write(file, var2); write(file, var3); file.close(); var1 = 0; var2 = 0; var3 = 0; if (!file.open(QFile::ReadOnly)) { return; } read(file, var1); read(file, var2); read(file, var3); qDebug() << " result = " << var1 << " " << var2 << " " << var3; out: 1 out: 4 out: 4 in: 1 in: 4 in: 4 result = 10 20000 10.8 but file is fragile to platform change etc.
  • WindowSystemMenuHint strange bug

    Solved
    14
    0 Votes
    14 Posts
    2k Views
    mrjjM
    @Engelard ok, odd. worked for my dialog.
  • After adding crypto++ lib application is crashing....

    Unsolved
    20
    0 Votes
    20 Posts
    2k Views
    Pablo J. RoginaP
    @Bharth mmm no debug settings for Boost... I'm suspicious that you might be mixing release and debug version of the application and libraries.