Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. close

    Log in to post
    • All categories
    • H

      Solved Style application bar (the top bar of a floating window) which has the close and minimize buttons
      General and Desktop • close minimize windows10 window stylesheet • • Hologram

      3
      0
      Votes
      3
      Posts
      65
      Views

      S

      Well, Qt does not provide these capabilities. This means that you cannot easily use stylesheets for this purpose. However, there might be OS-specific ways to change the color of the title bar. On Windows (10 and later) you can use DwmSetWindowAttribute to enable dark mode for the title bar. Another way is to get a window without decoration/borders from the OS and then draw the entire title bar yourself using Qt. Then, you can also style the title bar using stylesheets. It might get a little complicated to draw the close and minimize buttons in the correct OS style yourself.

    • T

      Unsolved Using system window buttons in frameless QWindow
      General and Desktop • framelesswindow title bar minimize maximize close • • TheEnigmist

      3
      0
      Votes
      3
      Posts
      260
      Views

      T

      @mcf1lmnfs No, because title bar is not a Qt element, is system made, so I cannot change it via Qt Style Sheets.

    • V

      Solved close(int fd) not recognized in QT both fcntl.h and unistd.h are included
      General and Desktop • qtcreator 4.9.1 close qt5.11 • • vicky_mac

      18
      0
      Votes
      18
      Posts
      642
      Views

      JonB

      @vicky_mac said in close(int fd) not recognized in QT both fcntl.h and unistd.h are included:

      I am getting the same error even after MainWindow::close(fd)

      Both @KroMignon and I said from the start and multiple times to try ::close(fd);. Same with ::open(). How much clearer than that can one be?

      If you want to be "safe", every single C (not C++) function you want to use should be ::function().

    • O

      Solved Dialog does not close correctly
      General and Desktop • qdialog close • • OlivierDz

      3
      0
      Votes
      3
      Posts
      302
      Views

      O

      @JonB said in Dialog does not close correctly:

      Thanks, it works now.

      I created a custom slot for the Cancel button in my CMyDialog class.
      I this slot a put this->parentWidget()->close().
      This solved the problem.

    • D

      Unsolved How to properly close a widget
      General and Desktop • c++ qt 5.9.5 qwidget close • • Daniel_Contro

      6
      0
      Votes
      6
      Posts
      1121
      Views

      SGaist

      Hi,

      How are these widget managed from a data saving point of view ?

    • pauledd

      Solved Close QChartView with main window?
      General and Desktop • qchart qchartview close qtcharts mainwindow • • pauledd

      3
      0
      Votes
      3
      Posts
      1413
      Views

      pauledd

      Works, thank you.

    • M

      Solved QTemporaryFile: close method
      General and Desktop • qtemporaryfile file close • • Mark81

      8
      0
      Votes
      8
      Posts
      2875
      Views

      M

      @kshegunov I didn't know that function. Thank you very much, I will try it.

    • A

      Unsolved How do I correctly use QFile::open() and QFile::close()?
      General and Desktop • qfile open close • • alogim

      5
      0
      Votes
      5
      Posts
      17955
      Views

      kshegunov

      Hello,

      my app wasn't able to create an empty file due, for example, to insufficient permissions: shall I call file.close() anyway?

      No you're not required to.

      my app was able to create an empty file: shall I call file.close()

      Again, you're not required to. You can call it if you wish, but by default the QFile instance will close the file when it goes out of scope. Moreover calling close() on an unopened file is permitted, but it does nothing.

      The I want to add some text to the file, but I do not want to interact with it here: I pass the file name to a function which is taking care of it.

      Don't reopen the file on each write, it's a somewhat heavy operation. Have a member variable, open it once and write as much as you'd like.

      Now, because of all the previous checks, I shouldn't have to check if file exists or if I can open it, right?

      Wrong. No one is guaranteeing you that the file exists. On windows a file will (usually) be locked when opened, but on Linux the user can delete it even while you're writing onto it. So don't skip the checks. Also as I mentioned above, don't reopen the file on each write.

      Kind regards.

    • N

      Solved QWebsocket signal disconnected and method close unrelated ??
      General and Desktop • qwebsocket websocket disconnected close closecode • • nameAlreadyInUse

      4
      0
      Votes
      4
      Posts
      2046
      Views

      N

      OK guys i can confirm this is a bug in the Qt5.3 (linux version at least); as the exact same code on Qt5.5 on windows produces the followin output :
      Message received: "Hello, world!"
      Close code: 1002

      Was already reported btw : [https://bugreports.qt.io/browse/QTBUG-42982](link url)