Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • Qt5 Profile line 5 & 6 errors; No desktop login, just straight to desktop

    Unsolved
    3
    0 Votes
    3 Posts
    829 Views
    SGaistS
    Hi and welcome to devnet, Please share the content of that file.
  • I could use some guidelines on layouts

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    mrjjM
    @mzimmers said in I could use some guidelines on layouts: Well you can still change font type etc. byt yes, x,y is locked. I also notice that I'm unable to resize widgets in design mode when the widgets are in a layout. You set minimum size or max size to express such wishes. you can also set fixed size to not let it take more space. So you can change size but its other way than when not in layout.
  • Changing QTextBlock behavior for a QTextDocument

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    L
    @raven-worx Thank for the idea! I'll dig into it!
  • Search in Database with HTML Tags

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    K
    @Fuel QRegExp is the older version within Qt. It is better to start with QRegularExpression There is an example given which can help you also in testing different regular expression with some text.
  • Moving files to Recycle Bin is slow.

    Unsolved
    9
    0 Votes
    9 Posts
    4k Views
    S
    @samdol I also tried the following approach. Manually adding '\0's between files. It seems it should work. but it moves a file to trach only when I delete one file. If I try to delete more than one file, it does not do anything. bool moveToTrash( QStringList filename_list ){ WCHAR* from= new WCHAR[ 999999 ]; int l=filename_list.at(0).toWCharArray( from ); from[l]='\0'; int i; for( i=1;i<filename_list.size();i++){ WCHAR* from_tmp = new WCHAR[ filename_list.at(i).size() ]; l += filename_list.at(i).toWCharArray( from_tmp ); wcscat (from, from_tmp); from[l+i]='\0'; } from[l+i+1]='\0'; SHFILEOPSTRUCT fileop; memset( &fileop, 0, sizeof( fileop ) ); fileop.wFunc = FO_DELETE; fileop.pFrom = from; fileop.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT; int rv = SHFileOperationW( &fileop ); //Takes 20 ~ 70 ms which is 90% of deleting process. 5 times slower than just deleting. return true; }
  • How to keep one class instance thread-safe in mutilthread with Qt?

    Solved
    11
    0 Votes
    11 Posts
    4k Views
    kshegunovK
    It's not that simple. If data is shared between threads, you have to synchronize them manually through a mutex or a semaphore. QSharedPointer as the name suggests, is a pointer that's being shared, not the object it points to.
  • QBluetoothServiceUUId format

    Solved
    3
    0 Votes
    3 Posts
    734 Views
    A
    @SGaist OK. Thanks got it
  • Is there a way to style the root item in a QTreeWidget using stylesheets?

    Solved
    6
    0 Votes
    6 Posts
    4k Views
    A
    @tobiSF I wish, I haven't found one. I just use the docs from Qt.. There are a few good pages that show everything. I found that header view one in the docs as I mentioned.
  • Displaying a Pixmap on a Graphics View Widget

    Unsolved graphics view pixmap qt creator qpaint qgraphicsview
    3
    0 Votes
    3 Posts
    2k Views
    SGaistS
    Hi and welcome to devnet, Since your widgett is called PixmapView then in your CanvaTest class you can use ui->PixmapView ..
  • QNetworkAccessManager Check FTP Connection

    Solved
    8
    0 Votes
    8 Posts
    3k Views
    SGaistS
    Or from the reply that is passed in the context of the lambda.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    38 Views
    No one has replied
  • QMousePressEvent on QGraphicsView

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    mrjjM
    Hi When learning how the coordinates works i used this class CustomScene : public QGraphicsScene { protected: void mousePressEvent(QGraphicsSceneMouseEvent* event) { QGraphicsScene::mousePressEvent(event); qDebug() << event->scenePos(); } }; Not sure what you are looking for but this is minimal sample of getting clicks.
  • Trouble with QOpenGLDebugLogger

    Unsolved qml opengl debugger
    1
    2 Votes
    1 Posts
    1k Views
    No one has replied
  • Small problem with a log file

    Solved
    15
    0 Votes
    15 Posts
    4k Views
    jsulmJ
    @bask185 No, I did not write anything about signals/slots. I mean a class which manages the log writing. There is no need to do it in main window. Just provide static methods: class Logger { public: static void log(const QString &text); private: static QFile logFile; }; ... Logger::log("Some text");
  • How to get a signal for QTableView cell selection by cursor?

    Solved
    4
    0 Votes
    4 Posts
    10k Views
    K
    Hello, I got solved it. Signal selectionChanged is only fired after moving with the cursor keys to the table cell and pressing enter. But I don't want to have to press enter. The solution was derive my own TableView class from QTableView class GenericTableView : public QTableView { Q_OBJECT public: GenericTableView(QObject* parent = NULL); void currentChanged(const QModelIndex &current, const QModelIndex &previous); signals: void currentChangedSignal(QModelIndex, QModelIndex); }; and overwrite currentchanged and sending a self defined signal where I react on void GenericTableView::currentChanged(const QModelIndex &current, const QModelIndex &previous) { emit currentChangedSignal(current, previous); } Next problem was to use this derived class in the Qt From Designer. To solve it first you have to insert a normal QTableView and then do a right click on it and click "promote to" here you can specify that the element refers to yout own (in my case GenericTableView) TableView. And last but not least do another right right click and select "Change signals/slots" here you can add your self defined signal (in my case currentChangedSignal). Now you can connect the signal with a slot on the common way by right cklick and select "Goto slot". Thats it. Thanks everbody for your support.
  • Get RGB pixel values from QImage buffer

    Solved
    4
    0 Votes
    4 Posts
    3k Views
    Ioseph12I
    @artwaw I found what was the problem. Qt saves the image pixels in BGR order so, to get the right values it would be necccesary to catch them this way: B = *auxInPtCol++; G = *auxInPtCol++; R = *auxInPtCol++;
  • About the missing byte when using Qfile read a binary file

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    M
    It worked!Thx ~ I read the open() doc and it says: When reading, the end-of-line terminators are translated to '\n'. When writing, the end-of-line terminators are translated to the local encoding, for example '\r\n' for Win32. So it is due to the Qfile think 0x0D is '\r' when I falsely used it.
  • FomLay out and its size

    Unsolved
    3
    0 Votes
    3 Posts
    737 Views
    raven-worxR
    @BinuJanardhanan said in FomLay out and its size: Here widget in form layout occupied less space but too much free space is there. how can I avoid free space of right and bottom? widgetWithFormLayout->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
  • Blank out put when i am trying to parse the xml file using QXmlStreamReader Class

    Unsolved
    12
    0 Votes
    12 Posts
    5k Views
    B
    @VRonin Thank you .Thank you very much.
  • 0 Votes
    4 Posts
    2k Views
    H
    @jsulm When the pop up Message Box shows "python has stopped working", I clicked "debug" rather than close, then visual studio was started, in visual studio, it shows Unhandled exception at 0x0000000059A17DF1 (QtGui4.dll) in python.exe: 0xC000041D: An unhandled exception was encountered during a user callback I was using pycharm to trace code step by step, however it nev, aer run to this issue by step by step since there are two many small steps/callback/signal/slot to go through, as long as I let it run without breakpoint, it will crash with segmentation fault.