Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.7k Posts
  • 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.
  • how to get path of current directory in Qt

    Unsolved
    3
    0 Votes
    3 Posts
    367 Views
    raven-worxR
    @Qt-Enthusiast See the QDir and QFile docs and how to get the path of currect directoty QDir::current(), or do you mean of the executable? FOr the executable see QCoreApplication::applicationDirPath()
  • Qt missing ?

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    P
    I don't know why it work this time, but i tried once more to uninstall and reinstall, and it seems to work just fine ... Weired, but i gess you can close the subject now, thanks for all answears
  • Optimization source code

    Unsolved
    5
    0 Votes
    5 Posts
    620 Views
    sierdzioS
    @fender said in Optimization source code: QString format = "%0%1%2%3%4%5%6%7%8%9%10%11"; That value is overwritten later in format = tokens.join("-"); so you can remove the string data and just leave QString format;. format .arg(data_[highLimit]) .arg(data_[pressure]) .arg(data_[modification]) .arg(data_[3]) .arg(data_[4]) .arg(data_[5]) .arg(data_[6]) .arg(data_[7]) .arg(data_[8]) .arg(data_[9]) .arg(data_[10]) .arg(data_[11]); That code does not do anything, you can remove it completely.
  • 0 Votes
    8 Posts
    2k Views
    E
    How do you think about the usage of customised constructor implementations for the class “QStandardItem”?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    64 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    8
    0 Votes
    8 Posts
    53 Views
  • 1 Votes
    6 Posts
    2k Views
    SGaistS
    No, gstreamer is the Linux backend. On Windows, IIRC it's DirectX for the camera access.
  • QT drag and drop of image size problem after taking multple view port?

    Solved
    7
    0 Votes
    7 Posts
    860 Views
    mrjjM
    Hi Just to be sure. you are asking about the SIZE of the openGl widget and not the size of the openGl viewport ? https://bugreports.qt.io/browse/QTBUG-64635
  • how to create a following Dialogue in the image

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    mrjjM
    @Qt-Enthusiast You cant. QInputDialog is predefined and cannot be altered. You will have to design it like the other.
  • How can I get QTextEdit to not alter my HTML?

    Solved
    10
    0 Votes
    10 Posts
    2k Views
    H
    Finished! ...As far as I could see. I still have to write some unit tests to be sure there are no major problems. Also added documentation to the readme. @JonB If I knew ahead of time I was going to have to write an html->markdown parser (MarkdownPanda) as well as a special Qt HTML exporter I probably would've went the way of QtWebEngine at least for the minimal viable product version of my app. Too late now, but I am happy with the current setup. I am building a note-taking application called Vibrato Notes and the HTML will not be editable in any way by the user - markdown and rich text will be the two formats of choice. The Escriba editor I mentioned earlier is a fork of MRichTextEditor which paved away a lot of work for me.
  • How to programmatically change the currentIndex of QTableView's comboBox. ?

    Unsolved
    9
    0 Votes
    9 Posts
    3k Views
    A
    @SGaist Here is the setModelData function that is called when an item from the combobox is selected from the UI: void ComboBoxItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { if (QComboBox* cb = qobject_cast<QComboBox*>(editor)){ qDebug()<<"hello, i have been called from the setModelData"; } else QStyledItemDelegate::setModelData(editor, model, index); } But when i tried to set the data of the combobox (that is found in index (0,0)) to "Item A" by the following: ui->tableView->model()->setData ( ui->tableView->model()->index(0,0), "Item A, Qt::EditRole); the combobox's value was set successfully, but the ComboBoxItemDelegate::setModelData function was not called, and this is my problem
  • How to programmatically change the currentIndex of comboBox using QStandardItemModel ?

    Unsolved
    2
    0 Votes
    2 Posts
    291 Views
    SGaistS
    Hi, Isn't that basically the same question as your other thread ?
  • [SOLVED] Network Problems (QTcpSocket, QTcpServer)

    network qtcpsocket qtcpserver
    6
    0 Votes
    6 Posts
    8k Views
    S
    I just wanted to tack a me-too on here. I've been converting a QTcpServer app over to 64-bit and it immediately stopped receiving signal. Connecting a 64-bit client to a 32-bit server still worked, so the problem had to be in the 64-bit server or one of the dependencies. As it turned out, the incomingConnection() had an int argument instead of a qintptr, a change we missed when upgrading to Qt5.
  • Cannot use android profile

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    A
    @Eeli-K exactly!
  • How to activate QActions from keypresses?

    Unsolved
    3
    0 Votes
    3 Posts
    364 Views
    ValentinMicheletV
    To complete JonB’s answer, you have several ways to specify a shortcut for an action: action->setShortcut(QKeySequence::Copy); action->setShortcut(QKeySequence(Qt::CTRL+Qt::key_v)); action->setShortcut(QKeySequence("CTRL+V");
  • QSqlTableModel, how to show png images in table

    Unsolved
    5
    0 Votes
    5 Posts
    609 Views
    VRoninV
    Or use a delegate like here: https://forum.qt.io/topic/94494/qsqlquerymodel-and-qpixmap-s-alignment In that case pixmapY is static but nothing stops you reading it from index.data()
  • is offical mqt has not Autoreconnect future as in the emqtd ?

    Unsolved
    9
    0 Votes
    9 Posts
    1k Views
    R
    I mean official qmqtt , is there any auto reconnect ? or how can I properly re-connect if there is disconnection etc ?
  • QNetworkAccessManager seems to leak with every retry

    Solved qnetworkaccessm networking memory
    10
    0 Votes
    10 Posts
    3k Views
    S
    Okay I found the culprit in an unexpected corner. I decided to completely strip it to the absolute bare minimum: int main(int argc, char *argv[]) { QCoreApplication app (argc, argv); // initialization Sms_notifier notifier(true, 5); notifier.notify( "+0123456789", "Lorem Ipsum is simply dummy text of the printing and typesetting industry. "); qWarning() << "done, looping"; while(true) { QCoreApplication::exec(); } } Sms_notifier::Sms_notifier(bool test, int interval_length_milliseconds) : QObject (NULL) ,m_test (test) ,m_interval_length_milliseconds(interval_length_milliseconds) ,m_manager () ,m_timer () ,m_addressee() ,m_payload() { m_timer.setSingleShot(true); QObject::connect(&m_manager, &QNetworkAccessManager::finished, this, &Sms_notifier::on_nam_finished); QObject::connect(&m_timer, &QTimer::timeout, this, &Sms_notifier::on_timer_elapsed); } Sms_notifier::~Sms_notifier() { } bool Sms_notifier::notify( const std::string addressee, const std::string payload ) { m_addressee = addressee; m_payload = payload; return notify(); } bool Sms_notifier::notify() { QNetworkRequest request; QByteArray data; m_manager.post(request, data); return false; } void Sms_notifier::on_nam_finished(QNetworkReply* reply) { QNetworkReply::NetworkError error = reply->error(); reply->deleteLater(); if (error != QNetworkReply::NetworkError::NoError) { m_timer.start(m_interval_length_milliseconds); } else { qWarning() << "success"; m_addressee.clear(); m_payload.clear(); } } void Sms_notifier::on_timer_elapsed() { notify(); } It turns out it was still leaking while there was no network. So I stripped away all libraries that were linked, and it still leaked. Eventually my eye struck this in the .pro file: QMAKE_CXXFLAGS += -fsanitize=address QMAKE_CFLAGS += -fsanitize=address QMAKE_LFLAGS += -fsanitize=address -lasan This was added to detect memory leaks and report them when the application quits. After removing this, the excessive "memory leak" was gone. I am assuming that the address sanitizer allocates memory for each allocation done by the application, for its own administration purposes. I suspect that when the application releases the allocated memory, the sanitizer holds on to the respective administration data until the application quits. This could explain why when I remove the sanitizer it also removes the leak. Well, thanks everyone for your input!
  • How to get the current SSID? What are QNetworkConfigurations?

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