Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • QAbstractTableModel implementation fails after short usage

    2
    0 Votes
    2 Posts
    1k Views
    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 Votes
    5 Posts
    9k Views
    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 Votes
    3 Posts
    1k Views
    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 Votes
    5 Posts
    2k Views
    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 Votes
    4 Posts
    69k Views
    M
    Super Cool... It works fine. Thanks a lot... :)
  • Solved: Question about qrand()

    4
    0 Votes
    4 Posts
    18k Views
    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 Votes
    8 Posts
    3k Views
    J
    Thank you for exellent links. I got it done. :) http://aijaa.com/cPWcy8
  • BT Chat Example

    1
    0 Votes
    1 Posts
    984 Views
    No one has replied
  • QUrl::resolved doesn't work

    2
    0 Votes
    2 Posts
    1k Views
    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
  • 0 Votes
    8 Posts
    3k Views
    M
    Be sure and edit your initial post and add [Solved] to the title. Thanks!
  • 0 Votes
    6 Posts
    3k Views
    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 Votes
    5 Posts
    3k Views
    M
    Be sure and edit your initial post and add [Solved] to the title. Thanks!
  • [Solved]Can QTreeWidget Really be edited?

    1
    1 Votes
    1 Posts
    5k Views
    No one has replied
  • [Solved] How to change the default color of QTextDocument PlainText

    2
    0 Votes
    2 Posts
    6k Views
    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(); }@
  • 0 Votes
    4 Posts
    2k Views
    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 Votes
    5 Posts
    3k Views
    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 Votes
    7 Posts
    3k Views
    D
    Thanks Andre.... :)
  • Subclassing QDebug to get rid of the NewLine of QDebug() function ?

    3
    0 Votes
    3 Posts
    2k Views
    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.
  • Static library problem...

    3
    0 Votes
    3 Posts
    1k Views
    appollosputnikA
    yes I ran in debugger. After the function called it returned exited with code 1.
  • Solved: How to export points data to txt or csv file?

    9
    0 Votes
    9 Posts
    6k Views
    R
    Many thank's, finally it works using QTextStream. :)