Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.1k Topics 454.6k Posts
QtWS25 Last Chance
  • Recording generated video frames with Qt Multimedia?

    Unsolved
    2
    0 Votes
    2 Posts
    482 Views
    SGaistS
    Hi, Where do you video frames come from ?
  • Qt Custom3DItem setMeshFile not working with Wavefront obj generated by Blender

    Unsolved
    1
    0 Votes
    1 Posts
    460 Views
    No one has replied
  • GetSafeHwnd Error

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    A
    Thanks !
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    321 Views
    No one has replied
  • how open print dialog to select printer.

    Unsolved
    13
    0 Votes
    13 Posts
    6k Views
    mrjjM
    @Gaurav-Badgujar Are you sure this->webview is valid ? Only reason i can think off. It shows zero. Often sign of dangling pointer Please show the function where you new it.
  • Accessing Textedit's undostack

    Unsolved
    13
    0 Votes
    13 Posts
    4k Views
    A
    Thanks again @mrjj for your persistence on my matter, If there are say 3 undo levels in my main undo stack to get to the point of insert text. Then say I have 20 levels of undo into my text edit. I'm going to have to monitor each and every undo insert with a counter. Then if I hit the core undo app undo I'm going to have to loop through that counter to one hard undo. This will be too 'hard' on the user. There are a few other issues that will creep in that will make the user's experience more uncomfortable doing it this way. Things like when I go out of 'focus' into another part of the app I will have to probably wipe undostack for the text editor. This said I will branch off and have a play around with your method when I get the times. Really appreciate the inputs thank you.
  • QGraphicsItem not updating the position (always at 0,0)

    Unsolved
    10
    0 Votes
    10 Posts
    6k Views
    O
    @Asperamanca said in QGraphicsItem not updating the position (always at 0,0): QLineF sceneLine(source->mapToScene(0,0), dest->mapToScene(0,0)); // now sceneLine contains a line between the nodes in scene coordinates setPos(sceneLine.center()); // Now my edge is positioned at the center between the two nodes QLineF line(mapFromItem(source, 0, 0), mapFromItem(dest, 0, 0)) It works. I just had to calculate the sceneLine center because thereis no method center() on my qt version. Before reading your solution I was trying this: this->setPos(this->mapToParent(this->boundingRect().center())) I think it also works ok. But your solution looks more clear. I don't know it it's ok to use boundingRect in my solution. @Asperamanca , thank you so much again. Best regards. Edit: changed from mapToScene to mapToParent just in case it's used as a child of other item.
  • Ministro invalid Qt version

    Unsolved android ministro
    6
    0 Votes
    6 Posts
    7k Views
    A
    @Andy314 There might be some additional custom changes to release build
  • I want to passing a variable/function-return as a template argument

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    P
    @Eligijus : Thank you, but I think you forget something I wrote in my question, look at the following quote: Note that I don't know what the container contains I just told you an example of the objects types that the container can contain. Anyway, I thank you.
  • Convert Custom Class to QVariant

    Solved
    2
    0 Votes
    2 Posts
    8k Views
    raven-worxR
    @Fuel QVariant::fromValue<StarTable>( starTableVar );
  • Qt Smtp Mail Sender - Outlook Encoder Problem

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    Taz742T
    Its Solved :) @Taz742 said in Qt Smtp Mail Sender - Outlook Encoder Problem: message.append("Content-Type: multipart/mixed; boundary=frontier\n\n"); reply: message.append("Content-Type: multipart/mixed; boundary=frontier; charset=UTF-8\n\n")
  • Use Qt thread correctly

    Solved
    15
    0 Votes
    15 Posts
    3k Views
    jsulmJ
    @Galilio Sorry, currently I have no time to analyse your code. You should read: https://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/
  • How to create custom series class for QChart

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    VRoninV
    @feodor_ra said in How to create custom series class for QChart: is impossible because everything related with QGraphicsItem containts in QAbstractSeriesPrivate class. This should not be the problem, the real problem is here: https://doc.qt.io/qt-5/qabstractseries.html#SeriesType-enum i.e. the series types are a closed group that can't be expanded. All you can do is add your own series into Qt sources and recompile the whole QtCharts module
  • Qt Custom Widgets, CSS and Layouts

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    webzoidW
    @mrjj This has solved the problem. I've created by own base Widget which overrides the paintEvent as you've suggested and everything works beautifully. Thank you.
  • ASSERT: "d_1_0_Core->refs.load()" in file opengl\qopenglfunctions_4_3_core.cpp, line 93

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    K
    @unclejimbo You are aware that you can check also for bug reports on issues on JIRA? The forum creaditials are also for JIRA.
  • QObect::connect call does not compile

    Solved connect qobject socket tcpsocket
    5
    0 Votes
    5 Posts
    5k Views
    C
    Adding the QObject constructor to my class's constructor and adding the pointer-to-member syntax suggested by Kshegunov fixed the issue. Thanks guys and good day.
  • deleted

    8
    0 Votes
    8 Posts
    2k Views
    jsulmJ
    @SqYt said in Implementation of Conway's Game of Life: graphic this graphic variable is a GUI class right? If so than you are doing something you should never do in Qt: using GUI classes in other threads! GUI classes should only be used in main thread. If you want to trigger an UI change from other threads then just emit a signal there and connect a slot in your main thread where you then update the UI.
  • Credit card application for online shopping

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    JKSHJ
    You're welcome. @CroCo said in Credit card application for online shopping: Does Qt documents have any example regarding this matter? The Qt documents don't have any examples for "communicating with credit card payment handlers". The Qt documents have examples for web communications. You need to do a few different things: Choose your payment handler. Read your payment handler's documentation, to learn how to communicate with the payment handler service. Read Qt's documentation, to learn how to do general web communications. Combine your knowledge from #2 and #3 to build your application.
  • QListWidgetItem setter functions in PyQt5 are very slow?

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    MiBrM
    I modified the code to be class CustomTableView(QTableView): def __init__(self,parent=None): super().__init__(parent) class CustomStandardModel(QtGui.QStandardItemModel): def __init__(self,parent=None): super().__init__(parent) class CustomStandardItem(QtGui.QStandardItem): def __init__(self,parent=None): super().__init__(parent) table = CustomTableView() model = CustomStandardModel() table.setModel(model) /... #fill the model with CustomStandardItem objects .../ color = QtGui.QColor() color.setNamedColor('#00ff00') column = 3 for row in rowIndexList: cell = model.item(row,column) start = time.time() cell.setBackground(color) end = time.time() print('time to set background' + str(end-start)) And this is significantly faster than the qtablewidget. output: [image: 0845355d-ec52-43f2-901b-10ae1dc9d6a9.png] EDIT: This loop for setting columns to autoresize was causing the initial problem of setBackground taking so long, with it commented out the QTableWidget is as fast as the QTableView. This loop runs once after the table is loaded with values, however every time setBackground is called it is affected. for col in range(self.columnCount()): self.horizontalHeader().setSectionResizeMode(col,QHeaderView.ResizeToContents)
  • Upload image file

    Solved
    5
    0 Votes
    5 Posts
    3k Views
    SGaistS
    I didn't wrote about connection error, but about connecting the error signal of QNetworkReply to know when something goes wrong.