Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.1k Topics 454.7k Posts
QtWS25 Last Chance
  • MacOS: how to run AppleScript script from a Qt app?

    36
    0 Votes
    36 Posts
    21k Views
    Z
    About running such a script as a QProcess : I am trying to make it work in a sandbox environment (App Store), but I'm not sure wether the main app's entitlements apply to the osascript QProcess launched ? I'm getting access violation errors but I'm not sure if it's because my app is not signed correctly with entitlements, or if maybe it is because I must figure out a way to get the entitlements to apply also to the subprocess...
  • no adapter checked...

    Solved
    1
    0 Votes
    1 Posts
    107 Views
    No one has replied
  • block C++ and waiting for a qml signal to continue execution

    Unsolved
    4
    0 Votes
    4 Posts
    722 Views
    kshegunovK
    @Guigui64 said in block C++ and waiting for a qml signal to continue execution: However I think that, as you recommend, I will turn to another solution, maybe split the code in 2 separate functions and avoid the "blocking" solution.... That's much better, and what you should do, yes. As a side note, QEventLoop is used correctly, as far as your code goes and as far as I can tell, but you should avoid it in principle.
  • How to hide all widgets from a QVBoxLayout with spacer?

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    M
    @Gabber said in How to hide all widgets from a QVBoxLayout with spacer?: The "morph into" function in the QT creator does exactly what you write, doesn't it? There I can also convert the layout into a QWidget. I have hard time to figure out how to convert (morph?) a layout to a widget.
  • Uniquely identify a machine

    Solved
    9
    0 Votes
    9 Posts
    780 Views
    H
    @mrjj said in Uniquely identify a machine: then it should be rare that someone change the mac ID yeah that's what I counting on.
  • Use of undeclared identifier 'inet_pton'

    Solved
    6
    0 Votes
    6 Posts
    696 Views
    Christian EhrlicherC
    As stated in the documentation you gave us, you have to set _WIN32_WINNT to a value greater or equal to Windows 8 and you must not redefine a value defined by the windows headers itself. When you use qmake you can add a compiler definitions with the DEFINE command: https://doc.qt.io/qt-5.12/qmake-variable-reference.html#defines DEFINES += _WIN32_WINNT=0x0602 But since we're here in Qt-forum - why not use QHostAdress?
  • QListView deselect item by clicking on selected Item

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    ?
    @mrjj Thanks for your code example, it works perfectly! I have thought about the whole thing again and will stay for now with a simple select (without shift). Therefore I will mark the thread as solved.
  • How to manage project versions in Linux ?

    Unsolved
    2
    0 Votes
    2 Posts
    134 Views
    mrjjM
    Hi Many use an online code revision system as not to lose code if the system fails. Like https://bitbucket.org/product You don't have to use an online service but if you use it only locally, the safety is lacking. Alternatively, you can use a sync service like pcloud and let it store copies of the projects into the cloud.
  • how to add a suffix to a file after saving it on filedialog in qml

    Unsolved qt5 qml filedialog file
    3
    0 Votes
    3 Posts
    828 Views
    JuniorMLedesmaJ
    Hello, I want to know how to add a suffix to a file after saving it on filedialog in qml and I came here in hope to find my answer. But It makes me sad when I can't find it. I tried filePath = filePath + '.txt' but isn't working for me. Can anyone share a website with me in which I can find the solution? I will be very much thankful to you.
  • why? it shows me these warnings when I generate the slots for my controls.

    Unsolved
    2
    0 Votes
    2 Posts
    258 Views
    C
    These slots are named to take advantage of automatic connections between signals and slots implemented by QMetaObject::connectSlotsByName() and most often used in Qt Designer UIs. This mechanism is not inherently evil. However, if you rename the object in the Designer UI and not the matching slot then the automatic connection will not happen (silently). Conversely (and less likely), if you name a function on_blah_triggered() for a reason unrelated to the UI, but where blah exists and has a triggered() signal, you may find an unexpected connection is made (silently). You will find these at run time. This fragility is the reason for the warning. The alternative is to avoid the automatic connection naming and explicitly code connections in your constructor. If you use new-style connect() then this will fail at compile time in the first case, and the connection will not be present in the second.
  • Is there any official document by Qt for Qt_MVVM or Qt_MVC.

    Unsolved
    2
    0 Votes
    2 Posts
    154 Views
    C
    If you mean official documentation for QtMvvm then no. This is a third-party library, so The Qt Company is not the one to document it. I have no idea what Qt_MVC might be referring to. I suspect the answer is the same.
  • Trying to get records from database with c++ and pass it to listview model

    Unsolved
    4
    0 Votes
    4 Posts
    207 Views
    D
    Text { anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter anchors.leftMargin: 8 font.pixelSize: 12 text: modelData.name color: "#b9b5b5" Component.onCompleted: { console.log(JSON.stringify(modelData.name)) } } so modelData.name does the trick....maybe there are better ways, if someone hve any suggestion, please share
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • does anyone have oauth1 hmac-sha256 working on Qt 6+ ??

    Solved
    2
    0 Votes
    2 Posts
    221 Views
    testmonkeyT
    @testmonkey o2 was updated yesterday with qt6 goodness, included that into the .pro file, changed about 6 lines of code and managed to spit out sha256 signatures. legacy lines of codebase using older o2 had to be changed to from O1RequestParameter to O0RequestParameter. created a patch for the differences to o2 -- https://github.com/pipacs/o2/issues/156 still don't know how to do it natively through qnetworkauth route....
  • This topic is deleted!

    Unsolved
    6
    0 Votes
    6 Posts
    25 Views
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Help with timer and JavaScript slot.

    Solved
    43
    0 Votes
    43 Posts
    5k Views
    KroMignonK
    @SPlatten said in Help with timer and JavaScript slot.: right now before trying your suggestion the output is: setupForm() !!!! S000000000029E000000003405T09:32:06.594W:QObject::startTimer: Timers cannot be started from another thread Same issue, you are trying to start a QTimer from the wrong thread. QTimer::singleShot(0, myTimer, [myTimer]() { myTimer->start(); } ); will solve this.
  • converting excel sheet to pdf in qt cpp

    Unsolved
    5
    0 Votes
    5 Posts
    843 Views
    JonBJ
    @harsha123 I do not think there is a C++ library for Qt which can read a .xlsx and understand enough about it to actually render/print/export to PDF. I think at best it can parse it. There may be a library for Python which can accomplish this, but not C++. I stand to be corrected by someone more knowledgeable, I may be mistaken. Maybe I am wrong. What about https://qtexcel.github.io/QXlsx/ ? I see it has Qt-Table-Printer is under BSD 3-Clause license. https://github.com/T0ny0/Qt-Table-Printer at https://github.com/T0ny0/Qt-Table-Printer. Maybe that can leveraged to produce PDF file (which is why I talked abour "printing" earlier, do print-to-PDF-file).
  • Is it possible to fill color in bounding rectangle?

    Solved
    13
    0 Votes
    13 Posts
    2k Views
    Swati777999S
    @JKSH said in Is it possible to fill color in bounding rectangle?: @Swati777999 said in Is it possible to fill color in bounding rectangle?: I wanted to just fill colors to a textbox, so tried with this one. ... Is it possible to fill color to a textbox ? or just do as the above and then put a QLabel inside it? ... It's not a Qt class, in general how text-box is represented in [Untitled] By default Paint Application of Windows OS. I'm afraid I don't fully understand your descriptions or what you're trying to do. Can you please describe what you have already implemented, and what changes you want to make? If you just want to fill the background colour of a QLabel, you can apply a stylesheet to the label: https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qframe For example, label->setStyleSheet("background-color: red;"); Thanks. This works for me.
  • adding subwindow to MDI area

    Moved Solved
    7
    0 Votes
    7 Posts
    1k Views
    A
    @ChrisW67 Before I read the last reply , I did this . Works as required Form_SYSTEM *FS = new Form_SYSTEM(); mdiArea->addSubWindow(FS)-> setWindowState(Qt::WindowMinimized) ; //modify current / last addition mdiArea->currentSubWindow()->showNormal(); mdiArea->currentSubWindow()->resize(400,400); SOLVED