Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Building a QInputDialog with only the "ok" button

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    Dummie1138D
    @Pl45m4 Thank you. I presume when you suggested building a custom QDialog class, that involves stuffing a QLineEdit into the QDialog?
  • how to pass the focus to next widget

    Unsolved
    3
    0 Votes
    3 Posts
    510 Views
    E
    @mpergand i got it, ty!
  • 0 Votes
    4 Posts
    446 Views
    JoeCFDJ
    @SteveBuchemy On linux run your code with strace: strace your release app Maybe you can find something. 2 .Run valgrind to check the debug build and maybe you can find something suspicious(for example, uninitialized variables). 3. Check all #if DEBUG block code to see if something is missing for release.
  • Hiding context button in Qt 5.15

    Unsolved
    2
    0 Votes
    2 Posts
    274 Views
    JonBJ
    @Dummie1138 said in Hiding context button in Qt 5.15: Qt::AA_DisableWindowContextHelpButton is to disable it application-wide, to be used on the QApplication object. If you want it only on this dialog try removing Qt::WindowContextHelpButtonHint instead? Something like: passwordBox.setAttribute(Qt::WindowContextHelpButtonHint, false);
  • Change size of qLabel frame when I update the labels text

    Solved
    2
    0 Votes
    2 Posts
    218 Views
    S
    @SOrton Fixed by using setFixedSize()
  • QTabWidget in QScrollArea scroll wheel event issues

    Unsolved
    2
    0 Votes
    2 Posts
    541 Views
    S
    @s0H57 Yep I have the same issue and just posted about it ... https://forum.qt.io/topic/143148/qtabwidget-in-qscroll-area-concurrent-scrolling Maybe a bug ?
  • Using Stacked Widgets

    Unsolved
    17
    0 Votes
    17 Posts
    4k Views
    Juan de DironneJ
    Thank you all for your past and your answers. Indeed I learned through your answers to set up a sharing of data and especially to understand how to organize the data and divide them well into classes. Thank you again :) After... It's not won, I have to get used to this gymnastics of the mind but I have grasped the principle.
  • How to process in the background without output to the screen

    Solved
    5
    0 Votes
    5 Posts
    540 Views
    JonBJ
    @serkan_tr From Windows you can do the equivalent of @Kent-Dorfman's Linux shell script in a .bat file which you run from QProcess. However there is a "wrinkle". @Kent-Dorfman's code allows for setup.sh setting environment variables for the following qtprogram call because in . $PATH_TO_SETUP/setup.sh that . at the start causes the setup.sh to be run in the same shell instance as the qtprogram which follows it. If you Windows .bat file just goes: c:\opt\ros\foxy\x64\setup.bat qtprogram then any environment variables set in setup.bat will not be inherited to qtprogram. And from For ROS to work , c:\opt\ros\foxy\x64\setup.bat must be run in a cmd and processes must be resumed in that cmd. I am guessing it may well set such variables. I believe call is the vital word to achieve what you need from a .bat file. It must be used when that executes any other .bat file which sets environment variables [actually I think this is necessary any time you want to call one .bat file from another and expect it to return into the first .bat file to continue]: call c:\opt\ros\foxy\x64\setup.bat qtprogram If this is put in some setupandrun.bat file you execute that via QProcess::start() (or startDetached()) I am not sure for a .bat file whether you can run it directly via start("/path/to/bat"), you might have to go start("cmd", { "/c", "/path/to/bat" }). Finally: I just did a test to see if you can avoid the need for the extra setupandrun.bat file you would have to write/distribute. I believe you can do that by: process->start("cmd", { "/c", R"(c:\opt\ros\foxy\x64\setup.bat & \path\to\qtprogram)" });
  • When modal window on top of mainwidget, i can still interact with mainwidger

    Unsolved
    20
    0 Votes
    20 Posts
    1k Views
    JonBJ
    @masa4 What I am saying is: If the principle works OK with the Qt virtual keyboard but not with your own coded version, your own code crashes, you say earlier I can try to solve the issue but what we actually try to learn? If I will be able to use my keyboard with QInputDialog, what will be the next thing? and when @jsulm suggests you "take a look at Qt virtual keyboard implementation to see how it is implemented" you reply "Its in qml, i dont know it". If you take all this I don't know what sort of "answer" you think you are going to get from anyone here, I don't see how they can help. Anyway you can wait and see if anybody offers anything from here.
  • Using QSharedDataPointer with default copy constructor

    Solved
    6
    0 Votes
    6 Posts
    493 Views
    A
    @SGaist Done
  • QGraphicsBlurEffect is so UGLY.

    Unsolved
    7
    1 Votes
    7 Posts
    814 Views
    QtFCQ
    I've been thinking about it too. On stackoverflow I saw an example of some simpler custom effect. I'm not sure I can write such an effect, it's not about the algorithm, you just need to add up the neighboring points and divide by their number. Main problem from where get these points and where to record them later. I think this is not an easy task. And in Python it will probably work slowly. Why not improve what is already there? Most likely, the texture scale is not correctly selected there. If large textures eat up performance, then this parameter should be made configurable.
  • Screen recording

    Solved screen recording
    3
    0 Votes
    3 Posts
    599 Views
    SavizS
    @SGaist Thank you. I tried using ffmpeg and it works like a charm.
  • Reading data from Serial Port is extremely slow

    Solved
    5
    0 Votes
    5 Posts
    595 Views
    serkan_trS
    @JonB Thank you
  • Can a QVector type data be sent from a C++ file to a QML file?

    Solved
    5
    0 Votes
    5 Posts
    364 Views
    serkan_trS
    @Asperamanca I removed QVector, I wrote all of them one by one, it is giving an error now
  • connect parent's member field to slot in a dialog child class

    Solved
    3
    0 Votes
    3 Posts
    274 Views
    J
    @Christian-Ehrlicher Thanks for your quick reply. I think I found the solution. With the updated syntax below the code calls the lambda slot in the MainWindow's constructor connect and it also calls the connection slot the dialog when if it is opened while the audio inputs or outputs are changed (by unplugging a headset for example). Up to this point, I was having a qobject_cast errors, as I was including the wrong header and incorrectly doing forward declarations. (parent below represents my mainwindow). The following code in the constructor of the SettingsDialog child class works well and more to the point, I no longer need to have duplicated objects (one in the MainWindow and a separate one in the SettingsDialog. // hot plugging audio support through parent field auto* mediaDevices = qobject_cast<MainWindow*>(parent)->mMediaDevices.get(); // audio input change handler - supports hot plug. // context parameter ensures auto disconnect. connect (mediaDevices,&QMediaDevices::audioInputsChanged, this, [this, &rSettings] { auto* pComboBox = ui->inputDevices; pComboBox->clear(); for (const auto& next : QMediaDevices::audioInputs()) { if (!next.isNull()) { pComboBox->addItem(next.description(), QVariant::fromValue(next)); } } // add generator device static auto gDevice = gGeneratorInfo->create(); pComboBox->addItem(gDevice.description(), QVariant::fromValue(gDevice)); const auto settingsDeviceName = rSettings.audioInput.description(); (void)settingsDeviceName; for (auto index = 0; index < pComboBox->count(); ++index) { // search for matching audio device in the settings if (pComboBox->itemData(index).isValid() && pComboBox->itemData(index).value< QAudioDevice>() == rSettings.audioInput) { pComboBox->setCurrentIndex(index); return; } } // device specified in settings unplugged - replace with default device pComboBox->setCurrentIndex( pComboBox->findData(QVariant::fromValue( QMediaDevices::defaultAudioInput()))); }); // audio output change handler - supports hot plug. // context parameter ensures auto disconnect. connect(mediaDevices, &QMediaDevices::audioOutputsChanged, this, [this, &rSettings] { auto* pComboBox = ui->outputDevices; pComboBox->clear(); for (const auto& next : QMediaDevices::audioOutputs()) { if (!next.isNull()) { pComboBox->addItem(next.description(), QVariant::fromValue(next)); } } // add rtp device static auto gDevice = gRTPDeviceInfo->create(); pComboBox->addItem(gDevice.description(), QVariant::fromValue(gDevice)); const auto settingsDeviceName = rSettings.audioOutput.description(); (void)settingsDeviceName; for (auto index = 0; index < pComboBox->count(); ++index) { // search for matching audio device in the settings if (pComboBox->itemData(index).isValid() && pComboBox->itemData(index).value< QAudioDevice>() == rSettings.audioOutput) { pComboBox->setCurrentIndex(index); return; } } // device specified in settings unplugged - replace with default device pComboBox->setCurrentIndex( pComboBox->findData(QVariant::fromValue( QMediaDevices::defaultAudioOutput()))); });
  • What features building Qt for Windows with ICU add?

    Unsolved
    1
    0 Votes
    1 Posts
    130 Views
    No one has replied
  • Acess denied when trying to debug a program

    Moved Unsolved
    2
    0 Votes
    2 Posts
    301 Views
    mzimmersM
    @Ken1 hi. I don't have an answer for you, but this isn't the right forum for such a question. "Announcements" is generally used for news from the mother ship (or significant third parties) to inform the user community of developments to the product. You'd likely get better answers posting to the Qt General --> General and Desktop forum. You can either delete this post and repost there, or wait for a moderator to move it for you. Good luck with your project.
  • QDialog::setGeometry() on Windows 10 / Linux

    Solved
    5
    0 Votes
    5 Posts
    568 Views
    R
    @Pl45m4 and @mpergand : Thanks! This was the solution -- a combination of both suggestions: // as above, then: pfcb->show(); pfcb->setFixedHeight(pfcb->minimumHeight()); // etc.
  • core5compat not found on macOS

    Solved
    5
    0 Votes
    5 Posts
    3k Views
    C
    @Bonnie Thank you! It is a so bad mistake of mine that I should get ashamed. However, this completely solves my issue. Thank again
  • 0 Votes
    6 Posts
    3k Views
    W
    @JonB I moved my code into QGraphicsView::drawBackground() as you recommended, it works nicely. Thanks a lot!