Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • QRegExp - Question on defining a regular expression

    3
    0 Votes
    3 Posts
    4k Views
    K
    Exactly what I needed, thanks!
  • QT list question

    3
    0 Votes
    3 Posts
    2k Views
    K
    [quote author="maybnxtseasn" date="1330232961"]If i allocate objects and place them inside a list, will the QList perform the deallocation on the objects i dynamically allocate and place in the list when the QList dies?[/quote] Assuming that you mean having pointers to these objects and place them in QList. It depends on the items in your list, but not in general. If you would use QSharedPointer to store in QList, the objects will be destroyed when those references are the last ones.
  • I can't download New Qt4.x

    10
    0 Votes
    10 Posts
    6k Views
    F
    very very thanks for your answers.
  • Changing Positions and Sizes of GUIs in code?

    3
    0 Votes
    3 Posts
    2k Views
    B
    You may want to take a look at "this thread":http://developer.qt.nokia.com/forums/viewthread/14814/.
  • Layouts and Form Size, menu-strip color

    11
    0 Votes
    11 Posts
    6k Views
    B
    Okay, keep us posted on your progress.
  • QDatastream

    6
    0 Votes
    6 Posts
    3k Views
    I
    I almost forget one thing. Sometime, I use QPoint to exchange with my PNT struct like spnt.x=qpnt.x(); It will work if qpnt.x>=0, but it won't work if it is negative. Oh well. I just used integer in my struct and then convert it to qint32 before serialize it. And do the other way around after desrialization. Thanks.
  • QDate::daysTo but only with yyyy-MM-dd

    8
    0 Votes
    8 Posts
    5k Views
    F
    Sorry, what i'm trying to do is to check how many days until a date. I mean, i have 2012-02-20 (20 February 2012). I want to count how many days until today (Since today is 25, 5 days). EDIT: Okay, i've got it. Was something like creating a TempDate and doing QDate::fromString("2012-02-20", "yyyy-MM-dd") then doing temp.daysTo(QDate::currentDate) @ QDate temp; temp = QDate::fromString("2012-02-20", "yyyy-MM-dd"); qDebug() << temp.daysTo(QDate::currentDate());@
  • [SOLVED] Strange problem with resource file

    4
    0 Votes
    4 Posts
    3k Views
    ?
    For some reason I get this: @ Cannot retrieve debugging output.@ However, I used this ;) : @ ui->test->setVisible(!QFile::exists(":/wav/Kick.wav"));@ and the test button disappears, meaning it returns true, the button is visible by default so hiding it means the file is there, so my bet is QSound has some problem playing from .qrc files... Edit: @cincirin - thanks, just saw your reply when I posted Edit2: Turns out QSound is a dead end, it is not even supported in Necessitas
  • [Solved] Can't compile project with makefile generated by qtmake

    5
    0 Votes
    5 Posts
    4k Views
    F
    @Blizzard, Thanks, my problem was being caused by the same reason as described in http://www.qtforum.org/article/25985/compiling-hello-world-after-fresh-install-fails.html. In fact I had an Autorun entry in the Windows registry so that CMD.EXE would startup in a custom working directory. Removing that custom entry solved the problem.
  • [Solved] qt shared libraries not found

    4
    0 Votes
    4 Posts
    7k Views
    W
    I put the dll requested in the same directory of the executable and it works thanks! :D
  • Can't add widget created by Designer

    12
    0 Votes
    12 Posts
    7k Views
    B
    I would recommend reading the "mainwindow documention":http://developer.qt.nokia.com/doc/qt-4.8/QMainWindow.html, and some beginner Qt material - there is a ton available online. This "thread":http://developer.qt.nokia.com/forums/viewthread/8779 might prove useful as well.
  • SetTextAlignment has no effect with QListWidget items

    2
    0 Votes
    2 Posts
    2k Views
    L
    Please try to example code posted at this FAQ: "How can I align the text and icons in an itemview?":http://developer.qt.nokia.com/faq/answer/how_can_i_align_the_text_and_icons_in_an_itemview
  • [Solved] Deploying Mac App (app bundle within app bundle)

    5
    0 Votes
    5 Posts
    7k Views
    P
    Not really solved. Gave up on the app bundle within app bundle concept. Changed the helper app to be just a unix executable at the same level as the main app. Manually changed the @executable_paths within the helper and all seems to work.
  • Simple 2 integer number calculator

    16
    0 Votes
    16 Posts
    14k Views
    S
    You just need to know when to parse the first and second numbers based off of the users input. So, how do you know when the user is done entering the first number? How do you know when the user is done entering the second number? Answer those questions and then use QString::number to get the first and second number from the line edit.
  • Silly question - how to permahide snippets of code?

    5
    0 Votes
    5 Posts
    2k Views
    B
    Except for my compulsive need to close everything down when I'm done working, and to not have windows open if I'm not using them. Oh well. Thanks for the suggestion though!
  • QLabel: outline text (stroke)

    4
    0 Votes
    4 Posts
    9k Views
    M
    Everything is possible, but not everything is possible right out of the box. There's generally some way to accomplish something, but it might not be clean, easy, or pretty.
  • Glut idle function

    2
    0 Votes
    2 Posts
    3k Views
    B
    Hopefully this helps: "Glimpsing the Third Dimension":http://doc.trolltech.com/qq/qq06-glimpsing.html
  • 0 Votes
    2 Posts
    1k Views
    B
    Can you show some code?
  • [Solved] QScrollArea into QFrame

    3
    0 Votes
    3 Posts
    8k Views
    S
    I found a solution. The solution is create a layout like this: QScrollArea -> QWidget (like a containers) -> QVBoxLayout -> QWidget (my real qwidget) The code is something like this: @ containerWidget = new QWidget(); scrollContainer = new scrollContainer(); scrollContainer->setWidget(containerWidget); layout = new QVBoxLayout(this); containerWidget->setLayout(layout); layout->addWidget(myWidget1); layout->addWidget(myWidget2); layout->addWidget(myWidget3); @
  • 0 Votes
    12 Posts
    16k Views
    L
    [quote author="ddriver" date="1330097642"]Yes, this is the generic way to go, I was just curious if Qt provides some improvement as it does in many other areas. I suppose it is possible to extend stock Qt classes with additional member variable to identify a set of pre-defined objects during runtime instead of casting one by one. Then a simple switch should be way faster than a chain of dynamic casts.[/quote] Well, you won't win anything ;-) You always can identify QObject classes during runtime using QObject::metaObject()->className(), but in order to use it you will have to cast to it. Each class has its unique interface (set of methods, members and properties) and in order to access this interface (invoke a method) you will have to use either a pointer of the class' type or the parent class' type, because C++ enforces strict typing. And this type has to be known at compile time. So in order to distinct n different classes you will have in any case to cast n times. If multiple object share the same interface they share the same base class, so they can be called through a base class pointer, to which you have to cast too. Qt doesn't improve anything here because there is just nothing to improve. That's how C++ and any other non-interpreted language works ;-)