Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Use classes from a plugin inQT

    2
    0 Votes
    2 Posts
    974 Views
    JeroentjehomeJ
    There are more the one way a library can get published to the users. If you have a .lib file and a .h file include the .h file and your able to use all classes defined in the header file. What usually is a good way to avoid the problems of recursive included is forward declarations, but then you are only able to use pointers to classes. Hope this will give you some more ideas. Maybe some more information about the plugin might help. What kind of files do you have? Greetz
  • How to insert a GraphicsView into QML

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How to add file save functionality to a Qt application ?

    4
    0 Votes
    4 Posts
    2k Views
    I
    It's Ok I used XML and it works well :)
  • How to use QTextCursor to highlight a text

    6
    0 Votes
    6 Posts
    4k Views
    R
    So far as I used it, myPosition is just the index of the character in the total string. So if there is an error say 5 characters from the beginning of the string then I'd set myPosition to 4. As for what a block is, I always get the entire text edit text in one highlightBlock() call so I never went into that.
  • 0 Votes
    2 Posts
    993 Views
    M
    That's basically a Tab widget with the tab headers shown on the left (west), rather than on the top (north). Unfortunately, Qt's Tab widget will draw the tab headers vertically when they are moved to the left (west), which is probably not what you want. Maybe you can simply use a QStackedWidget and construct the headers (page/tab selector) yourself, probably with something like a ListView widget...
  • QMutex pointer is misaligned

    9
    0 Votes
    9 Posts
    10k Views
    L
    You've written to a memory region you are not allowed to, most probably due to a buffer underrun or a dangling pointer, which leads to a corrupted MyBuffer and in further consequence QMutex object. It should be actually quite easy to visualize. Place a breakpoint at the QMutexLocker constructor. If the address for <code>&mMutex</code> varies between consecutive calls you've corrupted your memory somewhere. You might be able to trace the problem with some properly placed data breakpoints (for example on <code>*this</code>) or, as mentioned, valgrind it.
  • QToolBox remove widget

    4
    0 Votes
    4 Posts
    3k Views
    I
    bq. broadpeak : I cannot retrieve the current (selected) button (to remove)… In this case I suggest to use QToolButton with QButtonGroup you will find it easiest : bq. QButtonGroup class provides a container to organize groups of button widgets. QButtonGroup provides three methods (signals) that allow you to determine the clicked button by returning its id !! and make this small change in your code please: @widget = new QWidget(toolBox);@ or simply : @widget = new QWidget;@ The widget's parent is not required because you will call QToolBox::addItem() !
  • Using QTextCursor::setPosition() and bring to top of QTextEdit

    4
    0 Votes
    4 Posts
    11k Views
    G
    It might be worth a try to get the rectangle (in viewport coordinates) that includes the cursor using "QTextEdit::cursorRect() ":/doc/qt-4.8/qtextedit.html#cursorRect-2 and then ask the viewport to scroll to that position.
  • QToolBox and the drag_and_drop

    2
    0 Votes
    2 Posts
    1k Views
    G
    You would need to subclass QToolBox and (re)-implement some or all of mousePressEvent, mouseMoveEvent, dragEnterEvent, dragMoveEvent, dropEvent. Also, have a look at the "Drag and Drop":/doc/qt-4.8/dnd.html documentation. It should give you a hint on how to start.
  • Symbol(s) not found for architecture x86_64

    3
    0 Votes
    3 Posts
    8k Views
    G
    You need to adjust the architecture settings four your whole chain of libraries, frameworks etc. All those must at least contain every architecture that your final executable should run on. An OS X binary can contain up to four architectures: PPC and Intel and each in 32 and 64 bit. You can tweak the settings with += and -= on qmake's CONFIG variable, using ppc, ppc64, x86 and x86_64. Please have a look at the complete linker output, it tells you for which symbol the code is missing.
  • [Solved] QGraphicsObject with child groups mousePressEvent not firing

    5
    0 Votes
    5 Posts
    4k Views
    M
    Found my problem. I was adding MyItem objects to a group and then adding that group to my scene, turns out if I set setHandlesChildEvents to false on my group then it allows MyItem to get the mouse events as normal. Hope this is helpful.
  • QDebug() does not display anything.

    10
    0 Votes
    10 Posts
    25k Views
    sierdzioS
    wow, that is quite unexpected :) Glad you are OK again, though :D
  • Encryptor: Simple project to encrypt and decrypt data.

    4
    0 Votes
    4 Posts
    7k Views
    R
    Also, in Qt Creator source, you can see that it uses Botan somewhere, which is more adept to C++ instead of OpenSSL which is C oriented. For C++, I found easier to use Botan than OpenSSL
  • Where to look to make sticky notes (like gadgets in Windows 7)?

    3
    0 Votes
    3 Posts
    4k Views
    B
    http://qt-project.org/faq/answer/how_can_i_move_a_window_around_when_using_qtframelesswindowhint
  • [Solved] How to add Graphic with transparency as Button

    23
    0 Votes
    23 Posts
    13k Views
    U
    Overloading is not specific neither to QWidget nor to Qt, it is a C++ feature that allows you to replace a method of a given object. You just inherit from QWidget, reimplement the paintEvent so that instead of doing whatever QWidget does to paint what you want - an image based on the state of your button.
  • QByteArray maximum size

    7
    0 Votes
    7 Posts
    15k Views
    G
    I currently only have 3GB memory on my workstation so I can't really test it. But thanks anyway, I don't think my program users will ever use more than 1GB or so.
  • [Solved] moc, setProperty

    5
    0 Votes
    5 Posts
    2k Views
    L
    You are welcome. Feel free to edit the thread title to '[Solved] ...' to indicate that there is a solution inside. And bear in mind that there is a significat performance penalty in using <code>.toStdString().c_str()</code> over <code>.toLatin1().constData()</code>.
  • ETA on next sdk release with new QT Creator?

    2
    0 Votes
    2 Posts
    1k Views
    sierdzioS
    Use standalone Qt Creator, then. Better use standalone libraries, too. SDK was developed by Nokia, and not updated for past 6+ months. Digia has not released non-commercial one yet.
  • Qtcreator 2.5.2, qt 4.8.1,,, resource file?

    14
    0 Votes
    14 Posts
    4k Views
    mrdebugM
    Here is the link: https://bugreports.qt-project.org/browse/QTBUG-27424 My fear is that the bug report is not clear because my english is very bad (now I'm doing an English course).
  • QFile: Append mode does not work well.

    7
    0 Votes
    7 Posts
    13k Views
    L
    Acctually, as u see, i didn't use position or seek() in my code. i really wanna append contents to the end of the file, but it didn't work to use QIODevice::Append flag.