Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Some questions regarding the star delegate example.

    Solved
    4
    0 Votes
    4 Posts
    266 Views
    A
    Thank you for your answers.
  • QFrame setStyleSheet background-image not working on Windows

    Unsolved
    9
    0 Votes
    9 Posts
    477 Views
    R
    @jsulm No difference, unfortunately. That is acutally the reason why I use os.path.join in order to get backslashes for Windows an forwardslashes for Mac/Linux. And as I said, the path with backslashes works in Windows Explorer. Maybe it has to do with any QFrame properties (shape, style...) which have to be set in Windows to show background-images? I will try a bit...
  • QCategoryAxis QBarSeries QBarSet

    Unsolved
    1
    0 Votes
    1 Posts
    149 Views
    No one has replied
  • ‘signals’ and 'public slots' does not name a type

    Unsolved cpp qt6.6 qmlc++
    11
    0 Votes
    11 Posts
    2k Views
    Ronel_qtmasterR
    @SimonSchroeder OKay thanks.We shall see when he explain more
  • Lib variable $(Qt_LIBS_) in qt.props Qt tools 2.4.3 for vs2017

    Unsolved
    3
    0 Votes
    3 Posts
    976 Views
    W
    Do you resolve this issue? I use vcpkg install qt:x64-windows-static,and found in release mode ,the ${Qt_LIBS_} is include some debug librarys,such as qwindowsvistastyled.lib, qwindowsd.lib, ets I think this is an error from Qt Tools, but i can't modify it.
  • mdiArea tooltip / subwindow tooltip no show

    Unsolved
    1
    0 Votes
    1 Posts
    105 Views
    No one has replied
  • Some difficulties encountered

    Unsolved
    5
    0 Votes
    5 Posts
    275 Views
    L
    @JonB Thanks JonB it's work now !!! I'am a very bad programmer ;) QFile file(QString(QApplication::applicationDirPath() + "/STMartin/Traitement/Traitement et contention.csv")); if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) { QMessageBox::critical(this, tr("Je ne trouve pas le fichier "), tr("")); return; } int numeroDeLaligneAnalysee = -1; int numeroDuResident = -1; while (!file.atEnd()) { const QString ligneEnCourDeLecture = QString::fromLatin1(file.readLine()); QString ligneATravailler = ligneEnCourDeLecture; QStringList denominationDeChaqueResident; numeroDeLaligneAnalysee++; denominationDeChaqueResident.append(QString::number(numeroDeLaligneAnalysee) + ";"); if(ligneEnCourDeLecture.left(4) == "Mme." || ligneEnCourDeLecture.left(2) == "M.") { numeroDuResident++; denominationDeChaqueResident.append(QString::number(numeroDuResident) + ";"); if(ligneEnCourDeLecture.contains("(F)")) { ligneATravailler = ligneEnCourDeLecture.left(ligneEnCourDeLecture.indexOf("(F)")); } if(ligneEnCourDeLecture.contains("(H)")) { ligneATravailler = ligneEnCourDeLecture.left(ligneEnCourDeLecture.indexOf("(H)")); } if(ligneEnCourDeLecture.contains("née")) { ligneATravailler = ligneEnCourDeLecture.left(ligneEnCourDeLecture.indexOf("née")); } while(ligneATravailler.contains(",")) ligneATravailler.remove(","); while(ligneATravailler.contains("-")) ligneATravailler.remove("-"); ligneATravailler = ligneATravailler.simplified(); ligneATravailler = ligneATravailler.trimmed(); QStringList civiliteNomEtPrenom = ligneATravailler.split(" "); QString civilite; if(civiliteNomEtPrenom.at(0) == "Mme.") { civilite = "F"; civiliteNomEtPrenom.takeFirst(); } if(civiliteNomEtPrenom.at(0) == "M.") { civilite = "H"; civiliteNomEtPrenom.takeFirst(); } denominationDeChaqueResident.append(civilite + ";"); QString listNom; QString listPrenom; for (int i = 0 ; i < civiliteNomEtPrenom.size() ; i++) { QRegularExpression nom("[A-Z][A-ZÉ\s]"); QRegularExpressionMatch matchNom = nom.match(civiliteNomEtPrenom.at(i)); if (matchNom.hasMatch()) { listNom.append(civiliteNomEtPrenom.takeAt(i)); } QRegularExpression prenom("^[A-Z][a-z]*$"); QRegularExpressionMatch matchPrenom = prenom.match(civiliteNomEtPrenom.at(i)); if (matchPrenom.hasMatch()) { listPrenom.append(civiliteNomEtPrenom.takeAt(i)); } } if(!civiliteNomEtPrenom.isEmpty()) { QMessageBox::critical(this, tr("civiliteNomEtPrenom n est pas vide. Il reste cela"), civiliteNomEtPrenom.first()); return; } denominationDeChaqueResident.append(listNom + ";"); denominationDeChaqueResident.append(listPrenom + ";"); qDebug()<< "denominationDeChaqueResident" << denominationDeChaqueResident; } }
  • Mac .app crashes on launch for other people

    Unsolved
    5
    0 Votes
    5 Posts
    545 Views
    D
    @loren Also remember you have to properly code sign your application if you want to distribute to other people. On intel macs it is not as bad as on Apple Silicon machines - these will not execute your program and you will find crash reports with SIGSEGV and code signature invalid on the machine using the console app.
  • Drawing simmetrical arrow

    Solved
    6
    0 Votes
    6 Posts
    417 Views
    V
    @Vlad02 Maybe it will be useful for someone: in general, I decided to just replace drawing a polygon with drawing a set of lines, so I get symmetrical arrows. Thank you all for your help!
  • QTcpSocket readyRead destination

    Solved
    5
    0 Votes
    5 Posts
    274 Views
    qtprogrammer123Q
    @JonB thx for help
  • no matching function for call to 'device::device()'

    Solved c++ class
    5
    0 Votes
    5 Posts
    2k Views
    W
    @Ronel_qtmaster oh i understood what i wasn't getting yeah idk why i did that, thanks! onto the next mistake....
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • How to scale QQuickItem in x or y direction only?

    Unsolved
    3
    0 Votes
    3 Posts
    284 Views
    A
    @GrecKo That is, I would instantiate a Scale object, and reparent the original component? And hope the component doesn't depend on a specific parent hierarchy to work.
  • Enable another application's window to be dragged and dropped onto my widget ?

    Unsolved
    4
    0 Votes
    4 Posts
    356 Views
    JonBJ
    @LinuxGuy I think it is not easy to see the mouse outside of your application windows. Might have to "grab" the mouse, which is not pretty and can leave window system unstable, might be able to "poll" on a timer (https://stackoverflow.com/a/29400627/489865). Google for qt mouse outside application. Then there is the complication that the windowing system is in the middle of a window-drag operation, which can only make it harder, and you want to detect drop as well. And if you are using Wayland wouldn't surprise me if it stops you doing this (I have no evidence for this, just that it sounds like what it would want to prevent). Can you name an application, other than something in the window manager itself, which does what you are wanting to do?
  • [Solved] Tooltip on QAction

    6
    0 Votes
    6 Posts
    10k Views
    S
    If your menu have actions & you want to add tool-tip for the respective actions , can follow these steps: 1: set tool-tip (action.settooltip("Your tool tip")) for every action. 2: write a connect statement on hovered() signal and write a slot for it. 3: in slot definition you have to write QAction* act = static_cast<QAction*>(QObject::sender()); QToolTip::showText(QCursor::pos(),act->toolTip(),menuObject_where you have added action);
  • Update data in a CSV file

    Unsolved
    5
    0 Votes
    5 Posts
    251 Views
    JonBJ
    @SeyMohsenFls As stated, you have to rewrite the complete file, can't be clearer. You have two possible ways: Read whole file into memory, in some structure (even if it's just a list of lines). Make modifications to it in memory. Write whole file back when completed, e.g. overwriting original file. This is how e.g. a text editor or sort works. Open existing file for read, open a new file for write. As you read each line in, make any modifications and write new line out. At the end probably/perhaps delete original file and rename new file to that. This is how e.g. sed works. Either way you completely rewrite new file. Difference is how much memory you use.
  • Qt cmake deployment API and Cpack not working for macos

    Solved
    3
    0 Votes
    3 Posts
    329 Views
    MesrineM
    @Mesrine said in Qt cmake deployment API and Cpack not working for macos: Unspecified That was the problem. It seems that install(TARGETS QVaultCli BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT vaultCli ) Do not add the bundle to the cpack vaultCli component.
  • How can I make a default QPushButton respond to ENTER?

    Solved dialog box default action
    13
    0 Votes
    13 Posts
    2k Views
    JonBJ
    @SimonSchroeder See the discussion around https://forum.qt.io/topic/155461/qlineedit-returnpressed-when-something-else-has-a-key_return-shortcut/16 for the pointlessness/potential evilness of the NumPad Enter key ;-)
  • OpenSSL linker issue in QT6.5.3 in macOS OSX

    Unsolved
    8
    0 Votes
    8 Posts
    627 Views
    I
    @SGaist yes
  • Raspberry pi

    Unsolved
    2
    0 Votes
    2 Posts
    199 Views
    C
    @Rockerz Qt for Linux/X11 - Deployment