Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • QSaveFile setDirectWriteFallback()

    Solved
    2
    0 Votes
    2 Posts
    286 Views
    SGaistS
    Hi, You can see the logic here. From the looks of it, you are right.
  • QJsonObject create nested Object

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    mrjjM
    @xeroe Hi Ok that is also possible QJsonObject json { {"type", "textMessage"}, {"subobject", Obj} };
  • QSplitter: Restrict movement after reaching a certain point

    Solved
    4
    0 Votes
    4 Posts
    921 Views
    S
    I forgot to mention - this layout is installed in the QWidget, i.e. splitter separates two widgets (QWidget, that contains vertical layout, that contains QLabel and QTreeView and QStackWidget). I figured out my mistake - I was setting the maximum width (setMaximumWidth) for the QTreeView object, not for the widget added to the splitter (QWidget). @Bonnie thank you!
  • where is my button? Problem with QComboBox

    Solved
    4
    1 Votes
    4 Posts
    557 Views
    mrjjM
    @Pl45m4 Hehe well its fair to say VRonin is not thrilled about setIndexWidget in general but its mostly due to being very heavy and not the right way. But this issues does not happen with QListWidget (even if scrolling ) so I assume its due to how ComboBox works with its viewport.
  • →DRY: retrieve caller object

    Solved
    10
    0 Votes
    10 Posts
    1k Views
    mrjjM
    Hi Just a note about docs Warning https://doc.qt.io/qt-5/qobject.html#sender "Warning: This function violates the object-oriented principle of modularity. However, getting access to the sender might be useful when many signals are connected to a single slot." While it does negatively affect the "loosely coupled" quality of the code, it's more along the line do not use this all over the place and cast sender() to all types of concrete widgets as it will be hard to reuse.
  • connectToHost and waitForConnected

    Solved
    10
    0 Votes
    10 Posts
    2k Views
    JonBJ
    @SPlatten FTR: A TCP/IP connection is a unique combination of four numbers: server IP + port + client IP + port. the same combination cannot be reused. Usually the client specifies the server port to connect on but not which port to use from client side. That gets filled in during the connection (e.g. connectToHost()) with a "random", unused port number at client side. That's how the same client can make multiple, separate connections to the same server service port. You can see this by looking at the port numbers used at client side during, say, multiple FTP connections.
  • 0 Votes
    6 Posts
    1k Views
    Pablo J. RoginaP
    @mariozio said in /etc/profile.d/qt5.sh: line 2: pathappend: command not found : As a result the session will not be configured correctly,you should fix this problem as soon as feasible.: the error is gone. And kde still works If your issue is solved, please mark this post as such! Thanks.
  • QSqlTableModel and QTableView wont populate or even show headers

    Unsolved
    9
    0 Votes
    9 Posts
    623 Views
    SGaistS
    Hi, One thing I can see is the missing opening of the database connection. You create one database, you assign it some path but I did not see any code opening the connection.
  • 0 Votes
    15 Posts
    5k Views
    D
    this worked for me: format.setScanLineDirection(QVideoSurfaceFormat::BottomToTop);
  • Recommendation for QSaveFile commit()

    Solved
    5
    0 Votes
    5 Posts
    631 Views
    R
    Ok, so shouldn't be required is my takeaway from this discussion. I'll probably leave the system("sync") for now just to be conservative.
  • Child window elements are blocked

    Solved
    8
    0 Votes
    8 Posts
    730 Views
    Pl45m4P
    @Helg1980 Nice to hear! Don't forget to mark your issue as solved.
  • Using a const QString & if a function returns a QString

    Solved
    10
    1 Votes
    10 Posts
    5k Views
    Christian EhrlicherC
    @bam80 said in Using a const QString & if a function returns a QString: there is no copying occurs anywhere in the original code it is: const QString text = jsonObject.value(someKey).toString(); At least with c++11 or c++14. See https://en.cppreference.com/w/cpp/language/copy_elision
  • QFontDialog: How to set it size?

    Solved
    6
    0 Votes
    6 Posts
    493 Views
    M
    @Bonnie said in QFontDialog: How to set it size?: Somehow you asked about QFontDialog, but you are using QFileDialog in the code... Oh, sorry that was a typo. Thank you for the link to the documentation, I will read this part carefully.
  • How to change the QToolButton opacity when the cursor is on int?

    Solved
    22
    0 Votes
    22 Posts
    3k Views
    N
    @Pl45m4 I didn't know about QScreen and I thought that the only way to use my device screen geometry is using QDesktopWidget. I will change it to QScreen . About layouts, also I didn't know that I can set size for them :) Thank you for valuable points you mentioned. I will definitely use them in my project.
  • Cannot debug with GDB in Qt creator

    Unsolved c++ gdb gdb error qt creator python
    1
    0 Votes
    1 Posts
    706 Views
    No one has replied
  • No license available on local system

    Unsolved
    3
    0 Votes
    3 Posts
    641 Views
    K
    Thanks @JKSH
  • Converting bitset to signed integer

    Solved
    5
    0 Votes
    5 Posts
    3k Views
    J
    Yes you're right, I suppose I was just considering instances where the value is greater than 16 bits, in which case some additional manual processing would be required.
  • <br> formatting problem in QLabel

    Solved
    4
    0 Votes
    4 Posts
    750 Views
    T
    Using <div> elements to separate the lines instead of <br> solved the problem. setText( "<div><center>1 (2) </center></div><div><font color=#000000>09:12 : <b>titre Normal</b></font></div><div><font color=#FF1144>12:10 : <b>titre Rouge</b></font></div>" );
  • QNetworkReply doesn't finish?

    Solved
    3
    0 Votes
    3 Posts
    326 Views
    S
    It's QPointer<QNetworkReply> so ::data() returns a pointer. Forgot to mention that. Also, I made it work by setting user and password in QUrl, not by setting QAuthenticator in response to QNetworkAccessManager::authenticationRequired. So... I don't understand why it didn't work before but now it works.
  • Change style sheet on the fly

    10
    0 Votes
    10 Posts
    896 Views
    SGaistS
    Then use the unpolish/polish QStyle trick.