跳到內容

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k 主題 456.4k 貼文
  • QTcpSocket package loss [SOLVED]

    21
    0 評價
    21 貼文
    18k 瀏覽
    K
    Good to know that this solved your problem. BTW the while loop is not in the original example of 4.3.1 either. That is part of my changes. The fortune server sends the blockSize and the block afterwards. The modified server does send the original stuff a couple of times (1000 times in the example). So it sends the whole sequence repeated. The part in the while loop reads only one block each time from the socket. The while loop ensures that the socket content is read completely up to the end. You have no influence when and how often the readyRead signal is triggered. It may be triggered after each block sent. However, if you are sending the blocks without or with short delay only, it is likely that the readyRead is not triggered for each block. -Please mark the thread with [Solved] in the title.- [edit, was too late with last remark, koahnig ;-) ]
  • [SOLVED]QValidator

    4
    0 評價
    4 貼文
    2k 瀏覽
    R
    I called fixup function from validate and it works.
  • QAbstractTableModel implementation fails after short usage

    2
    0 評價
    2 貼文
    1k 瀏覽
    I
    Hi, As I know, QAbstractTableModel is abstract So to use it we have to subclass it. When subclassing QAbstractTableModel, you must implement the three pure virtual methods : @ virtual int rowCount ( const QModelIndex & parent = QModelIndex() ) virtual int columnCount ( const QModelIndex & parent = QModelIndex() ) virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) @ They are pure virtual (const=0) so they have to be reimplemented !!!
  • How to adjust widgets automatically to screen resolutions

    5
    0 評價
    5 貼文
    9k 瀏覽
    I
    Hi, There are 4 ready-made layouts : QVBoxLayout, QHBoxLayout, QGridLayout and QFormLayout. All of them inherit QLayout. If any of them doesn't fit your application you can subclass QLayout and create a custom layout :)
  • CD ripping

    3
    0 評價
    3 貼文
    1k 瀏覽
    Q
    Hi, i know it is off topic for Qt forum, but try those: "http://sourceforge.net/projects/libcdrip/":http://sourceforge.net/projects/libcdrip/ "http://www.un4seen.com/":http://www.un4seen.com/
  • QDrag and Skype issue (win only)

    5
    0 評價
    5 貼文
    2k 瀏覽
    F
    I see, it's not a problem if Qt, it's wrong mime data processing on Skype side. Along with "text/uri-list", Qt provides "UniformResourceLocatorW" value with the same data (i cant deny it, it is added a much deeper, than Qt user can get). And Skype processes both values - "text/uri-list" and "UniformResourceLocatorW", causing sending the same file twice.
  • [Solved] How to Handle all the keys in Key Press / Release Event?

    4
    0 評價
    4 貼文
    69k 瀏覽
    M
    Super Cool... It works fine. Thanks a lot... :)
  • Solved: Question about qrand()

    4
    0 評價
    4 貼文
    18k 瀏覽
    R
    Finally it works, I used srand() in Qt qsrand() and using the code: qsrand(time(NULL)); ID=qrand() % 6; qDebug << “ID random: “ << ID; Thanks for the idea srand().
  • [Solved] Graphic view to widget

    8
    0 評價
    8 貼文
    3k 瀏覽
    J
    Thank you for exellent links. I got it done. :) http://aijaa.com/cPWcy8
  • BT Chat Example

    1
    0 評價
    1 貼文
    984 瀏覽
    尚無回覆
  • QUrl::resolved doesn't work

    2
    0 評價
    2 貼文
    1k 瀏覽
    A
    Some points stand out - line 2 shows 'base', whilst line 8 shows 'baseUrl', so you are dealing with different objects. Have you defined 'base' anywhere? .resolved must follow a Qurl object, but you have 'baseUrl', which presuming you mean 'base', is a QString. Try changing line 2 to: Qurl baseUrl("http://qt.digia.com"); Also, line 7 seems pointless. You take a QString, change it to a Qurl, then convert back! The scope of uu and rurl are only within the if statement, so you will not be able to use them later in your code. Since urlForReq is a QString, you will not be able to use it as a Qurl without converting it later. HTH
  • How to use horizonalscrollbar and verticalscrollbar in dialog,please help anyone

    8
    0 評價
    8 貼文
    3k 瀏覽
    M
    Be sure and edit your initial post and add [Solved] to the title. Thanks!
  • Is is possible to create a semaphore accessable to both Windows and Qt applications?

    6
    0 評價
    6 貼文
    3k 瀏覽
    C
    I see, thanks! By the way, I just noticed that QSharedMemory::setNativeKey will set the native, platform specific key for this shared memory object, that will also help in Qt code to connect to shared memory created from Windows code.
  • QextSerialPort hangs on close()

    5
    0 評價
    5 貼文
    3k 瀏覽
    M
    Be sure and edit your initial post and add [Solved] to the title. Thanks!
  • [Solved]Can QTreeWidget Really be edited?

    1
    1 評價
    1 貼文
    5k 瀏覽
    尚無回覆
  • [Solved] How to change the default color of QTextDocument PlainText

    2
    0 評價
    2 貼文
    6k 瀏覽
    M
    I found a solution. The problem is, that QTextDocumentLayout::draw takes a parameter QAbstractTextDocumentLayout::PaintContext ctx. This one is defined inside QTextDocument. Now I wrote a new drawContents function which takes an additional parameter QTextDocument. The example from above works with this additional function. @void drawContents(QTextDocument *td, QPainter *p, const QRectF &rect) { p->save(); QAbstractTextDocumentLayout::PaintContext ctx; ctx.palette.setColor(QPalette::Text, p->pen().color()); if (rect.isValid()) { p->setClipRect(rect); ctx.clip = rect; } td->documentLayout()->draw(p, ctx); p->restore(); }@
  • How to resize the QDockWidgets of a QMainWindow in a different proportion?

    4
    0 評價
    4 貼文
    2k 瀏覽
    B
    From the event you get the old size and the new size. You have to write a function f(winsize) which can calculate the size of your dock widgets which can be resized by using their resize method.
  • [Solved] Resizing QQuickView or QWindow

    5
    0 評價
    5 貼文
    3k 瀏覽
    Z
    [quote author="beemaster" date="1351507667"]Have you tried "updateGeometry":http://doc.qt.digia.com/qt/qwidget.html#updateGeometry ?[/quote] Thanks for the tip, QWindow doesn't have updateGeometry().
  • [Solved]Hierarchy of Event

    7
    0 評價
    7 貼文
    3k 瀏覽
    D
    Thanks Andre.... :)
  • Subclassing QDebug to get rid of the NewLine of QDebug() function ?

    3
    0 評價
    3 貼文
    2k 瀏覽
    U
    Thanks Krzystof. That's exactly what i needed. Adding in the message handler this : @ case QtDebugMsg: std::cout << msg; break; @ gave me the behavior i was looking for.