[Qt-interest] help

Juan Pablo Crossley crossleyjuan at gmail.com
Tue Jun 2 20:24:50 CEST 2009


On Mon, Jun 1, 2009 at 9:50 PM, <qt-interest-request at trolltech.com> wrote:

> Send Qt-interest mailing list submissions to
>        qt-interest at trolltech.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.trolltech.com/mailman/listinfo/qt-interest
> or, via email, send a message with subject or body 'help' to
>        qt-interest-request at trolltech.com
>
> You can reach the person managing the list at
>        qt-interest-owner at trolltech.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Qt-interest digest..."
>
>
> Today's Topics:
>
>   1. Expander (Rick Vernam)
>   2. Making a Demo Movie (Samuel Baxter)
>   3. Re: [Qt-Interest] Painting outside paintEvent in QT4.5 :
>      Widget painting can only begin as a result of a paintEvent
>      (Malyushytsky, Alex)
>   4. Re: QTableWidget: cannot insert an item that is already   owned
>      by another QTableWidget (Malyushytsky, Alex)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 1 Jun 2009 19:41:07 -0500
> From: Rick Vernam <rickv at hobi.com>
> Subject: [Qt-interest] Expander
> To: qt-interest at trolltech.com
> Message-ID: <200906011941.08175.rickv at hobi.com>
> Content-Type: text/plain; charset="us-ascii"
>
> I've been looking for an Expander Widget, like what we use to expand
> QTreeView
> items - you know the box with a plus / minus in it for expanding and
> collapsing a row...
>
> I keep coming up empty - does there exist such a thing?
>
> Thanks,
> -Rick
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.trolltech.com/pipermail/qt-interest/attachments/20090601/7c78d55a/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Mon, 1 Jun 2009 19:03:36 -0600
> From: Samuel Baxter <samuel857 at gmail.com>
> Subject: [Qt-interest] Making a Demo Movie
> To: Qt-interest at trolltech.com
> Message-ID:
>        <86ba3dce0906011803j3152437cwb5e49b8b022b1032 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I would like to record a video demonstrating an application such as
> the one attached.
>
> I have tried a screen grabbing utility (Screenium under Mac OSX), but
> the resulting movie is very choppy. Screenium is clearly congested
> writing to disk and can only grab one every several frames.
>
> Is there support in Qt for saving frames into main memory? One would
> write the outcome at a later point and then assemble the frames into
> an animation. How would you do it?
>
> Neither QGraphicsView nor QTimeLine seems relevant here.
> The actual application runs in 3D and so QGraphicsScene could not
> replace QGLWidget.
>
> Samuel
>
> ---------------- dump_screen_for_video/dump_screen_for_video.pro
> ----------------
> TEMPLATE = app
> TARGET =
> DEPENDPATH += .
> INCLUDEPATH += .
> QT        += opengl
>
> # Input
> HEADERS += screen_dumper.h
> SOURCES += main.cpp
>
> ---------------- dump_screen_for_video/main.cpp ----------------
> #include <QApplication>
> #include <iostream>
>
> #include "screen_dumper.h"
>
> int main(int argc, char *argv[])
> {
>    QApplication app(argc, argv);
>
>    if (!QGLFormat::hasOpenGL()) {
>        std::cerr << "This system has no OpenGL support" << std::endl;
>        return 1;
>    }
>
>    Screen_Dumper screen_dumper;
>    screen_dumper.setWindowTitle(QObject::tr("Screen Dumper"));
>    screen_dumper.resize(640, 480);
>    screen_dumper.show();
>
>    return app.exec();
> }
>
> ---------------- dump_screen_for_video/screen_dumper.h ----------------
> #ifndef SCREEN_DUMPER_H
> #define SCREEN_DUMPER_H
> #include <QtGui>
> #include <QGLWidget>
> #include <QtGlobal>
> #include <QtCore/QDebug>
> const int TIMER_INTERVAL = 15;
>
> class Screen_Dumper : public QGLWidget
> {
>    Q_OBJECT
> public:
>    Screen_Dumper(QWidget *parent = 0) : QGLWidget(parent)
>    {
>        setFormat(QGLFormat(QGL::DoubleBuffer));
>        timer_number = startTimer(TIMER_INTERVAL);
>        qtime = QTime(0,0,0,0);
>    }
>    virtual ~Screen_Dumper() { killTimer(timer_number); }
> protected:
>    void timerEvent(QTimerEvent*) { updateGL(); }
>    void initializeGL() {
>        glDisable (GL_LIGHTING);
>        glClearColor (0.1, 0.2, 0.5, 1.0);
>        glColor3f(1.0, 1.0, 1.0);
>        glLineWidth(5.0);
>
>        glEnable (GL_LINE_SMOOTH);
>        glEnable (GL_BLEND);
>        glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
>        glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
>    }
>
>    void resizeGL(int width, int height) {
>        glViewport (0, 0, (GLsizei) width, (GLsizei) height);
>        glMatrixMode (GL_PROJECTION);
>        glLoadIdentity();
>        glOrtho(-width/2.0, width/2.0, -height/2.0, height/2.0, -1.0, 1.0);
>
>        glMatrixMode(GL_MODELVIEW);
>        glLoadIdentity();
>    }
>
>    void paintGL() {
>        glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
>        glPushMatrix();
>        glRotated(qtime.elapsed() / 30.0, 0.0, 0.0, 1.0);
>        glBegin(GL_LINES);
>        glVertex2d(0.0, 0.0);
>        glVertex2d(150.0, 0.0);
>        glEnd();
>        glPopMatrix();
>
>        glFlush ();
>    }
> private:
>    QTime qtime;
>    int timer_number;
> };
>
> #endif // SCREEN_DUMPER_H
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 1 Jun 2009 19:20:50 -0700
> From: "Malyushytsky, Alex" <alex at wai.com>
> Subject: Re: [Qt-interest] [Qt-Interest] Painting outside paintEvent
>        in QT4.5 : Widget painting can only begin as a result of a
> paintEvent
> To: "qt-interest at trolltech.com" <qt-interest at trolltech.com>
> Message-ID: <F8145CF983B4DB42855E9BB7F5BE8FCC19C73158 at camail2>
> Content-Type: text/plain; charset="utf-8"
>
> According to how I see it:
>
> Approach A (simplest)
> ------------------------------------------------------------------
> Instead of painting to the widget, paint to the QPixmap or QImage.
> Update the widget when painting done.
>
> + minimum changes to the paining code.
> - sometimes update of the whole widget from image is inefficient and it
> might be not that easy to implement it efficiently.
>   And things got worse when you like to see evolution of the drawing on the
> screen instead of the result.
>
>
> Approach B (never tried, but it looks promising, if I don't make any
> mistake about it functionality)
> ------------------------------------------------------------------
> Paint to QPicture, store QPicture object(s).
> Call update when required, use QPicture object to draw in the paint event.
>
> I can't recommend it, cause I never tried, but it seems more powerful.
>
>
> Best regards,
>
> Alex
>
>
>
>
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:
> qt-interest-bounces at trolltech.com] On Behalf Of Thiago Macieira
> Sent: Saturday, May 30, 2009 2:52 PM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] [Qt-Interest] Painting outside paintEvent in
> QT4.5 : Widget painting can only begin as a result of a paintEvent
>
> shivam priyadarshi wrote:
> >I have this kind of code structure at various places in application. I
> >have tight schedule, it will be great help if you can help me with make
> >it work with QT4.5 with painting outside paintEvent.
>
> You have to refactor your code so that you paint only inside the
> paintEvent.
> --
> Thiago Macieira - thiago.macieira (AT) nokia.com
>  Senior Product Manager - Nokia, Qt Software
>      Sandakerveien 116, NO-0402 Oslo, Norway
>
>
>
> ---------------------------------------------------------------------------------------------------
> Weidlinger Associates, Inc. made the following annotations.
>
> ?This message and any attachments are solely for the intended recipient and
> may contain confidential or privileged information. If you are not the
> intended recipient, any disclosure, copying, use, or distribution of the
> information included in this message and any attachments is prohibited. If
> you have received this communication in error, please notify us by reply
> e-mail and immediately and permanently delete this message and any
> attachments. Thank you.?
>
> ?Please consider our environment before printing this email.?
>
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 1 Jun 2009 19:50:06 -0700
> From: "Malyushytsky, Alex" <alex at wai.com>
> Subject: Re: [Qt-interest] QTableWidget: cannot insert an item that is
>        already owned by another QTableWidget
> To: "qt-interest at trolltech.com" <qt-interest at trolltech.com>
> Message-ID: <F8145CF983B4DB42855E9BB7F5BE8FCC19C73159 at camail2>
> Content-Type: text/plain; charset="us-ascii"
>
> The problem is explained in the error message you get.
> One of the solution is to
>
> Move:
>    item_trackNo     = new QTableWidgetItem();
> before:
>
>    item_trackNo->setText(trackId);////trackId);
>
>
> Alex
>
>
> From: qt-interest-bounces at trolltech.com [mailto:
> qt-interest-bounces at trolltech.com] On Behalf Of Bijay Panda
> Sent: Wednesday, May 27, 2009 11:17 PM
> To: qt-interest at trolltech.com
> Subject: [Qt-interest] QTableWidget: cannot insert an item that is already
> owned by another QTableWidget
>
> Hi All,
> I am using QTableWidget for creating a table. while inserting
> QTableWdgetItem into table it's showing an error  like bellow.
>  "QTableWidget: cannot insert an item that is already owned by another
> QTableWidget ".
>
> Here is my source code.
> #include "HookWindow.h"
> hookWindow::hookWindow(QWidget* parent, Qt::WFlags fl): QWidget (parent,fl)
> {
>
>    label_msg = new QLabel("  Hook Window ",this);
>
>     _tableHookWindow = new QTableWidget(10,5,this);
>
>    item_trackNo     = new QTableWidgetItem();
>
>
> }
> ////////////////////////////////////////////////////////////////////////
> hookWindow::~hookWindow(void)
> {
>
> }
> ////////////////////////////////////////////////////////////////////////
> void hookWindow::createHookWindow(int width,int height)
> {
>    //label_msg = new QLabel("  Hook Window ",this);
>    label_msg->setGeometry(2,0,width,30);
>    label_msg->show();
>    QFont font("Helvetica", 15, QFont::Bold);
>    label_msg->setFont(font);
>
>
>    //_tableHookWindow = new QTableWidget(10,5,this);
>
>  _tableHookWindow->setGeometry(1,label_msg->y()+label_msg->height(),width,height-label_msg->height());
>    _tableHookWindow->setColumnWidth( 0,width/4.5);
>    _tableHookWindow->setColumnWidth( 1,width/5 );
>    _tableHookWindow->setColumnWidth( 2,width/5 );
>    _tableHookWindow->setColumnWidth( 3,width/5 );
>    _tableHookWindow->setColumnWidth( 4,width/5 );
>    _tableHookWindow->show();
>
>    _addLabel<<"Track No" <<"Speed"<<"Height"<<"Hdng"<<"Idty";
>    _tableHookWindow->setHorizontalHeaderLabels(_addLabel );
>
>
>
> }
>
> void hookWindow::slot_getHookWindowData(int track_id)
> {
>
>    trackId = QString::number(track_id);
>    cout<<"track_id from hookWindow::"<<trackId.toAscii().data() <<endl;
>
>
>    item_trackNo->setText(trackId);////trackId);
>    _tableHookWindow->setItem(0,0,item_trackNo);
>
> }
> Can anyone please suggest me what can be the solution.
> Any help is appreciated.
> --
> Thanks & Regards
>
> Bijay .
>
>
>
> ---------------------------------------------------------------------------------------------------
> Weidlinger Associates, Inc. made the following annotations.
>
> "This message and any attachments are solely for the intended recipient and
> may contain confidential or privileged information. If you are not the
> intended recipient, any disclosure, copying, use, or distribution of the
> information included in this message and any attachments is prohibited. If
> you have received this communication in error, please notify us by reply
> e-mail and immediately and permanently delete this message and any
> attachments. Thank you."
>
> "Please consider our environment before printing this email."
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.trolltech.com/pipermail/qt-interest/attachments/20090601/3bb7e96f/attachment.html
>
> ------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
> End of Qt-interest Digest, Vol 7, Issue 13
> ******************************************
>



-- 
Juan Pablo Crossley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090602/c3612580/attachment.html 


More information about the Qt-interest-old mailing list