Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.0k Posts
  • [Solved] Are nested event filters allowed/recommended

    20
    0 Votes
    20 Posts
    12k Views
    D
    Thank you for the additional clarifications!
  • Work with video files (movies), audio, images

    3
    0 Votes
    3 Posts
    2k Views
    C
    [quote author="stuk" date="1294751824"]For Image look "QImage":http://doc.qt.nokia.com/4.7/qimage.html -> "depth":http://doc.qt.nokia.com/4.7/qimage.html#depth -> "height":http://doc.qt.nokia.com/4.7/qimage.html#height [/quote] Thanks! It seems that for images this is the right way!
  • 0 Votes
    4 Posts
    3k Views
    P
    Hi, All: Thanks a lot. I just follow your recommendation, and it works now. Thanks again...
  • 0 Votes
    4 Posts
    3k Views
    D
    http://doc.qt.nokia.com/4.6/phonon-mediasource.html#MediaSource using phonon Phonon.MediaSource("yourFilePath.mp4")
  • Signals in iteration statements

    4
    0 Votes
    4 Posts
    2k Views
    V
    Do your widgets lies in one thread? Correct? Then why you want use signals? You can call slot directly: @for( some conditions ) { secondWidget->someSlot(); }@
  • Qt Drag and Drop not working with CLR support

    3
    0 Votes
    3 Posts
    3k Views
    D
    i got the problem solved. i knew that there is nothing wrong with the Qt, but it was related to COM/CLR interop issue. The solution was to set the Thread Attribute to STA.
  • [SOLVED]Regular Expresion and national letters

    11
    0 Votes
    11 Posts
    5k Views
    I
    [quote]f we write hex codes in sources no vendor will care for proper UTF-8 support in their products. Hexcodes are not the solution, they are the source of all that evil.[/quote] While it is a correct statement in general and I agree with you, it is not so right in regard to regexps. Regexps notion \uXXXX is a standard way to represent character in exact Unicode code point. And you have full control of what you are writing, thus you won't get any unexpected results if you use the hex notation in regexps. No encoding issues will bother you ever. BTW, there is \p{L} in regexps which is enough in the most cases.
  • How to catch all events before reaching child widgets at a container widget

    17
    0 Votes
    17 Posts
    25k Views
    F
    The problem mentioned above I guess that it was something regarding to timing. The timing 2 buttons was created, the timing childEvent was handled, the timing content widget finished its creation. But Gerolf's code successfully handled everything by going through every child widget. Thanks all you guys.
  • Qt for hardware acceleration

    3
    0 Votes
    3 Posts
    3k Views
    A
    Also, please update Qt if at all possible. Qt 3.3 is really old. It is no longer supported.
  • QComboBox Show/Hide Problem

    8
    0 Votes
    8 Posts
    11k Views
    G
    The problem is with you hideEverything() method. It explicitly hides more than you want and afterwards too less widgets are shown again. Try @ void TestPage::hideEverything() { foreach(QWidget w, m_fDetailsFrame->findChildren<QWidget>()) { qDebug() << "Hiding" << w; w->hide(); } } @ This are all the widgets hidden: @ QComboBox(0xf5b700, name = "comboBox") QComboBoxPrivateContainer(0x127df8e0) QComboBoxListView(0x127dcba0) QWidget(0x127dd6d0, name = "qt_scrollarea_viewport") QWidget(0x127dc250, name = "qt_scrollarea_hcontainer") QScrollBar(0x127b9f00) QWidget(0x127dec90, name = "qt_scrollarea_vcontainer") QScrollBar(0x127def70) QComboBoxPrivateScroller(0x127e0190) QComboBoxPrivateScroller(0x127e0320) QLabel(0xf45330, name = "label") @ You re-show only two of them. The private sub widgets of the combo boxes are not shown again and thus remain hidden or in a weird state. Additionally: Your program crashes in the the destructors: @ TestPage::~TestPage() { // ERROR: double delete delete m_fDetailsFrame; delete m_gLayout; } // and TestWizard::~TestWizard() { // ERROR: double delete delete m_tp; } @ You delete the members although they are automatically deleted via Qt's parent-child relationship of QObjects. Additonally 2: You have weird system to access the members of your UI. Finding them via findChild() is expensive and error prone. You can access them directly via the ui member object: @ m_fDetailsFrame->findChild<QWidget*>("comboBox")->show(); // is the same as ui.comboBox->show(); @ As an additional goodie you get the pointer to the right class (QComboBox) and call QComboBox' methods. With your method you only get the QWidget pointer and only access to QWidget's methods. Additionally 3: You create Widgets but do not put them into layouts. Your UI will look ugly at best and be (partly) inaccessible by the user at worst.
  • Multiple views one document

    6
    0 Votes
    6 Posts
    6k Views
    A
    ChicoB: how do you want to present the different views on your data? Do you want them to be separate windows, MDI subwindows? Positioned on different tabs? Items you can position in a bigger view area? The options are nearly endless, so you have to figure out a design that makes sense for your application. Then, Gerolf is right that you can use MDI, even if you are dealing with a single document. It really doesn't matter for Qt if you actually put separate documents in your MDI window or if you just present multiple views on the same document, or if you do something else entirely in your subwindows. It is up to you.
  • Closing one socket closes multiple connections

    14
    0 Votes
    14 Posts
    7k Views
    G
    Oh, that's a common pattern. You read what you want to be there, not what's actually there. That's why it's so important to have someone else proofread your thesis, books or wiki pages :-)
  • How to color in textbrowser

    2
    0 Votes
    2 Posts
    4k Views
    G
    You can enclose the text in html span tags and add the color: @ QString message = "<span style='color: red'>hello</span>" @
  • [SOLVED] detecting variables if exist

    7
    0 Votes
    7 Posts
    8k Views
    G
    But that only gives you, whether the source string is empty. if you want to check, how many elements are in the list, you have to do it the following way: @ QString str = "hello - world"; QStringList s_str = str.split("-"); if (s_str.count() > 0)) { // like this one // exist } if (s_str.count() > 3) { // like this one also // not exist } @
  • Using Signals and Slots to link a Button to ComboBox Items

    7
    0 Votes
    7 Posts
    10k Views
    ZlatomirZ
    Why you need to investigate setupUi? You have another problem with setupUi()? Because setupUi has nothing to do with this problem, the recommended reading should be signals and slots "documentation":http://doc.qt.nokia.com/4.7/signalsandslots.html And some practice with C++ classes, members, encapsulation, this pointer... Basically the slot is member of the class you create (configurator_tool) not a member of the QComboBox and this pointer is as a pointer to the class object instance. You just access and modify the combobox form the slot, but the slot is part of the instance of configurator_tool class. LE: Volker i'm getting closer, same minute now ;) haha...
  • How to reload the tableview to reload its data ?

    4
    0 Votes
    4 Posts
    11k Views
    G
    The call to select does the trick alone. Calling setModel() with the same model as before is a no-op anyways :-) @ void QAbstractItemView::setModel(QAbstractItemModel *model) { Q_D(QAbstractItemView); if (model == d->model) return; @
  • QFtp with unicode

    8
    0 Votes
    8 Posts
    5k Views
    F
    [quote author="khend" date="1294331766"]Thanks for the replies - looks like I need to do more testing with different types of servers.[/quote]Again, it is probably the clients that need checking. The servers are very likely to be ignorant of encoding (it really doesn't care which number represents which character). In that line it is very likely that QFtp uses the toLocal8Bit, toAscii or codecForCStrings for the file transfer. You could try setting the latter to UTF-8, which should result in proper unicode strings on the other side. If that fails, try using QNetworkAccessManager instead of QFtp, which is the recommended thing to do anyway.
  • Unable to connect a socket with QTcpSocket...

    3
    0 Votes
    3 Posts
    3k Views
    W
    Ok thanks. That would certainly explain it. I'll give that a try and get back. Thanks much, Windy
  • [SOLVED] Exception safety in widget constructors?

    22
    0 Votes
    22 Posts
    13k Views
    P
    try-function-blocks are the only way to catch exceptions from the initializer list, too. I would leave a comment every time you use it. Its very simple to forget the auto-rethrow thing. My recommended reading for exception handling is "german article ":http://tinyurl.com/3yuh57x and Bjarne himself "Exception safety in TC++PL":http://www.research.att.com/~bs/3rd_safe0.html
  • XSD: XML Data Binding for Qt

    17
    0 Votes
    17 Posts
    20k Views
    D
    Dear Fellows ,Be sure i will keep you inform.It s eclipse plugin based(Helios) by the way.