Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • How to close QDockWidget from code?

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    K
    @Yunus Looks like close() does work. There error was elsewhere in my code.
  • How to create a new DataBase in SOL Server

    Unsolved
    10
    0 Votes
    10 Posts
    1k Views
    JonBJ
    @zhmh but you did not know about it and just copied a link, so please do not confuse the questioner if you do not know the answer. That's very kind of you. I know that as I said Qt has no special call for creating a database, and I know that the link I gave you showed & explained the principle of how you can create a new database across ODBC, even if you do not know how to adapt it. I will obey your admonition and not suggest anything further for you.
  • Mouse pressed with right OR left click check?

    Solved click qpushbutt right-click
    5
    0 Votes
    5 Posts
    7k Views
    jsulmJ
    @legitnameyo This is not how it works. You will need to subclass QPushButton and override http://doc.qt.io/qt-5/qwidget.html#mousePressEvent You can find an example here: http://doc.qt.io/qt-5/qtwidgets-widgets-scribble-example.html
  • Arch linux system language mis-match

    Solved
    6
    0 Votes
    6 Posts
    731 Views
    jsulmJ
    @kanishkalback I don't know why this happens on Arch Linux. You could try to ask in a Arch Linux forum.
  • How to save the split string ?

    Solved
    6
    0 Votes
    6 Posts
    994 Views
    Chris KawaC
    @sonichy It does split it, but to parse it correctly you'd need to do another pass and detect that special case. You will also need that for parenthesis and other stuff. Like I said, a full expression parsing is a lot more involved than simple split + for loop.
  • 0 Votes
    9 Posts
    2k Views
    L
    @jsulm thanks for a head start line, figured it here
  • How to choose monitor main window appears on?

    Solved
    2
    0 Votes
    2 Posts
    242 Views
    J.HilkJ
    @kitfox the app appears in the monitor where your mouse curser was during launch, that's the default behavior. After startup, you can use move(), to move your main window over the desktop and you can use the QScreen class to query for information about your desktop. The rest is up to you ;-)
  • How to reset DB table

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    VineelaV
    @jsulm , @VRonin yes well this worked query.prepare("DELETE from farmer1"); query.exec(); thank you guys.
  • Challenges in migration of Qt 4.8.2 project into Qt 5.7 and above

    Unsolved
    7
    0 Votes
    7 Posts
    895 Views
    IamSumitI
    you are right that I should go for latest version of Qt but the thing is I will face the same problem because I am migrating from Qt 4.8.2 and these declarative classes are deprecated and my client's requirement is to make application in Qt 5.7.. My problem is how to display the QML item in QGraphics scene or If I use QML scene then how will I place QGraphicsItem on it? As explained earlier, in 4.8.2 I used QGraphicsScene and some of my objects are created as QGraphicsItems and I place them in background and foreground of the scene. Some of the objects are created as QDeclarativeItem and I added them in QGraphicsScene. While migration in Qt5.7, I found a workaround to place the QDeclativeItem on scene as I have created QQuickWidget and added it on scene but I am not able to make its background transparent because of that my other GraphicsItems are not visible. What will be the best approach to solve this specific problem?
  • 0 Votes
    7 Posts
    7k Views
    4
    That error is usually happening with the shared version when an application has not been properly deployed. What do you mean shared? is that as opposed to the static build i've been trying to do? Sorry but I don't understand how your post is meant to help me. The application hasn't been 'deployed' (windeployqt? which i shouldn't need to do anyway because its meant to be static/standalone) yet because I'm still working on it in creator. The other plugins i need are now statically built / installed as was in an above response. The only thing that doesn't show up is the windows in "%QTDIR%\plugins\platforms" (I needed to add QT_QPA_PLATFORM_PLUGIN_PATH to windows environment variables) ive rebuilt the 5.12 static version multiple times now with other different configs to try to get it to work and the windows plugin simply never exists in plugins\platforms\
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    24 Views
  • Application crashes when loading database on weak notebook

    Solved
    15
    0 Votes
    15 Posts
    2k Views
    SGaistS
    No, there are no such scripts. Qt is a C++ framework and it follow its rules. You can use static analysers that will give you warnings about that kind of errors. As for why it did work better on one computer that the other: sheer luck.
  • Rotation item and change point (0,0) in canvas too.

    Solved
    2
    0 Votes
    2 Posts
    275 Views
    SGaistS
    Hi, What canvas are you talking about ?
  • Setting up scaled background image in QDialog

    Unsolved
    2
    0 Votes
    2 Posts
    675 Views
    SGaistS
    Hi, This thread talks about the same subject.
  • Duration of a ToolTip

    Unsolved
    11
    0 Votes
    11 Posts
    4k Views
    mrjjM
    Hi Just as a note. I tried the code QToolTip::showText(g, a, this, QRect(), 30000); from a button's clicked. It will stay for 30 secs IF you do not move the mouse. If you mouse the mouse - it vanish a few sec later. So i think that is what you are seeing.
  • scaledContents Equivalent for QComboBox

    Solved
    4
    0 Votes
    4 Posts
    610 Views
    mrjjM
    Hi Well its possible to calculate your self and adjust the font for the combo box. However, its purely manual code.
  • Underlining words in a QTextEdit

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    F
    @JonB As long as it doesn't use html, it should work with both QTextEdit and QPlainTextEdit.
  • 0 Votes
    2 Posts
    2k Views
    Chris KawaC
    That's not valid css. border does not take 4 separate width parameters, only one shared across all sides. If you want to set borders different for each side you need to use border-width: border: solid #000000; border-width: 0px 0px 2px 0px;
  • Create a vector of QPushButtons?

    Solved vector qpushbutton
    3
    0 Votes
    3 Posts
    2k Views
    L
    that solved it! Thanks!
  • Help in pure Python code

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    JonBJ
    @monamour In the code you asked about there is no call to any strip() function, and the code simply does not access the characters read from the file, whether you remove anything from them or not. So your solution is interesting.