Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.3k Posts
  • Create a rule that series colors do not overlap

    Unsolved
    2
    0 Votes
    2 Posts
    256 Views
    JonBJ
    @IknowQT What "line series"? Should I guess QLineSeries on a Qt chart? Since there is a QXYSeries::setColor(const QColor &color) method you can specify a specific color for each series.
  • Subclass of QQuickItem in a namespace

    Unsolved
    1
    0 Votes
    1 Posts
    152 Views
    No one has replied
  • Performance problem filling a QJsonArray

    Unsolved
    4
    0 Votes
    4 Posts
    679 Views
    SeDiS
    @DerReisende Thank you very much for your hint! I have declared two private class members: QHash<QDate, QString> m_dateCache; QHash<QDateTime, QString> m_dateTimeCache; In my implementation I alternate between method calls that use cache lookup and those just doing the conversion. bool LogTableModel::saveDataToFile(QString fileName, bool useCache) My actual use of the cache is here: if (useCache) { QDate d = this->m_columns.at(m_dateAssignedColumn)->at(i).toDate(); QString sDate = m_dateCache.value(d,QString()); if (sDate.isEmpty()) { sDate = d.toString(this->dateFormat); m_dateCache.insert(d,sDate); } itemObj["dateAssigned"] = sDate; } else { itemObj["dateAssigned"] = this->m_columns.at(m_dateAssignedColumn)->at(i).toDate().toString(this->dateFormat); } The results show, that with cacheAlternate == true the code is a tad quicker indeed, but only by some 3% (not counting the slower initial run). Using the same approach on the DateTime field actually makes the code slower, for whatever reason. Probably because I never have two identical DateTimes, so the QHash becomes rather big. I have tried to cache the QVariant instead, to get rid of the "toDate()": QHash<QVariant, QString> m_dateCache; but my lookup QString sDate = m_dateCache.value(v,QString()); makes the compiler claim about "no matching function call for qHash", QVariant does not seem to have a proper qHash() function for this - and I wouldn't expect any magical acceleration here either. But even if it's not a huge boost, I've learned much from this hint. Thank you very much for the input! I'll try the mutex idea next.
  • add qpainterpath into a QProgressBar

    Unsolved qprogressbar qpainter qpainterpath
    3
    0 Votes
    3 Posts
    898 Views
    S
    thank you for the direction.
  • Qt installation on MacBook Pro

    Solved
    5
    0 Votes
    5 Posts
    586 Views
    SGaistS
    So you have everything working ? If so, then please mark the thread as solved :-)
  • Qt Creator Plugin - Add additional "mode"

    Solved qtcreator plugin mode
    3
    0 Votes
    3 Posts
    1k Views
    F
    @cristian-adam Thank you! This is exactly what I was looking for.
  • QSerialPort: No such file or directory

    Unsolved
    18
    0 Votes
    18 Posts
    2k Views
    E
    @JonB you're right That's why I asked the same question in case there is maybe. thank you all
  • how to transfer files from raspberry pi to External USB Drive?

    Solved
    3
    0 Votes
    3 Posts
    266 Views
    Ramkumar MohanR
    @SGaist Hi, bool copyFiles() { const QString srcPath = QFileDialog::getOpenFileName(this, "Source file", "", "All files (.)"); if (srcPath.isNull()) return false; // QFileDialog dialogs return null if user canceled const QString dstPath = QFileDialog::getSaveFileName(this, "Destination file", "", "All files (.)"); // it asks the user for overwriting existing files if (dstPath.isNull()) return false; if (QFile::exist(dstPath)) if (!QFile::remove(dstPath)) return false; // couldn't delete file // probably write-protected or insufficient privileges return QFile::copy(srcPath, dstPath); } These codes work well. Thanks
  • Avast discovered two file infections during submodule update of Qt5.15.2

    Unsolved
    3
    0 Votes
    3 Posts
    232 Views
    C
    I would be very wary of anything that Avast says, it is owned ny Norton now, one of the biggest scams out there. If you are using the 'Free' version then anything that gets quarantined is removed or hidden and the only way to retrieve is is by paying the subscriprion charge. I recently installed Win 7 on a spare drive to run some old software and took the suggestion to install the free Avast software, not aware that it was Norton. It duly removed some 20+ year old .exe files and blocked any attempt to retrieve them. Luckilly, I had copies and Avast was dispatched to the bin
  • Explore more about various features of UI library.

    Unsolved
    2
    0 Votes
    2 Posts
    219 Views
    JonBJ
    @Dwija This is a user forum. Maybe you should direct your request to The Qt Company, though I don't know what sort of response you will get.
  • This topic is deleted!

    Unsolved
    9
    0 Votes
    9 Posts
    7 Views
  • Problem with QMain Window

    Unsolved
    11
    0 Votes
    11 Posts
    994 Views
    E
    @SGaist I checked it. It works.
  • Stretch middle table's section

    Solved
    1
    3 Votes
    1 Posts
    118 Views
    No one has replied
  • This topic is deleted!

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

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Installing "Artistics style" plugin....

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    C
    @AnneRanch The Beautifier plugin can use one of several different C/C++ code formatting tools. Artistic Style is just one of them.
  • Run native application ie firefox with QtApplicationManager?

    Unsolved
    1
    0 Votes
    1 Posts
    151 Views
    No one has replied
  • How to connect Oracle with sys as sysdba?

    Unsolved oracle qsqldatabase
    3
    0 Votes
    3 Posts
    749 Views
    laozeng1982L
    Thanks for your information. It seems it's a bug, we can't use QT login Oracle as sysdba.
  • QXmlStreamReader::readNext() Call Doesn't Read Next Element

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    JonBJ
    @Crag_Hack You should not need to call readNext(). You should not need to call isWhitespace(). You should only need to call readNextStartElement(). Did you try with that? Your readNextXMLElement() looks like a not-so-comprehensive readNextStartElement(). Implementation is at https://code.woboq.org/qt6/qtbase/src/corelib/serialization/qxmlstream.cpp.html#_ZN16QXmlStreamReader20readNextStartElementEv bool QXmlStreamReader::readNextStartElement() { while (readNext() != Invalid) { if (isEndElement()) return false; else if (isStartElement()) return true; } return false; } OIC, you wrote: My code was already catered to readNext() call So you mean what you have is designed around that, for right or for wrong. I think you should rename your readNextXMLElement(), to readNextNonWhitespace().
  • How to hide console application

    7
    0 Votes
    7 Posts
    26k Views
    ali-aydinA
    @andre it is not working for me