Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Can't insertColumn to an QSqlTableModel

    6
    0 Votes
    6 Posts
    8k Views
    A
    OK, in that case, you have to go with a proxy model. There are several examples of using a proxy model here on the forum to add or modify data. Start out with subclassing QSortFilterProxyModel (Qt 4.7) or QIdentityProxyModel (Qt 4.8) as your starting point. Then, reimplement the columnCount() method to return the columnCount of your base model + 1. Then, you'll need to handle the calls to data(), headerData() and flags() for your new column.
  • QDeclarativeListView

    2
    0 Votes
    2 Posts
    2k Views
    A
    You can retreive the QObject pointers if you need by setting objectName on the views, and querying the context for those names. You can interact with the properties and signals & slots through that interface. Not ideal, but it may be enough for you.
  • Using QLibrary to load a QWidget

    8
    0 Votes
    8 Posts
    8k Views
    G
    And what do you need to use the plug-in? :-) the creator function approach uses the interface technique, which means, you have a header for the interface, but not for the specific implementation. If you use plug-ins (Qt-plugins) and it is enough for you to have the QWidget interface for the class (and the rest only via signal/slot or Q_INVOKEABLE methods) you can use plug-ins. otherwise you also need header files.
  • Code doesnt work

    6
    0 Votes
    6 Posts
    3k Views
    S
    There is an ambiguous 'else' here. put contents of every if in {} always. also you don't need to convert QChar s to QString . they are themselves comparable. I assume needNext is a QString (is not?) try tis code: @ for(int a=0; a<=needNext.count(); a++) { if (needNext[a]!=QChar(' ')) { if (needNext[a]==QChar('}')) { qDebug() <<"1"+ needNext[a]; isClass=true; // a=needNext.count(); // probably you mean: break; } else { //a=needNext.count(); break; qDebug() <<"2"+ needNext[a]; } } }@ If you want to iterate over all characters of a QString, you may want to use a bit more elegant way using iterators: @ QString::ConstIterator i = needNext.begin(); while(i != needNext.end()) { if ( *i !=QChar(' ')) { if ( *i ==QChar('}')) { // ... i++; } @
  • QPainter drawRect on QImage

    5
    0 Votes
    5 Posts
    23k Views
    T
    This is from the 4.6.2 doc: Warning: Painting on a QImage with the format QImage::Format_Indexed8 is not supported I suppose QImage::mono is not supported either since it also uses table look up. -Todd
  • Howto implement the QML "Search Box Example" in the Widget world

    4
    0 Votes
    4 Posts
    5k Views
    C
    Yes, you can use setPlaceholderText() function in QLineEdit :)
  • [SOLVED]Problem with horizontalScrollBar

    4
    0 Votes
    4 Posts
    2k Views
    K
    yeah, it's work, thank You for fast reply
  • 0 Votes
    2 Posts
    4k Views
    D
    You can't move QWebPage to other threads. It uses GUI elements and it must live in the main thread.
  • 0 Votes
    3 Posts
    3k Views
    B
    Hi Koahnig, I think I have solved the problem. It was in fact not a problem with where I ran the code from, but rather I have a dual-monitor setup and on one window it would create this problem, but on the other monitor it would be fine. I think there is something else going on. I will need to find out why the multi-monitor setup is causing problems, it does not happen in when compiled in debug mode as it looks like the debug mode automatically defaults to monitor 1 (as it only opens up on the left side monitor). But if the program opens up on the right side monitor it creates this problem. (monitor 2) I will have to resubmit this issue as a multi-monitor issue most likely. Thanks for you help though. But just for your information. I compiled the code for release and would copy the relevant Qt dlls into the same directory. The other dynamic libraries are in the path. So I never did an installation build etc.
  • [solved] Making a QML file fill a QDeclarativeView

    3
    0 Votes
    3 Posts
    4k Views
    K
    Works perfectly, thank you.
  • How to work with projector and camera?

    11
    0 Votes
    11 Posts
    5k Views
    P
    Yes, thanks. Mhm... You gave me an idea... For example: "Link to video cam":http://www.mobilewhack.com/images/panasonic_vdr_d400_dvd_video_camera.jpg Okay, but I need to stream it in realtime.
  • Press "Enter"

    10
    0 Votes
    10 Posts
    6k Views
    R
    Tobias Hunger, you are right Many thanks for all!!
  • [Solved] How to create QDockWidget?

    5
    0 Votes
    5 Posts
    5k Views
    EddyE
    you need to choose one and set it as central widget. The others can be docks like in the Dock widgets example.
  • [Solved] How to add menu item and trigger action?

    5
    0 Votes
    5 Posts
    11k Views
    EddyE
    Right mouse button in action editor... then "go to slot" and choose the signal you want.
  • QVTKWidgets.dll

    3
    0 Votes
    3 Posts
    3k Views
    L
    Finally I have figured out what is happening. When compile VTK, I am using "Debug" mode rather than "Release" Mode. After I recompiled VTK in "Release" Mode, and copied the qVTKWidgets.dll into QT designer's plugin directory, QT designer is working now. Some reference can be found in the page :http://www.kitware.com/InfovisWiki/index.php/Titan_Simple_Application , from which I got the idea to compile VTK In "Release" Mode. Hopes this will help those who encounter similar problem.
  • [Solved] How to add QToolBar in Design?

    3
    0 Votes
    3 Posts
    16k Views
    EddyE
    are you using Qt Creator/Qt Designer? Then they should appear automatically in the action editor. Right mouse button click and you will see lots of possibilities. Qt Docs : Creating Main Windows in Qt Designer will show you more details
  • Alignment of Table Horizontal Headers

    6
    0 Votes
    6 Posts
    7k Views
    A
    @ShawnG: Could you tell us what model and what view you are using? Are you using a QStandardItemModel with a QTableView, or a QTableWidget? Or something else?
  • Error with QList

    Locked
    37
    0 Votes
    37 Posts
    20k Views
    G
    [quote author="gogoi" date="1306838572"]ok thanks cincirin...hey one morething i like to ask u..Actually i want to open a virtual keyboard on click of a pushbutton..so how shall i do it... regards gogoi[/quote] You've opened a "separate thread":http://developer.qt.nokia.com/forums/viewthread/6371/ for this, so I'm closing this one.
  • [Solved]QGraphicsView - no QPixmap shown load from resources (Linux)

    3
    0 Votes
    3 Posts
    9k Views
    L
    [quote author="ruehlchr" date="1306816114"]Solved: The QGraphicsScene scene should be a private member of the class. private: QGraphicsScene *scene; and in the constructor scene = new QGraphicsScene(); Cheers [/quote] You probably can do in the constructor: @ QGraphicsScene *scene = new QGraphicsScene(); @
  • Add ...Box to UI

    7
    0 Votes
    7 Posts
    3k Views
    C
    Ok, then, as @Jens wrote, you can use TabWidget which can be used in designer.