Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • QAbstractItemModel & QTreeView notifications...

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    Chris KawaC
    What I want to know is, what function does model call on treeView that tells it to redraw None. Model doesn't know anything about the existance of a view (or views). The relationship is the inverse - it's the view that connects to model's signals when you call setModel() on it. As for what signals are emmited by the model - see the documentation of QAbstractItemModel. There are pairs of before/after signals for different operations, e.g. rowsAboutToBoInserted()/rowsInserted(). There's also the mentioned dataChanged() for when a range of items changes one of its roles values. Say my treeViews is linked to a widget displaying data of the selected item, if selection change, then every treeView should notify their own data widgets to update as well. Selection is not a function of the model. This is handled by a selection model that is set on the view, so each view has its own. You can connect to its selectionChanged() signal. Another example could be that if I rename a item, I would want that rename to trigger other events too for each treeViews. This you can handle by connecting to the dataChanged() signal of the model as mentioned above Wait thats dataChanged on model one, what about treeView one? I need tree to react to data/specific data change not model. The data changes in the model so you connect to the model's signals not the view. The views provided by Qt already connect to all the signals of the model. If you want to do extra things in the view you can subclass and connect again to the signals of your choice. You can make the connections in the override of setModel() of your subclass.
  • Restrict resize of a Widget.

    Unsolved qgraphicsview qresizeevent qt 5.7 qgraphicsscene resize event
    6
    0 Votes
    6 Posts
    3k Views
    SGaistS
    The idea is that you have your container widget getting resized and in its resize event, you change the size of the inner widgets with the ratio you want.
  • Checkboxes in cells of QTableWidget are not coming correctly

    Unsolved
    2
    0 Votes
    2 Posts
    313 Views
    mrjjM
    Hi layout ->setContentsMargins(0,0,0,0); is the cure. The default margins cuts the checkbox.
  • create QByteArray::fromRawData with float getting unexpected results

    Solved
    3
    0 Votes
    3 Posts
    502 Views
    K
    That solved indeed my problem! Thanks!
  • Dynamic 3D Array Example

    Solved
    1
    0 Votes
    1 Posts
    332 Views
    No one has replied
  • Writing to a socket from one thread and reading from another

    Unsolved
    2
    1 Votes
    2 Posts
    856 Views
    K
    @bluesparrow Hi and welcome to devnet What is the reason for handling in different threads? In case your assumption is that you do not want to miss incoming data, there is no reason to worry. The in-coming data is buffered until you are retrieving it. Typically one may wait for a readyRead signal and read the data, but you may also wait and check bytesAvailable
  • PeakCAN Mingw

    Solved can mingw
    4
    0 Votes
    4 Posts
    1k Views
    aha_1980A
    Hi @wimschuiteman, Peak does not distinguish between 32 and 64 bit, the library is called pcanbasic.dll in both cases. So you need to use the correct one, 32 or 64 bit, depending on your Qt architecture.
  • Use pseudo terminals with qt-serial on OSX

    Solved serial pseudo-terminal
    6
    0 Votes
    6 Posts
    1k Views
    A
    @kuzulis I've had a look at socat, and that looks to work! I now have a small example where I can write/read from a serial port. On the other end I am using screen, and my program picks up data as expected! Thanks for the pointer to socat! Didn't know about it..
  • Reading an output audio device

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    fcarneyF
    When I originally did this it was in Windows 7. The feature has been supported since Windows Vista. I would think if you wanted to support windows 7 you would need the Windows 7 sdk. At the very least you will probably need to be using MSVC. When I built my solution I was working solely in Visual Studio using a game engine. I believe you can develop windows specific features in Qt, but I have not done this yet. I don't know if using the Windows 10 SDK will allow development for Windows 7. I would use the Windows 7 SDK if targeting Windows 7.
  • Use QIODevice Asynchronous Interface with Synchronous API

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    J.HilkJ
    @Patrick-Wright Qt has the container class of QQueue for situations just as yours ;-)
  • Can't open Designer

    Solved
    3
    0 Votes
    3 Posts
    462 Views
    A
    Many thanks - this has solved the problem
  • Noob anomaly - ghost signal emission

    Solved
    5
    0 Votes
    5 Posts
    536 Views
    J.HilkJ
    @Pepas an easy way to prevent accidental connectSlotsByName connects would be the use of proper CamelCase notation like every self-respecting c++ programmer should :P
  • How to open the files using firefox and other file using excel sheet?

    Unsolved
    2
    0 Votes
    2 Posts
    365 Views
    aha_1980A
    Hi @kripashree QDdesktopServices::openUrl() should do that.
  • This topic is deleted!

    Unsolved
    6
    0 Votes
    6 Posts
    32 Views
  • TableView header Customized

    Solved
    5
    0 Votes
    5 Posts
    526 Views
    AbderaoufA
    @Christian-Ehrlicher thank you, that worked, I tried /n before :). I paid more attention now.
  • How to print/screenshot a tabwidget to an image file (.jpg/.png) in high resolution?

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    P
    @mrjj Thanks. It worked. Was a very simple and quick solution. pixmap = QtGui.QPixmap(self.ui.tab_2.size()) self.ui.tab_2.render(pixmap) pixmap.save('abc.jpg','jpg')
  • QCamera Problems!

    Unsolved
    27
    0 Votes
    27 Posts
    14k Views
    gfxxG
    Sorrry ... I see these olt post only now .... because try to work my app on my hystorical pc with intel I5 4th gen, ubuntu 16.04 update every mouth .... normally for camera pourpuse I use an other pc with ubuntu 16.04 and work well .... these historical pc actually not work with camera.cpp example provided for QT5.10 .... In these pc there are v4l gstreamer mesa opencv etc etc all updated to recent version .... in the past I used modified by me libv4l.so version (or similar one) and my opencv app work on these pc. But I suppose that modified version is updated and rewrite now from software center updater. Any how ... there are another problem similar to your ... and the problem generally become from firmware of camera not from SO. In the past i modified v4l lib because the firmware of camera was not "standard". regards Giorgio
  • QPlainTextEdit in a QGraphicsView

    Solved
    3
    0 Votes
    3 Posts
    555 Views
    W
    Thank you very much , it worked !
  • How to judge there is content in QTextEdit?

    Unsolved
    4
    0 Votes
    4 Posts
    543 Views
    JKSHJ
    @victor-wang said in How to judge there is content in QTextEdit?: However, it didn't show anything unless I use "Settext" at the first time then "append". That's strange. Which version of Qt? This code works for me on Qt 5.12.0 (MinGW 7.3.0, 64-bit): QTextEdit e; e.append("Hello"); e.show();
  • How to make a loading indicator for all window?

    Unsolved
    4
    0 Votes
    4 Posts
    4k Views
    R_IrudezuR
    @dheerendra I used QProgressDialog for this case. But it keeps wait UI when function process is long. I mean when process is long, 'not responding' shown over the top of QProgressDialog. Should i call function with QFuture and Qt::Concurrent.run() ? @mrjj