Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.8k Topics 458.5k Posts
  • This topic is deleted!

    Solved
    3
    0 Votes
    3 Posts
    22 Views
  • 0 Votes
    4 Posts
    737 Views
    mrjjM
    @Ramkumar-Mohan Yes just setup both Scrollareas They won't scroll in sync if that is what you mean but both can scroll void MainWindow::SetupScroller(QScrollArea *area) { QScroller::grabGesture(area->viewport(), QScroller::LeftMouseButtonGesture); QVariant OvershootPolicy = QVariant::fromValue<QScrollerProperties::OvershootPolicy>(QScrollerProperties::OvershootAlwaysOff); QScrollerProperties ScrollerProperties = QScroller::scroller(area->viewport())->scrollerProperties(); ScrollerProperties.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, OvershootPolicy); ScrollerProperties.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, OvershootPolicy); QScroller::scroller(area->viewport())->setScrollerProperties(ScrollerProperties); } .... SetupScroller(ui->scrollArea3); SetupScroller(ui->scrollArea_2); [image: drop4.gif]
  • How to make a window always on top of all windows, including the taskbar?

    Unsolved
    2
    0 Votes
    2 Posts
    519 Views
    mrjjM
    Hi Did you try with this->setWindowFlags(Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint); ? sometimes also Qt::Popup is useful. If it will stay above the task bar, depends on the Windows Manager used.
  • Qt6.4 not finding library

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    C
    @ChrisW67 No, I get no errors there. Similarly, if I run ldd ./29-Point-Lights from the build directory, I get no errors. I did get a not found error prior to exporting the $LD_LIBRARY_PATH but that fixed it. This is only a problem from the QtCreator generated terminal, not a terminal that I open. As I posted above, compiling against a static library instead, it works fine. There is obviously nothing wrong with the shared library as it works from the command line. There must be a simple explanation, I just can't find it. As this is a course and only for my personal use, it doesn't matter in this case but I'd still like to find the reason.
  • 0 Votes
    4 Posts
    352 Views
    mrjjM
    @imene Hi the this in the connect is the Mainwindow which has the sendFrame method. So it says connect sendFrameBox's signal sendFrame to MainWindows's slot called sendFrame
  • graying out

    Unsolved
    4
    0 Votes
    4 Posts
    272 Views
    qwasder85Q
    @Shines said in graying out: what is the difference between setenabled and setDisabled, can they be used interchangebly with change in bool value Yes, I think so.
  • This topic is deleted!

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

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Create a rule that series colors do not overlap

    Unsolved
    2
    0 Votes
    2 Posts
    262 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
    683 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
    945 Views
    S
    thank you for the direction.
  • Qt installation on MacBook Pro

    Solved
    5
    0 Votes
    5 Posts
    606 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
    271 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
    233 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
    1k Views
    E
    @SGaist I checked it. It works.