Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • QtDeclarative4.dll dependency to Qt SQL library

    4
    0 Votes
    4 Posts
    4k Views
    L
    @Andre: Thanks for the clarification. It didn't make sense to me at first, but it does now.
  • Call a function every time scrollbar change value

    Locked
    7
    0 Votes
    7 Posts
    10k Views
    G
    closed due to duplicate of "this thread":http://developer.qt.nokia.com/forums/viewthread/6380/
  • QGLWidget Viewport Ugly Text

    4
    0 Votes
    4 Posts
    3k Views
    J
    Hi Travis, I will try it out and let you know if I could get it working. The transparency in my opinion shouldn't be an issue and usually isn't (atleast with the QPainter, we do a lot of transparency in our app with QPainter with no issue). Anyways, I'll try it and get back to you.
  • [SOLVED] [QtSql] Create and configure a QTableView with Qt Creator

    16
    0 Votes
    16 Posts
    14k Views
    J
    Thats great :) Glad to help. Could you edit the title and put [Solved] in it. That's the general flow around here. Happy hacking!
  • Formatting New Linux Filesystems Using Qt

    17
    0 Votes
    17 Posts
    8k Views
    J
    bq. Actually you just might be wrong there I do know that the QtMobility Multimedia Library has been moved to to Qt 4.8 I think and if I am not mistaken there is a webcam api in there. I will have to test that on my system. In that case.. my bad, still with 4.7.3/4 here :P, working on the official SDK 1.1 for deploying to OVI store.
  • [SOLVED] [N00b] Need tips on creating UI

    5
    0 Votes
    5 Posts
    2k Views
    V
    Thanks for the tips!
  • How to create own input method for Qt Application?

    4
    0 Votes
    4 Posts
    3k Views
    J
    Windows by default, in the regional and language settings in Control Panel supports addition of languages, keyboards. But, you're right probably, that a custom layout/input method cannot be created using that. The KeyMagic tool looks interesting though. I don't know how that could be done in Qt.
  • Strange questions about QTableWidget

    10
    0 Votes
    10 Posts
    6k Views
    Y
    [quote author="jim_kaiser" date="1307907850"]Hi yeaiping, As Andre pointed out earlier, I hope you have put the Q_OBJECT declaration in your MyTableWidget.h class declaration. Also, for objects inheriting from QObject, we can simply use tr("<your string>") to translate.[/quote] Thanks
  • [SOLVED]unfix a window previously fixed

    4
    0 Votes
    4 Posts
    11k Views
    E
    Perfectely worked. For the one who has the problem. first : setFixedSize(size()); then :setMaximumSize(QWIDGETSIZE_MAX,QWIDGETSIZE_MAX); setMinimumSize(0,0); Thanks for help
  • QWidget unmovable

    5
    0 Votes
    5 Posts
    3k Views
    E
    In fact, my code is split in lots of files bso it won't be easy to show you. But I've made some deeper tests and the problem might be more complex indeed. In fact I think this is because I'm using a QGraphicsView with a scene. I put QLineEdit and Spinbox in it and when the they are right clicked the menu does everything possible not to get out of the QGraphicsView. I'm not sure I'm really clear sorry.
  • Designing simple integrated circuits simulator

    7
    0 Votes
    7 Posts
    5k Views
    N
    i have an item which inherits from GraphicsItem and i have another Item which inherits from GraphicsLineItem.I am using the second item to connect any two items which belong to the first class.In my code i am able to connect any two of the items with one line,but i want to be able to connect first item with the second one,not only with one line,but with two lines,and i want each of those two lines to connect to the second item at different places,i don't want the lines to overlap.So,lets say,we had two items and we wanted to connect them.The first line goes from lets say the middle of the first one and connects to the second item at some point p1.Then i want to create another line from the first item to the second one,also from the middle of the first item to some other point of the second one,lets say p2.What could i add to the following code to achieve that.Any suggestions?I have ideas,but i can't seem to implement them.Thanks very much Niko "This is my code":http://alas.matf.bg.ac.rs/~mi07137/code.txt I couldn't post it here because it's too large /////////////// after this,i create the mainwindow,put two buttons there and connect each-one with a certain type,the one connected to the type "And" will draw graphicsItems i defined in and.cpp file here and the one connected to the type "Povezi" will draw lines connecting every two items... Based on this code I can draw more than one line that connects any two items,but i dont want them to overlap,i want them to be distinct,aka end at different points of another item.I know the key is in the updatePosition() function defined in Linija.cpp file.. P.S.This example is based on DiagramScene example which is nicely explained in GraphicsView/Qt examples
  • How to set QIcon::fromTheme() to a label?

    2
    0 Votes
    2 Posts
    3k Views
    M
    Have you tried "QIcon::pixmap()":http://doc.qt.nokia.com/4.7-snapshot/qicon.html#pixmap yet?
  • [Solved] -std=c++0x causes compilation error

    5
    0 Votes
    5 Posts
    8k Views
    L
    I will, thanks. JFYI "this":http://gcc.gnu.org/projects/cxx0x.html is a list of C++0x language features supported by the various versions of GCC / MinGW.
  • [Solved] QVariant and custom types

    4
    0 Votes
    4 Posts
    5k Views
    L
    Ok, that's what I suspected.
  • Close() & WA_DeleteOnClose does not clean everything

    3
    0 Votes
    3 Posts
    14k Views
    G
    Qt::WA_DeleteOnClose eventually causes a call to deleteLater(). The objects are actually deleted once the event loop runs. Maybe some of the objects are stuck there. Anyways, Qt::WA_DeleteOnClose should be used for parent less QObjects only (e.g. stand alone toplevel widgets like a QMainWindow or a QDialog based UI). Everything else is deleted by the parent-child object relationship.
  • Some Question regarding Pointers and Destructors and safety...

    5
    0 Votes
    5 Posts
    4k Views
    J
    Hi Satmosc, What I meant by that was.. @ #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; delete m_testWidget; } void MainWindow::on_showButton_clicked() { m_testWidget = new QWidget(); m_testWidget->setAttribute(Qt::WA_DeleteOnClose); m_testWidget->show(); } @ In the above example, when we click the button a new window is shown, and as you can see, the window is created without a parent. The code would give a segfault in trying to delete the m_testWidget twice. When we close the window manually, it's deleted, but we are also deleting it in our destructor, so, it causes a crash. Of course, if you have a parent for a widget, then it is not a window by default, but can be made into one using the setWindowFlags(Qt::Window) as you have pointed out. I'm not able to replicate a case where the Qt::WA_DeleteOnClose conflicts with Qt's automatic destruction of objects using the parent/child. But what I meant about the main() function is: Don't do this: @ #include <QtGui/QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.setAttribute(Qt::WA_DeleteOnClose); w.show(); return a.exec&#40;&#41;; } @ Because, in this case, we would get a seg fault at the end of execution, because the main window is deleted on close, and at the end of main() which returns after the close of the main window, the variable "w" allocated on the stack will be tried to be removed causing multiple deletions. If I find some more relevant documentation, I will add it to this thread. [EDIT: Thank you Volker for the additional info. As mentioned above, you can use both the automatic memory management using parent/child and Qt::WA_DeleteOnClose together safely. So this is okay.. @ #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_showButton_clicked() { m_testWidget = new QWidget(this); m_testWidget->setWindowFlags(Qt::Window); m_testWidget->setAttribute(Qt::WA_DeleteOnClose); m_testWidget->show(); } @ )
  • Possible to capture all the tcp packages sent from my computer?

    3
    0 Votes
    3 Posts
    2k Views
    S
    For this you should take a look at the pcap lib and use Qt as frontend.
  • [SOLVED] [N00b] Access and usage of PostgreSQL functions in a Qt GUI

    13
    0 Votes
    13 Posts
    7k Views
    S
    I recently created a SQLITE database with a simple Qt interface, resorting to using raw SQL only for the CREATE TABLE statements when initializing an empty db. I used Qt classes for everything else, as this application is to take data from a giant POSTGRESQL db on the web and store some of it locally in SQLITE. I .append() then .setValue() QSqlFields to QSqlRecords that I .insertRecord() into QSqlTableModels which I had bound with .setModel() to my QTableViews. I had also done this whole project using .prepare() and .exec() of QSqlQueries. This way was a little less typing, and a little quicker to code. The simple SQL that I used could have been tailored for POSTGRESQL, which SQLITE would have converted internally (data types in particular), so it could be "cross db." I did the all SQL to all QSql-model comparison strictly to judge performance. There was simply no discernable difference in performance of the db actions when the app was being developed with a half-million records and the SQLITE .filename() was set to ":memory:". Disk access was the bottleneck in the final creation of the complete db. In the end- I prefered the QSql-classes all the way, especially for binding to my QModelViews and letting it negotiate the lazy population of views in my 16 million record db.
  • Stylesheet for qcombobox

    4
    0 Votes
    4 Posts
    8k Views
    L
    OK, you're right sorry about that, I thought the editable was for the lineedit (instead of just indicating whether it is present or not). I didn't find a way to access the QLineEdit directly from within the stylesheet, but you have two alternatives: Set the background for the entire QComboBox and set it back for QComboBox::drop-down Use the lineEdit() function to access the lineedit and set the stylesheet directly Hope that helps and sorry I lead you the wrong way at first
  • When will Qt support indicators?

    10
    0 Votes
    10 Posts
    5k Views
    T
    From what I understand the patch have some issues which need to be figured out before we can put it into Qt 4.8. This does not imply that the code is of minor quality or anything negative, just that some polish is required to make it work better on one platform or another, improve the APIs a bit, etc. A biggish contribution has to go through the legal department, too. All that takes a while. Having said all that: We have high hopes to improve the process of getting contributions into our code with the open governance process. Unfortunately I am not up to date with when that will finally become available, even though Qt Creator is doing a pilot of the process for a couple of weeks already. We can not wait to finally see the new process in the wild! Till the patch ends up in 4.8: Just use the Qt that your distributor has conveniently patched for you in your ubuntu version of choice. If you need a custom Qt, then just add the patch yourself and off you go:-) The sources are all there, you do not need to wait for us:-)