Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • VPN Client for windows

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    S
    @md2012 dear friend,I have seen that your problem had been solved. Now I want make a vpn connection between my software to my server. I get username / password / IP and .... in Json from my server.and I want make a VPN connection using tunel encryption and IPSec. Can you help me please?
  • How to get this layout?

    Unsolved
    4
    0 Votes
    4 Posts
    299 Views
    SGaistS
    You can put the "container" widget in a QScrollArea.
  • What is the correct steps for compiling Qt5.13 on the Raspberry pi 4?

    Unsolved
    2
    0 Votes
    2 Posts
    222 Views
    sierdzioS
    You might try https://wiki.qt.io/RaspberryPi2EGLFS but I have no idea if it works with RPi 4.
  • Run build for all platforms at once. How?

    Unsolved
    5
    0 Votes
    5 Posts
    432 Views
    SGaistS
    Hi, Yes, you assign several Kits in your project configuration and then you can build them.
  • Bug at QTabWidget / QWidget resizeEvent ?

    Solved
    6
    0 Votes
    6 Posts
    657 Views
    W
    Hi! I not find what cause the behaviour, but reimplementing the resizeEvent() in all the Widget "Tree" (Becouse there a lot of Widgets inside of other Widgets) , The Strange behaviours start to stop. So, for me i will reimplement this to not worry about it in future. Thanks a lot for any help anyway. ;) Kind Regards. Wolff
  • Error: module "QtQuick.VirtualKeyboard.Settings" version 2.13 is not installed

    Solved
    11
    0 Votes
    11 Posts
    2k Views
    C
    @sierdzio I am trying to come up with a band-aid for it. Something like: MouseArea { anchors.fill: parent onClicked: { Qt.inputMethod.hide //Something like this (not working) //but something similar? if (!inputField.readOnly) editingValue.forceActiveFocus() } } EDIT: Managed to put on a band-aid by calling hide() when onActiveFocusChanged{} is called, works for me.
  • Problems with HTTP POST X-www-form-urlencoded key with dots or _

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    Pablo J. RoginaP
    @grove said in Problems with HTTP POST X-www-form-urlencoded key with dots or _: Because i'm on a VPN line and it's a ssl connection it's not easy to get the data Just for debugging purposes, change the URL to some local non-SSL test server and capture the traffic then.
  • can we place a widget over a pushbutton

    Unsolved
    7
    0 Votes
    7 Posts
    586 Views
    M
    You can set the parent of your object or widget with the constructor. https://doc.qt.io/qt-5/qwidget.html#QWidget take a second to read what the constructor says about the parent argument. MyWidget *myWidgetPtr = new MyWidget(pushBtnPtr);
  • 0 Votes
    1 Posts
    956 Views
    No one has replied
  • QVideoFrame::availableMetaData() is always empty

    Unsolved
    1
    0 Votes
    1 Posts
    213 Views
    No one has replied
  • How to pass and invoke lambda function at slot ?

    Solved
    12
    0 Votes
    12 Posts
    3k Views
    H
    @kromignon Thanks. I had also read that article, but that also not defines how Qt handle this stuation: In this version, we pass monitor as a context to connect(). It won't affect the execution of our lambda, but when monitor is deleted, Qt will notice and will disconnect Worker::progress() from our lambda. I tried with below, but could not find how to detect I have already disconnect: connect(receiver, &QObject::destroyed, [this](){ qDebug() << "receiver destroyed"; m_msgBox->disconnect(); }); Full code with receiver (deletes btn after 10 sec!): #include <QApplication> #include <QMessageBox> #include <QPushButton> #include <QDebug> #include <QScreen> #include <QStyle> #include <QTimer> class Button : public QPushButton { Q_OBJECT public: Button(QWidget *parent = nullptr) : QPushButton(parent) { setText(tr("Click")); m_msgBox = new QMessageBox(this); connect(this, &QPushButton::clicked, [this](){ ask(tr("Which do you prefer?"), QStringList() << tr("Apple") << tr("Pineapple"), 0, 1, this, [](int result) { if (result == 0) qDebug() << "Selected Apple"; else if (result == 1) qDebug() << "Selected Pineapple"; else qDebug() << "Unexpected result = " << result; }); }); } virtual ~Button() {} void ask( const QString & text, const QStringList & buttons, int acceptButton, int rejectButton, const QObject * receiver, std::function<void(int)> func) { m_msgBox->setText(text); m_msgBox->setIcon(QMessageBox::Question); m_msgBox->setStandardButtons(QMessageBox::NoButton); QList<QAbstractButton*> buttonList; for (int i = 0; i < buttons.count(); ++i) { if (i == acceptButton) { QPushButton * btn = m_msgBox->addButton(buttons.at(i), QMessageBox::AcceptRole); m_msgBox->setDefaultButton(btn); buttonList.append((QAbstractButton*)btn); } else if (i == rejectButton) { QPushButton * btn = m_msgBox->addButton(buttons.at(i), QMessageBox::RejectRole); m_msgBox->setEscapeButton((QAbstractButton*)btn); buttonList.append((QAbstractButton*)btn); } else { Q_ASSERT(false); } } connect(m_msgBox, &QMessageBox::finished, [this, rejectButton, buttonList, func](int) { m_msgBox->disconnect(); int res = rejectButton; for (int i = 0; i < buttonList.count(); ++i) { if (m_msgBox->clickedButton() == buttonList.at(i)) { res = i; break; } } QList<QAbstractButton*> listToDelete = m_msgBox->buttons(); foreach (QAbstractButton * btn, listToDelete) { m_msgBox->removeButton(btn); btn->deleteLater(); } func(res); }); connect(receiver, &QObject::destroyed, [this](){ qDebug() << "receiver destroyed"; m_msgBox->disconnect(); }); m_msgBox->open(); } private: QMessageBox * m_msgBox = nullptr; }; int main(int argc, char *argv[]) { QApplication a(argc, argv); Button * btn = new Button; btn->resize(100, 30); btn->setGeometry( QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, btn->size(), qApp->screens().first()->availableGeometry())); btn->show(); QTimer::singleShot(10000, [&](){ delete btn; btn = nullptr; }); int res = a.exec(); if (btn) delete btn; return res; } #include "main.moc"
  • Change video brightness in QGraphicsView not working!

    Solved
    13
    0 Votes
    13 Posts
    2k Views
    Pl45m4P
    @vicky-vigia Here's everything you need to know about QLabel (https://doc.qt.io/qt-5/qlabel.html) setPicture or setPixmap for single images / frames (In one of my projects I use OpenCV to display video frames from webcam on a QLabel).
  • 0 Votes
    3 Posts
    616 Views
    G
    I don't think it has anything to do with QNetworkInface but with debug in general. I have the same output.
  • This topic is deleted!

    Solved
    8
    0 Votes
    8 Posts
    85 Views
  • 0 Votes
    2 Posts
    645 Views
    W
    I found a workable solution. The trick is to use QWindow::setScreen() which redraws the window at the screens scaling. So I ended up with something like this: QScreen *m_screen=QGuiApplication::screenAt(position); QWindow *m_handle=this->windowHandle(); if (m_handle && m_screen) { m_handle->setPosition(position); m_handle->setScreen(m_screen); }
  • pyqt5 application devlopement

    Unsolved
    1
    0 Votes
    1 Posts
    124 Views
    No one has replied
  • UI Multithreading

    Unsolved
    10
    0 Votes
    10 Posts
    923 Views
    W
    @rickm Basically, you can process your audio, and prepare your QImages in other threads, but actually updating the UI has to be done in the main thread. The GUI itself is not thread safe.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    23 Views
    No one has replied
  • Error when using QSignalSpy

    Unsolved
    6
    0 Votes
    6 Posts
    715 Views
    SGaistS
    Then you should rather check the lifetime of the objects that are connected.
  • Could I convert ui to qml quickly

    Unsolved
    2
    0 Votes
    2 Posts
    315 Views
    SGaistS
    Hi, What device is that ?