Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Structure

    2
    0 Votes
    2 Posts
    1k Views
    R
    Put a pointer of your QTcpSocket object statically in one of your class, but I think that a book on C++ introduction could help you more than me! ;-)
  • QtConcurrent::run with functions with default arguments

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Linux: Setting the default icon theme (System-wide) Help!

    8
    0 Votes
    8 Posts
    7k Views
    A
    You cannot inform your application about your default icon set. The application should be self conscious and it gets aware of system icon set if it uses above syntax. So if application is not using default icon set, it means there is no way by which it can use default icon set since the above syntax hasn't been used in that case.
  • [SOLVED] Simple C++ project build

    9
    0 Votes
    9 Posts
    8k Views
    M
    Yes, "qmake -project" will give you a base .pro file. By default it will be named the same as the directory you're currently in. So if you're in a directory called "foo", the project will be "foo.pro". You can rename it of course, if you'd like. A desktop target just means you're telling Creator that you want to use a build of Qt that's targeted for desktop deployment (as opposed to Symbian or Harmattan for mobile devices.) You'll want to add the CONFIG -= QT line to your .pro file. It can just be a line by itself in the file somewhere. There's a lot of good information in the "qmake manual.":http://qt-project.org/doc/qt-4.8/qmake-manual.html#qmake
  • How to add file browsing facility to my application?

    7
    0 Votes
    7 Posts
    5k Views
    S
    Thank you KA510
  • Wifi tools

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Issue Regaurding QBrush

    2
    0 Votes
    2 Posts
    2k Views
    C
    You can set only one brush on abstract shape item. So, you can set a solid blue brush, and reimplement paint method and fill a bounding rectangle rect with Qt::BDiagPattern brush
  • [Solved] QTextBlock::userState behaviour for new blocks ?

    2
    0 Votes
    2 Posts
    2k Views
    V
    Okay - for those of you trying the same kind of thing, I've solved it explicitly, as I outlined, by overiding the handler key-presses in my class derived from QTextEdit, to handle return keys. It looks something like this :- @void PSRTextEdit::keyPressEvent(QKeyEvent *e) { if( e->key()==Qt::Key_Return || e->key()==Qt::Key_Enter ) { // put in my text block with the right ID assert( m_pSRDocument && "no doc ?!" ); QTextCursor TextCursor( textCursor() ); TextCursor.insertBlock(); TextCursor.block().setUserState( GetNodeID() ); return; } QTextEdit::keyPressEvent(e); } @ ...though maybe it would be nicer to wait for the key press to have been handled, and then set the ID afterwards, in your case. Of course if the above was a supremely stupid thing to do, then let me know !
  • QTouchEvent Error touch position

    3
    0 Votes
    3 Posts
    2k Views
    M
    Thanks :) [quote author="mlong" date="1331258429"]The coordinates returned by pos() are relative to the object that received the touch event. You may want to use scenePos() to return absolute coordinates.[/quote]
  • Watermark in QTextEdit

    5
    0 Votes
    5 Posts
    3k Views
    A
    For permanent watermark @lineEdit->setFrame(false); QLineEdit { image: url(:/images/watermark.png); } @
  • How to make such kind of menu with title in mac os

    3
    0 Votes
    3 Posts
    1k Views
    M
    No, it like a group title.
  • New Qt installation; compiling problems

    3
    0 Votes
    3 Posts
    5k Views
    D
    Hello Compilers said "Configuration unchanged, skipping qmake step." Do you try to force qmake step (in compile menu / run qmake ) ? Frederic
  • [Solved] Deleting QObject that already has a parent

    8
    0 Votes
    8 Posts
    11k Views
    A
    QWeakPointer rather, according to the docs. bq. QWeakPointer can be used to track deletion of classes that derive from QObject, even if they are not managed by QSharedPointer. When used in that role, QWeakPointer replaces the older QPointer in all use-cases. But the sentence that made me a little unsure was this: bq. To obtain the QObject being tracked by QWeakPointer, you must use the QWeakPointer::data() function, but only if you can guarantee that the object cannot get deleted by another context. It should be noted that QPointer had the same constraint, so use of QWeakPointer forces you to consider whether the pointer is still valid. What exactly is "context" in this context? Thread context? Doesn't make much sense, as QObjects cannot be used from different threads, anyway (which the following paragraph in the docs point out explicitly). So all I knew was that QWeakPointer does not protect me in some case, and I could not determine whether my case was this case. Seemed safer to attach to the destroyed() signal.
  • 0 Votes
    3 Posts
    13k Views
    A
    O thanks! but it works only when screen is maximized, if i change the window size the scroll bars appear again. Perhaps, i have to use this in resize event. We can use this also @ui->graphicsView->fitInView(scene->itemsBoundingRect() ,Qt::KeepAspectRatio);@
  • [Solved] Delegate stops working when applying filter

    3
    0 Votes
    3 Posts
    2k Views
    ?
    You are right, as well as you thought my delegate relies on the column number. I already found a solution that solves my problem and on an easier way. This resides on change the delegate to relies on the column name (the columns name never changes) rather than their number. Thanks for your suggestions and your quick answer.
  • QPrinter & QPainter render() problem

    9
    0 Votes
    9 Posts
    6k Views
    M
    Handy hint. Thankyou.
  • 0 Votes
    3 Posts
    3k Views
    Q
    snapshot: !http://lijie.us/snapshots/thunderbird.png(Snapshot)! [quote author="Volker" date="1331411107"]Do you have small screenshot? That would help those guys like my, who don't have Thunderbird running :-) You can put the image to an image hoster of your choice, direct upload to DevNet is not possible, unfortunately.[/quote]
  • How to create a 32-bit application on 64-bit machine

    10
    0 Votes
    10 Posts
    12k Views
    A
    I have never used chroot before, but it seems it is worth giving a try. Thanks!
  • QNetworkAccessManager timeout

    4
    0 Votes
    4 Posts
    6k Views
    M
    You could manually start a QTimer at the same time you make your initial request, which would trigger the "timeout" handling if it is allowed to expire. Then in the slot which handles the finished() signal, you can stop the timer so it never has a chance to expire when things work as expected.
  • Problem drawing a QPixmap on screen with a QPainter

    3
    0 Votes
    3 Posts
    5k Views
    P
    Thanks for the quick response. This is indeed my problem here.